LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   file permissions changed after sftp (https://www.linuxquestions.org/questions/linux-newbie-8/file-permissions-changed-after-sftp-4175497653/)

ilesterg 03-10-2014 02:38 AM

file permissions changed after sftp
 
Hi all,

I have this file with a permission of 664. After I transferred the file using
Code:

sftp user1@server
then
Code:

put file
, I tried to check the file and noticed that the file permission is already 640.

I would like to know why the file permission was changed. Is this the default umask of user1 on the other server? If so, how can we override this behavior such that the file permission of all files transferred is preserved?

Thanks!

evo2 03-10-2014 03:08 AM

Hi,

I don't use sftp (prefer rsync over ssh), but the sftp man page indicates that the -p or -P flags will preserve the permissions.

Evo2.

ilesterg 03-10-2014 03:19 AM

Quote:

Originally Posted by evo2 (Post 5131922)
Hi,

I don't use sftp (prefer rsync over ssh), but the sftp man page indicates that the -p or -P flags will preserve the permissions.

Evo2.

Thank you very much for the suggestion. Aside from this, is there any way that this is done on the receiving end? Something like a config on the ssh setup of the remote user?

Thank again!

evo2 03-10-2014 03:33 AM

Hi,

I'm not aware of any ssh configuration that could do this. umask is the most likely, but it could also be acl.

Evo2.

SAbhi 03-10-2014 04:19 AM

may be this is default umask defined for ftp.. check you configuration.


All times are GMT -5. The time now is 04:59 AM.