Linux‎ > ‎


set umask for sftp

Create a shell file( note .sh extension) with your favourite editor(vi for me)

$ sudo vi /usr/lib/openssh/

Add the following lines:

#!/bin/bash umask 0002 /usr/lib/openssh/sftp-server

Set the execute permissions

$ sudo chmod +x

Edit the sshd_config

$ sudo vi /etc/ssh/sshd_config

Add .sh to the end of the Subsystem line(near the bottom of the file):

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


Subsystem sftp /usr/lib/openssh/

Then restart sftp server

$ sudo /etc/init.d/ssh restart

(or possibly kill -HUP the sshd proc)