Master Linux ACL Permissions: A Step‑by‑Step Guide to Secure File Access

This article explains Linux ACL permission management, covering what ACLs are, how to check and enable ACL support on partitions, and detailed commands for setting, viewing, masking, deleting, recursive, and default ACLs to securely control file and directory access.

MaGe Linux Operations
MaGe Linux Operations
MaGe Linux Operations
Master Linux ACL Permissions: A Step‑by‑Step Guide to Secure File Access

Linux permission management is essential for protecting user data and preventing file chaos; on multi‑user servers, proper ACL (Access Control List) configuration ensures that only authorized users can read, write, or execute specific files and directories.

1. What is ACL Permission?

ACLs allow fine‑grained permission assignment beyond the traditional owner/group/others model, enabling you to grant or restrict access for individual users or groups without altering existing group permissions.

2. Check Whether a Partition Supports ACL

① List partitions

df -h

② Show detailed filesystem info

dumpe2fs -h /dev/sdX

Inspect the output for the "Default mount options" line to see if acl is listed.

3. Enable ACL on a Partition

① Temporary enable

mount -o remount,acl /

This remounts the root filesystem with ACL support; the setting is lost after a reboot.

② Permanent enable

Edit /etc/fstab to add the acl option, for example:

UUID=490ed737-f8cf-46a6-ac4b-b7735b79fc63 / ext4 defaults,acl 1 1

Then remount or reboot:

mount -o remount /

4. Set ACL Permissions (setfacl)

Assign permissions to a user: setfacl -m u:username:rw- filename Assign permissions to a group: setfacl -m g:groupname:r-x filename Note that the effective permission is the logical AND of the ACL entry and the mask (default mask is rwx).

5. View ACL Permissions

getfacl filename

6. Effective Permission Mask

The mask limits the maximum permissions that any ACL entry can grant. Modify it with:

setfacl -m m:rwx filename

7. Delete ACL Permissions

① Remove a user’s ACL

setfacl -x u:username filename

② Remove a group’s ACL

setfacl -x g:groupname filename

③ Remove all ACL entries

setfacl -b filename

8. Recursive ACL Assignment

Apply ACLs to a directory and all its contents:

setfacl -m u:username:rw- -R /path/to/dir

9. Default ACLs

Set a default ACL on a parent directory so that newly created files inherit the permissions:

setfacl -m d:u:username:rw- /path/to/dir

10. Summary

This guide introduced Linux ACL permission management, showing how to enable ACL support on filesystems, assign fine‑grained permissions to users and groups, view effective permissions, adjust the mask, and manage ACLs recursively or as defaults, providing a practical tool for secure system administration.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

System AdministrationACLPermissions
MaGe Linux Operations
Written by

MaGe Linux Operations

Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.