Skip to main content

Setup Access Control Lists (ACL)

ACL can be used to provide additional permissions to the file system.

If not installed run the following command: sudo apt install acl

There are two commonds: setfacl to set acl and getfacl to get acl permissions

To get acl of a folder:

getfacl ~/test

it returns with a similar result:

# file: test/
# owner: user
# group: user
user::rwx
group::r-x
other::r-x

To set the acl for a user:

setfacl -m "u:user:permissions" /path/to/file

For example:

setfacl -m u:user:rwx test/

But if you want to change the permission recursively for a user:

setfacl -RdmRm u:user:rwx test

To change the permission recursively for a group:

setfacl -RdmRm g:group:rwx test

To remove all the acl permissions:

setfacl -b path/to/file