文件系统访问控制列表详解
1. 传统模式与 ACL 的交互
文件使用 ACL 时会保留其原始模式位,并且系统会自动确保一致性,两组权限不会冲突。例如:
$ touch example
$ ls -l example
-rw-rw-r-- 1 garth garth 0 Jun 14 15:57 example
$ getfacl example
# file: example
# owner: garth
# group: garth
user::rw-
group::rw-
other::r--
$ chmod 640 example
$ ls -l example
-rw-r----- 1 garth garth 0 Jun 14 15:57 example
$ getfacl --omit-header example
user::rw-
group::r--
other::---
上述示例展示了使用标准 chmod 命令更改权限时,ACL 条目会自动更新。
为减少歧义,有以下规则:
- 用户( user:: )和其他( other:: )的 ACL 条目与传统模式中的“所有者”和“其他”权限位相同。更改模式会改变相应的 ACL 条目,反之亦然。
- 文件所有者和未特别提及的用户的有效访问权限分别由 user:: 和 other:: ACL 条目指定。
- 如果文件没有明确定义的
超级会员免费看
订阅专栏 解锁全文

被折叠的 条评论
为什么被折叠?



