[root@localhost /]# getfacl wxl/
# file: wxl/
# owner: root
# group: root
user::rwx
group::r-x
other::r-x
針對用戶對文件ACL設置;
[root@localhost wxl]# setfacl -m u:wxl:rwx wxl //u(user):wxl(文件):權限
[root@localhost wxl]# getfacl wxl
# file: wxl
# owner: root
# group: root
user::rw-
user:wxl:rwx //wxl具備讀寫執行權限
group::r--
mask::rwx
other::r-
針對組設置:setfacl -m g:wxl:rw wxl
刪除acl設置
setfacl -x u:wxl wxl
[root@localhost wxl]# getfacl wxl
# file: wxl
# owner: root
# group: root
user::rw-
group::r--
mask::r--
other::r--
事例:
組 |
用戶 |
training |
josn、liqi |
markert |
bob、lady |
manager |
alice、steve |
boss |
snake |
要求各部門、員工創建行對應的文件夾,其要求以下;
1.全部目錄文件保存在統一的文件夾下;
2.每一個組擁有獨立的文件夾;
3.不一樣部門之間不可訪問各自的文件夾;
4.每一個員工在所部門下擁有所屬文件夾;
5.同部門員工能夠查看各自文內容但不能夠修改只有用戶本身能修改本身的文件
6.boss組用戶都可以訪問各部門文件,但不能修改;
若是用傳統UGO是實現不了目前的事例的需求的;
首先完成第一二步
[root@localhost ~]# mkdir work
[root@localhost ~]# cd work
[root@localhost work]# mkdir training
[root@localhost work]# mkdir market
[root@localhost work]# mkdir manage
[root@localhost work]# ls
manage market training
[root@localhost work]#實現第三步
[root@localhost work]# chgrp training training/
[root@localhost work]# chgrp market market/
[root@localhost work]# chgrp manage manage/
root@localhost work]# chmod o-rwx training/
[root@localhost work]# chmod o-rwx market/
[root@localhost work]# chmod o-rwx manage/
[root@localhost work]# ll
total 12
drwxr-x---. 2 root manage 4096 Mar 24 06:09 manage
drwxr-x---. 2 root market 4096 Mar 24 06:09 market
drwxr-x---. 2 root training 4096 Mar 24 06:09 training
實現第四步:
[root@localhost work]# chmod g+s training/
[root@localhost work]# chmod g+s market/
[root@localhost work]# chmod g+s manage/
實現第五步
[root@localhost training]# mkdir josn^C
[root@localhost training]# mkdir liqi^C
[root@localhost training]# chown josn josn/^C
[root@localhost training]# chown liqi liqi/^C
[root@localhost training]# ll
total 8
drwxr-sr-x. 2 josn training 4096 Mar 24 06:23 josn
drwxr-sr-x. 2 liqi training 4096 Mar 24 06:23 liqi
後兩個組同上操做