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 ~]#