Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set umask for a sftp account?

Tags:

unix

ssh

sftp

Could anyone tell me how to set the umaskfor a single sftp user? Worth mentioning is a IBM AIX...

Adding umask 002 to that user's .profile didn't work... (the goal is that this user files are accesible to people from the same group).

I've seen somehowto's around editing the sftpd configs, though I want to set it for one user only, so I expected to find something that didn't need root access.

thanks!

f.

like image 916
filippo Avatar asked Oct 08 '10 09:10

filippo


1 Answers

Worked great for me. However, needed a bit of research because what you provided is an extract from docs. A specific example in my case would be to put two consecutive lines at the end of /etc/ssh/sshd_config

Match Group www-data
ForceCommand internal-sftp -u 2

In my case what I wanted to do is to set umask to '002' (2 in decimal) if someone in group 'www-data' logs in.

There is also an option to use env. variable SSH_ORIGINAL_COMMAND instead of 'internal-sftp', but I did not have time to pursue that.

like image 114
dominikz Avatar answered Oct 26 '22 09:10

dominikz