Setting per-directory umask using ACLs

Posted by Yarin on Server Fault See other posts from Server Fault or by Yarin
Published on 2012-12-16T20:32:12Z Indexed on 2012/12/16 23:05 UTC
Read the original article Hit count: 197

Filed under:
|
|
|
|

We want to mimic the behavior of a system-wide 002 umask on a certain directory foo, in order to ensure the following result:

  1. All sub-directories created underneath foo will have 775 permissions
  2. All files created underneath foo and subdirectories will have 664 permissions
  3. 1 and 2 will happen for files/dirs created by all users, including root, and all daemons.

Assuming that ACL is enabled on our partition, this is the command we've come up with:

setfacl -R -d -m mask:002 foo

This seems to be working- I'm basically just looking for confirmation. Is this the most effective way to apply a per-directory umask with an ACL?

© Server Fault or respective owner

Related posts about linux

Related posts about permissions