System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

Permission changed after sftp

raiden
Regular Advisor

Permission changed after sftp


Hi ,

When I am transferring a file with permission 644 from Source Server, the permission changes to 600 on the Destination Server.

On Destination Server I tried setting the umask in my profile but still the permissions reamain 600 after file transfer.

There is a setting in sshd_config file "SftpUmask". But I dont want to use this as it will be applicable to all other users using sftp ..

How do i Achieve this if I want the permission to be same as that on Source Server.


Please help
7 REPLIES
Rita C Workman
Honored Contributor

Re: Permission changed after sftp

sftp allows for interactive commands, which you should be able to do from either the command line manually or within a script. Once the transfer of this specific file is transferred just put in the chmod / and then end the transmission.

Just a thought,
Rita
raiden
Regular Advisor

Re: Permission changed after sftp

Hi Rita,

Does that mean that this cannot be achieved by default.

Is it mandatory to execute chmod to change the permissions.??
Michael Steele_2
Honored Contributor

Re: Permission changed after sftp

Hi

Use /etc/ftpd/ftpaccess

upload /home/user1 /path/to/upload/dir yes user1 group1 0666

file: any written to /home/user1 dir
user: user1
group: group1
perm of an file in /home/user1: 066
Support Fatherhood - Stop Family Law
raiden
Regular Advisor

Re: Permission changed after sftp

Please suggest some other method other than ftpaccess. i Dont want to make use of ftpaccess
Tingli
Esteemed Contributor

Re: Permission changed after sftp

How about using scp?
Michael Steele_2
Honored Contributor

Re: Permission changed after sftp

in the users .profile / .login file, or whatever shell related configuartion file that you are using

umask 027, etc.
Support Fatherhood - Stop Family Law
Michael Steele_2
Honored Contributor

Re: Permission changed after sftp

Geez, points for only 66 of 139 responses and I never saw anything bigger than a 7 and none are close. Why don't you just send part of your check since ...
Support Fatherhood - Stop Family Law