单一用户的ACL权限设定

应用背景

想让student可以进入/home/cakingroups这个目录进行查询但不可写入。同时cakin5在/home/cakingroups内不具有任何权限。
第一步:添加用户
[root@localhost ~]# useradd student
[root@localhost ~]# passwd student
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
用同样的方法添加 cakin5用户
第二步:设置ACL权限
[root@localhost ~]# setfacl -m u:student:rx /home/cakingroups
[root@localhost ~]# setfacl -m u:cakin5:- /home/cakingroups
第三步:查看权限
[root@localhost ~]# getfacl /home/cakingroups
getfacl: Removing leading '/' from absolute path names
# file: home/cakingroups
# owner: root
# group: cakingroup
# flags: -s-
user::rwx
user:cakin5:---
user:student:r-x
group::rwx
mask::rwx
other::---
[root@localhost ~]# ll -d /home/cakingroups
drwxrws---+ 2 root cakingroup 6 Nov 6 11:04 /home/cakingroups

相关文章

迭代器模式(Iterator)迭代器模式(Iterator)[Cursor]意图...
高性能IO模型浅析服务器端编程经常需要构造高性能的IO模型,...
策略模式(Strategy)策略模式(Strategy)[Policy]意图:定...
访问者模式(Visitor)访问者模式(Visitor)意图:表示一个...
命令模式(Command)命令模式(Command)[Action/Transactio...
生成器模式(Builder)生成器模式(Builder)意图:将一个对...