Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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

I want a separate umask for a directory or a user. How can I do this?

Edit: I am using Debian 6.

The reason why I want to do this is, I want all my SFTP users to create files with write on group. I am using a SFTP client to test to see if the umask is setting properly.

share|improve this question

migrated from serverfault.com Aug 9 '11 at 21:56

This question came from our site for system and network administrators.

That depends… what OS are you using? – MikeyB Aug 9 '11 at 21:35
Did you look at this question? serverfault.com/questions/70876/… – Zoredache Aug 9 '11 at 23:08
@Zoredache Yes. – Doug Aug 9 '11 at 23:09
If you ask a crap question - you get the wrong answers. – Iain Aug 10 '11 at 6:10
No one is complaining about getting wrong answers. – Doug Aug 10 '11 at 7:32

For directories, what may work for you is using Extended ACLs and the masks, if you're on Linux.

You can have a separate umask for each user by putting the umask xxx command into their ~/.profile.

share|improve this answer
Why might I be getting this error Operation not supported? setfacl -d -m m:002 /srv/www/domain.com/public_html/ – Doug Aug 9 '11 at 23:27
I was following this guide (debianhelp.co.uk/acl.htm) and I couldn't mount the /dev/hda6 because its not there. I am on a VPS. – Doug Aug 10 '11 at 0:05
/dev/hda6 is the device node in the example on that page… odds are your server is different. You need to add the 'acl' option to the appropriate mountpoint in /etc/fstab and remount it (mount -o remount,acl /dev/whatever /srv) – MikeyB Aug 10 '11 at 1:35
I don't know what I should be adding to the fstab, so I cannot implement this properly. Could you please help me? – Doug Aug 10 '11 at 5:20

You need this to set default permissions for a particular system group in a folder,right? Check this existing thread for the same question which covers this in detail.

share|improve this answer
I am having trouble learning how to do this. I don't know how should I be editing the fstab file. – Doug Aug 10 '11 at 5:15

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.