20、文件系统访问控制列表详解

文件系统访问控制列表详解

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 条目指定。
- 如果文件没有明确定义的

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值