This guide explains how to manage file and directory permissions using Access Control Lists (ACL) in Linux. It includes examples of basic file operations, ACL modifications, and recursive permission management.
3.Modifying ACL for user and group
7.Recursive Permissions for a Directory
9.Resetting All ACL Permissions
10.Setting Default ACL for a Directory
-
View ACL of a file
getfacl <file>
-
Grant permissions
setfacl -m u:<user>:<permissions> <file>
-
Remove permissions
setfacl -x u:<user> <file>
-
Reset all ACLs
setfacl -b <file>
-
Recursive ACL for directories
setfacl -Rm u:<user>:<permissions> <directory>
-
Set default ACL for directories
setfacl -m d:u:<user>:<permissions> <directory>
Displays the Access Control List (ACL) of the file f1.
Grants read-only (r) permission to user tom.
Grants read, write, execute (rwx) permissions to group A1.
Grants write-only (w) permission to others.
Adds the following: User varun gets rw (read, write) permissions. Group B1 gets rx (read, execute) permissions. User jack gets rwx (read, write, execute) permissions.
Sets the mask to read-only (r), which limits the effective permissions for group and other ACL entries.
both have different permission but when we use -R recursive then
Recursively grants write permission to user tom for the directory abc and all its contents (like f2).
Removes the ACL entry for user varun.
Removes all ACL entries from file f1.
Sets a default ACL for user don with rwx permissions. Any new file created inside abc will inherit these default permissions.
- Use
ls -lto identify ACL-enabled files (+sign).
- Use
maskto limit the maximum effective permissions for ACL entries.
This guide was created to assist with Linux ACL management and improve understanding of permission settings.











