Permissions and owners

The setfacl command

Grants fine-grained permissions to specific users or groups without changing the owner or the basic mode.

Syntax

setfacl -m u:usuario:permisos archivo

Most useful options

-mModifies an ACL entry
-xRemoves an ACL entry
-bRemoves all ACLs

Copy-ready examples

$ touch informe.txt && setfacl -m u:root:rw informe.txt && getfacl informe.txtGrant permission to a user

You can try them in the browser terminal: it does not touch your computer.

Typical mistakes

  • An ACL can make ls -l show a + at the end of the permissions.

Related commands

FAQ

When do I need ACL instead of chmod?

When you want to give access to one specific person without touching the other permissions.

Learn to actually use it

The basic Linux course takes you from zero to console fluency with 24 self-grading lessons.

Start the free course