Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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
    
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
add comment

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

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

2 Answers

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
add comment

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
add comment

Your Answer

 
discard

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.