setfacl
Linux · Files · reference only
What it does
Sets or modifies the access control lists (ACLs) of files and directories, to grant permissions to specific users or groups.
Syntax
setfacl [opciones] entrada fichero...
Options and parameters
-m entradaModifies or adds ACL entries, such as u:ana:rw.
-x entradaRemoves specific ACL entries.
-bRemoves all extended ACL entries.
-kRemoves a directory's default ACL.
-dApplies the operations to the default ACL.
-RApplies the changes recursively.
-nDoes not recalculate the ACL mask.
Usage examples
setfacl -m u:ana:rw informe.txtGives ana read and write permission on the file.
setfacl -x u:ana informe.txtRemoves ana's entry.
setfacl -d -m g:devs:rwx proyectoMakes new files in proyecto grant permissions to the devs group.
setfacl -b informe.txtRemoves all extended ACLs and leaves the normal permissions.
Notes and common mistakes
- The effective mask limits the permissions of named users and groups.
- The file system must be mounted with ACL support.