Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've been trying to set umask 002 to my sftp users, I already tried setting the umask in the following files:


  Subsystem sftp    /usr/libexec/openssh/sftp-server            #works
    #Subsystem sftp /usr/libexec/openssh/sftp-server -u 0002              #failed
    #Subsystem sftp /bin/sh -c ‘umask 0002; /usr/libexec/openssh/sftp-server’ #failed
    #Subsystem       sftp    /opt/                      #failed
    #Subsystem   sftp    /bin/bash -c ‘umask 0002; /usr/libexec/openssh/sftp-server’ #failed


   (session    optional umask=0002)

I know that if you are using a newer version for OpenSSH you can use the '-u' option, so I tried to upgrade it but yum says that there is no newer version for OpenSSH and I don't want to install it manually haha because I don't know if at the this will resolve my issues.

Do you know how to set umask to sftp with OpenSSH 5.3?

Here are some details:

  • CentOS 6
  • OpenSSH 5.3

Thank you in advance!

P.S: I already tried the following recomendations withour results: OpenSSH 5.3 setting UMASK for SFTP chroot env, dosen't work at all

Increasing permissiveness/permissions for umask + openssh + chrooted SFTP server using internal-sftp

Ok guys here are some updates,

I tried to set the umask to /etc/pam.d/login too like this:

session    optional developers umask=0002

I restarted the sshd service after that but, nothing happened, everytime I login with my ftp account and upload a file I still got the rw-rw-r permissions.

I've been researching over the web about this issue but there is no info about this.

I just need to set the permissions or umask for my users to 775,

I would appreciated some help!

Thank you!

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.