Saturday, December 5, 2015

ssh - How do I set default permissions for SFTP for an Ubuntu Server?



We have an Ubuntu 10.04 server. How can I set it so that new files created (or copied) over SFTP or SSH have g+rw and g+rwx permissions (where appropriate)?



I'm also using setgid (chmod g+s) so that they inherit the proper group owner.


Answer



In /etc/ssh/sshd_config, change the following:




Subsystem sftp /usr/lib/openssh/sftp-server



to:



Subsystem sftp /bin/sh -c 'umask 0002; exec /usr/libexec/openssh/sftp-server'



Soure: http://jeff.robbins.ws/articles/setting-the-umask-for-sftp-transactions


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...