Set file access control lists
high risk
getfacl -R <path> > acl.bakBack up current ACLssetfacl --restore=acl.bakRestore them if neededAdds, modifies or removes ACL entries. Use for fine-grained sharing without changing groups.
| Flag | Meaning |
|---|---|
-m | Modify ACL entries |
-x | Remove entries |
-b | Remove all ACLs |
-R | Recurse |
-d | Set default ACL for new files |
setfacl -m u:alice:rwX /srv/sharedGrant alice access · explain & risk-check →setfacl -R -m g:dev:rX /srv/appRecursive read access for a group · explain & risk-check →Reference text is hand-written and may be incomplete — check man setfacl for your version. Test destructive commands on a non-production system first.