RHCSA学习,文件的权限问题

1)/pub目录为公共存储目录对所有用户可以读,写,执行,但用户只能删除属于自己的文件(t权限)

[root@localhost ~]# chmod o+rwxt /pub
[root@localhost ~]# ll -d /pub
drwxr-xrwt. 2 root root 21 Jul 31 22:51 /pub

2)/sc目录为生产部存储目录只能对生产部人员可以写入,并且生产部人员该目录所建立的文件都自动归属到

[root@localhost ~]# mkdir /sc
[root@localhost ~]# groupadd scb
[root@localhost ~]# chgrp scb /sc
[root@localhost ~]# chmod g+rwxs /sc
[root@localhost ~]# chmod o-rwx /sc

3)/cw目录为财务部存储目录只能对财务部人员可以写入并且财务部人员所建立的文件都自动属于caiwu组中

[root@localhost ~]# mkdir /cw
[root@localhost ~]# groupadd caiwu
[root@localhost ~]# chgrp caiwu /cw
[root@localhost ~]# chmod g+rwxs /cw
[root@localhost ~]# chmod o-rwx /cw
[root@localhost ~]# ll -d /cw
drwxrws---. 2 root caiwu 6 Aug  5 21:56 /cw

4) admin用户对于/sc和/cw目录可以读,写,执行

[root@localhost ~]# setfacl -m u:admin:rwx /sc 
[root@localhost ~]# setfacl -m u:admin:rwx /cw
[root@localhost ~]# getfacl /sc/
getfacl: Removing leading '/' from absolute path names
# file: sc/
# owner: root
# group: scb
# flags: -s-
user::rwx
user:admin:rwx
group::rwx
mask::rwx
other::---

[root@localhost ~]# getfacl /cw/
getfacl: Removing leading '/' from absolute path names
# file: cw/
# owner: root
# group: caiwu
# flags: -s-
user::rwx
user:admin:rwx
group::rwx
mask::rwx
other::---

[root@localhost ~]# 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值