Troubleshoot Linux File ACLs When Permissions Look Correct
Before you begin
- Applies to:Linux filesystems with access control lists (ACLs).
- Where to start:Open a shell on the host that owns the affected path. Use the actual account and path when checking access.
- What you need:Have the acl utilities and permission to inspect every relevant directory, or approved sudo access. The example uses reportbot and /srv/shared/reports.
Guide tools
Troubleshooting Steps
Identify the account and operation
Start hereDistinguish creating a new entry from modifying an existing file. Creating requires write and search access on the containing directory. Modifying a file may also require access to the file itself. Compare the running service’s identity and groups with the expected account.
id reportbotnamei -l -- /srv/shared/reportsInspect access ACLs on every relevant path component
The mode display gives a starting point. Check access ACLs on the directories where traversal or writing could fail. Directories require search permission for traversal. If only an existing file fails, inspect its ACL separately.
getfacl -p -- /srv /srv/shared /srv/shared/reportsInterpret named entries and the mask
For example, a named reportbot entry of rwx combined with a mask of r-x yields effective r-x. The account can traverse that directory but cannot create an entry there. Default ACLs determine inheritance on new children. Review the directory’s access ACL to explain access to the directory itself.
What you should see · The named entry and mask explain the effective permission for the affected account.
If you see something else · If traversal fails, inspect the first blocking parent from Step 2. If the directory can be traversed but an entry cannot be created, check write and search on the containing directory. Use Step 4 to confirm with the affected identity.
Verify using the affected identity
Run this read-only test as the approved service account. Status 0 means both tests passed. A failed test requires you to find the precise blocking component. For services that run in a sandbox or use supplementary groups set by the service manager, compare the real service context before closing the issue.
sudo -u reportbot -- sh -c 'test -x "$1" && test -w "$1"' sh /srv/shared/reportsCorrect one ACL with a rollback plan
Before changing the identified path, save its getfacl -p output to a protected change record. Have the owner approve the required rights and review all entries affected by any mask change. If the current mask already permits the intended access, use a narrow named entry and preserve the mask when appropriate. If a change widens access unexpectedly, restore the saved ACL with the documented setfacl restore procedure. The example previews a named entry without recalculating an existing mask. Check the proposed effective permissions before the owner applies anything.
setfacl --test --no-mask -m u:reportbot:rwx -- /srv/shared/reportsVerify the intended access and review other controls
Compare the new ACL with the snapshot. Retest the exact operation as the intended account in an approved location, and confirm a comparison account still has the intended boundary. If the ACL allows access but the real service remains blocked, review SELinux, AppArmor, service sandboxing, or a read-only mount.
Decide What to Do Next
| Finding | Next action |
|---|---|
| Effective permissions are lower than the entry | Review the mask and every entry it limits. |
| A parent directory lacks search permission | Fix the specific traversal boundary through its owner. |
| Shell test succeeds but the service fails | Inspect the service identity, confinement, and mount view. |
References
Your feedback keeps these production procedures accurate and battle-tested.