#1、创建g1组,要求创建一个属于redhat用户g1组的文件redhat.txt
#2、新建/sc目录,所属组为group组,root用户和group组用户可在该目录下创建文件,其他人无任何权限
#3、新建/cw目录为财务部存储目录,只能对财务部人员可以写入,并且财务部人员所建立的文件都自动属于mygroup组中
#4、设置helen用户对于/sc和/cw目录可读、可写、可执行
#5、设置/test目录为公共存储目录,对所有用户可以读、写、执行,但用户只能删除属于自己的文件。
#6、在/test/dir里创建的新文件自动属于temp组
[root@localhost ~]# touch redhat.txt
[root@localhost ~]# chown redhat:g1 redhat.txt
[root@localhost ~]# mkdir /sc
[root@localhost ~]# groupadd group
[root@localhost ~]# chown :group /sc
chmod 770 /sc
[root@localhost /]# cd /root
[root@localhost ~]# mkdir /cw
[root@localhost ~]# groupadd mygroup
[root@localhost ~]# useradd caiwubu
[root@localhost ~]# chown caiwubu:mygroup /cw
[root@localhost ~]# useradd helen
[root@localhost ~]# setfacl -m u:helen:rwx /sc /cw
[root@localhost ~]# getfacl /sc /cw
getfacl: Removing leading '/' from absolute path names
# file: sc
# owner: root
# group: group
user::rwx
user:helen:rwx
group::rwx
mask::rwx
other::---
# file: cw
# owner: caiwubu
# group: mygroup
user::rwx
user:helen:rwx
group::r-x
mask::rwx
other::r-x
[root@localhost ~]# mkdir /test
[root@localhost ~]# chmod 777 /test
[root@localhost ~]# chmod o+t /test
[root@localhost ~]# groupadd temp
[root@localhost ~]# touch /test/dir
[root@localhost ~]# chmod g+s /test
[root@localhost ~]# chown :temp /test
[root@localhost ~]# ll -d /test
drwxrwsrwt. 2 root temp 17 4月 25 19:48