هذا الجزء لم يُترجم بعد. أنت ترى النص الإنجليزي.
$ مستخدم عادي# بصلاحية root (أو مع sudo)
The quick answer
Step by step
- Base rights (lines 1–3) — group
financeowns the folder;2770= full access for owner and group, nothing for others, plus the setgid bit (the2): new files belong to the groupfinance, not to the user's own group. - Extra group (line 4) —
auditorsmay list and read.xon a folder means "may enter it". - Default ACL (line 5) — new files and folders inside get these entries automatically. Without it, files created later have only the normal rights.
- Read the ACL —
ls -lshows a+after the rights when an ACL exists;getfaclshows all entries:
# file: srv/finance
# owner: root
# group: finance
# flags: -s-
user::rwx
group::rwx
group:auditors:r-x
mask::rwx
other::---
default:user::rwx
default:group::rwx
default:group:finance:rwx
default:group:auditors:r-x
default:mask::rwx
default:other::---- Existing files — ACLs are not applied backwards. Give the auditors read access to what is already there (capital
X= execute only for folders):
setfacl -R -m g:auditors:rX /srv/finance- The mask — the upper limit for named users and groups. A
chmod g-won a file lowers the mask, and then the ACL write right does not work any more ("effective: r--" ingetfacl). - Remove — one entry:
setfacl -x g:auditors /srv/finance; all ACLs:setfacl -b /srv/finance. - Keep ACLs in copies and backups —
cp -a,rsync -A,tar --acls; otherwise they are lost.
Check that it worked
As a finance user, touch /srv/finance/report.ods works and the new file shows group finance and the auditors entry in getfacl; as an auditor, reading works but touch /srv/finance/x fails with Permission denied; other users cannot even list the folder.
Common problems
| Problem | Cause | Fix |
|---|---|---|
Operation not supported | File system without ACL support. | ext4/XFS support ACLs; check mount options and NFS version. |
| New files lack the ACL | No default ACL on the folder. | setfacl -d -m … on the folder. |
| ACL says rwx but writing fails | Mask lowered (effective:r--). | setfacl -m m::rwx FILE; avoid chmod g-w on shared files. |
| New files have the user's own group | No setgid bit. | chmod g+s on the folder. |
| ACLs gone after restore | Backup tool did not keep them. | rsync -A, tar --acls, cp -a. |
| User added to the group still denied | Old login session without the new group. | Log out and in again (or newgrp). |
Go further
- Command pages: setfacl, getfacl, chmod, chgrp.
- Next how-tos: Change file permissions and owner, Find files with risky permissions, Share a folder with NFS, Protect a file with chattr.
- Learn it: RHCSA — Shared folders, RHCSA — ACLs, RHCSA — Special permissions.
1What does a default ACL do?
New files and folders created inside the folder get the default ACL entries automatically.
2What is the ACL mask?
The upper limit for named users and groups; rights above the mask are not effective.