ACL Force Directory Permissions

This is just a quick and dirty how-to on acl commands. For more details please read the man pages.

First of all, if you want to look at the acl settings run the following command:

# getfacl /path/to/dir

If you want to set acl permissions you must use the setfacl command as root.

For only the parent directory use:

# setfacl -m user:username:rwx
OR
# setfacl -m group:groupname:rwx

For all subdirectories use:

# setfacl -R -m user:username:rwx

If you want a default acl to be applied (only on directories) use:

# setfacl -R -d -m user:username:rwx

Note: If you have an existing tree you should create a default acl using the -d and also a standard recursive setting such as:

# setfacl -R -d -m user:username:rwx
# setfacl -R -m user:username:rwx

You should also set the mask as well so you don't get screwed up with the wrong effective mask

# setfacl -R -d -m mask:rwx
# setfacl -R -m mask:rwx

If you don't, none of the existing files will have the permissions modified (if you don't believe me check for yourself using getfacl)