Access Control Lists (getfacl & setfacl)
Concept & Overview
Standard Linux permissions only support one user owner, one group, and others. When complex enterprise collaboration requires granting distinct rights to multiple users or groups on a single file, POSIX Access Control Lists (ACLs) are used:
- getfacl : Reads and displays the file's extended ACL entries (user, group, mask, other).
- setfacl -m u:: Modifies the ACL to grant specific permissions (r, w, x) to an individual user without changing the file owner.
- Notice that when a file has an ACL, ls -l displays a + symbol at the end of the permission string (e.g., -rw-rw-r--+).
/home/learner/notes.txt:1. Run
getfacl notes.txt to inspect its existing Access Control List entries.2. Grant the user
deployer read and write permissions by running setfacl -m u:deployer:rw notes.txt.Command Syntax Reference
| Command / Syntax | Description |
|---|---|
getfacl notes.txt | Display Access Control List entries for file |
setfacl -m u:deployer:rw notes.txt | Grant fine-grained user permissions with setfacl -m |
Verification Objectives
These conditions will be automatically verified when you run commands inside the interactive terminal simulator:
- ○Run getfacl on notes.txt
- ○Grant deployer read/write ACL (setfacl -m u:deployer:rw notes.txt)
Ready to complete Quest 39?
Test your skills live in the browser terminal with an emulated Linux filesystem, real-time command evaluation, and instant step-by-step hints.