傳統 rwx 僅能設定 owner/group/other 三組權限,ACL (Access Control List) 允許為任意單一用戶/群組指定獨立權限,滿足企業級多租戶、NFS/Samba 共享等複雜場景。
sudo apt-get install aclyum -y install aclpacman -S aclmount | grep acl 或 tune2fs -l /dev/sdX | grep acl。/etc/fstab 對應分區掛載選項加入 acl,重新掛載:mount -o remount,acl /mount/pointsetfacl -m u:username:rwx /path/to/file:給特定用戶 rwx 權限setfacl -m g:groupname:rx /path/to/dir:給群組 rx 權限getfacl /path/to/file:檢視 ACL 規則setfacl -x u:username /path/to/file:移除特定用戶 ACLsetfacl -b /path/to/file:移除所有 ACL(保留基礎 rwx)目錄設定 setfacl -d -m u:user:rwx /dir,新建檔案/子目錄自動繼承。
支援 ACL 的檔案系統:ext2/3/4、XFS、Btrfs、JFS、ReiserFS 等主流格式均支援。