Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

It's possible to force any ssh type connection to have a umask of 0777 using pam. This is what I have:

# /etc/pam.d/ssh
sesssion required umask=0777

I want to do this only for a certain user/group. I've read that pam_umask is capable of this, but I've not been able to figure out how.

share|improve this question

It won't work for non-login sessions, but I've always taken the approach of modifying the user's .bash{rc,profile}. Failing that, you can do the opposite: set umask to 0777 with pam, and then change that further for login sessions in global bashrc.

That said, a umask of 0777 is alarming. You realize this means your users will create files with a mode of 0000--that is, no access for anyone--right?

share|improve this answer
Yup, I realize that. It has to be for non-login sessions. I want the default umask for login sessions. – MTeck Apr 27 '12 at 19:28

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.