`
cakin24
  • 浏览: 1337119 次
  • 性别: Icon_minigender_1
  • 来自: 西安
社区版块
存档分类
最新评论

单一用户的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
1
3
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics