setfacl ACL on Linux
Default Behavior of setfacl
By default, setfacl recalculates the ACL mask entry unless a mask entry was explicitly given.
Setting Default Permissions
To ensure new files are owned by the developers group and have the default permissions, use the following commands:
setfacl -m g:developers:rwX default:user:rwX default:group:rX default:other:rX /path/to/directory
Adding Options to etcfstab
In case the directory is located on the root filesystem, add the following option to your /etc/fstab:
/dev/sda1 / ext4 defaults,acl 0 0
Setting Default ACLs
As documented in the man page for setfacl, default ACLs can be set by prepending them with "default".
Troubleshooting
If the mask is not being set by default, the reason may be unclear. However, you can try the following:
getfacl -e /path/to/directory | grep mask
This should output the mask entry. If it is not present, you can manually add it using the following command:
setfacl -m mask:rwX /path/to/directory
Comments