Progress: 0/62 (0%)

πŸ“œ Managing Access Control Lists (ACLs)

Managing Access Control Lists (ACLs)

Basic Linux permissions (rwx for user, group, others) are sometimes too rigid. ACLs let you give specific permissions to individual users or groups without changing the main file owner.
Think of ACLs like customizing who can enter specific rooms in a shared building, rather than only using the standard keys for owner/group/others.

5.1 Viewing ACLs

getfacl filename

Shows all ACL entries for a file

πŸ“Œ Example:
# file: report.txt
# owner: alice
# group: marketing
user::rw-
user:bob:r--
group::r--
mask::rwx
other::r--

user:bob:r-- β†’ Bob can read, even if he's not the owner or in the group

5.2 Setting ACLs

setfacl -m u:username:permissions filename
setfacl -m u:bob:rw report.txt

Example:
Gives Bob read and write access
Owner and group permissions remain intact

5.3 Removing ACLs

setfacl -x u:username filename
setfacl -x u:bob report.txt

Example:
Removes Bob's special access

5.4 Recursive ACLs for directories

setfacl -R -m u:bob:rw project/

Applies ACL to all files/folders inside project/

5.5 Quick Tips

ACLs are powerful but can get complex, so use them carefully.
Combine with ls -l and getfacl to always know who can do what.
Useful in multi-user environments like shared servers or project directories.

Real-life analogy

Analogy: Giving Bob a custom key to certain rooms in the building, while everyone else keeps their normal access.

βœ… That completes the full Permissions and Security lesson.

If you want, I can make a visual summary cheat-sheet showing rwx, chmod, chown, sudo, and ACLs in one viewβ€”it makes remembering all this super easy.

Do you want me to do that?

Β© All Rights preserved with Deep Cyber

Cookie Policy

This website uses cookies to ensure you get the best experience on our website.

Go It!