加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

单一用户的ACL权限设定

发布时间:2020-12-14 02:02:25 所属栏目:百科 来源:网络整理
导读:应用背景 想让student可以进入/home/cakingroups这个目录进行查询但不可写入。同时cakin5在/home/cakingroups内不具有任何权限。 解决方法 第一步:添加用户 [root@localhost ~]# useradd student [root@localhost ~]# passwd student New password: Retype

应用背景

想让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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读