scp/sftp umask

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Gary Nichols
Date:  
Subject: scp/sftp umask
On Thu, 5 Feb 2004, Craig White wrote:
> # scp -r testdir exchange@localhost:
> exchange@localhost's password:
> #
> and then finally...
> back in the original directory...
> ls -l
> drwxrwxrwx    2 exchange dom_users     4096 Feb  5 10:20 testdir
> -rwxr-xr-x    1 exchange dom_users      347 Feb  5 10:20 testfile2

>
> the directory is group writable, the file is not. This means that only
> the user exchange can delete these files. This is not acceptable. This
> has nothing to do with WinSCP


Your permissions are getting whacked because you're not using the "-p"
option to scp. Your command should be:

scp -rp file user@localhost:/dir

I have seen some man pages for scp that do not document this option for
some reason.

Gary