From beeaf0257b202d9bfd49e69a60e299ca671485dc Mon Sep 17 00:00:00 2001 From: kddubb Date: Wed, 19 Dec 2018 07:50:05 -0700 Subject: [PATCH] Need to use octal to get the correct permissions & with the int 777 rather than the octal 0o777 changes the perms on the remote file to be wrong. For me it set everything to 400 rather than 644. --- examples/scp_write.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/scp_write.py b/examples/scp_write.py index b7869a12..a29aa24a 100755 --- a/examples/scp_write.py +++ b/examples/scp_write.py @@ -36,7 +36,7 @@ def main(): s.handshake(sock) s.agent_auth(args.user) fileinfo = os.stat(args.source) - chan = s.scp_send64(args.destination, fileinfo.st_mode & 777, fileinfo.st_size, + chan = s.scp_send64(args.destination, fileinfo.st_mode & 0o777, fileinfo.st_size, fileinfo.st_mtime, fileinfo.st_atime) print("Starting SCP of local file %s to remote %s:%s" % ( args.source, args.host, args.destination))