[root@localhost ~]# setfacl -b /home/test.txt //刪除所有acl權(quán)限
使用vim打開文件之后無法對文件進(jìn)行修改[root@localhost ~]# setfacl -m o::rwx /home/file1[root@localhost ~]# getfacl /home/file1 getfacl: Removing leading '/' from absolute path names# file: home/file1# owner: root# group: rootuser::---user:alice:rw-group::---mask::rw-other::rwx[root@localhost ~]# setfacl -m m::r /home/file1 [root@localhost ~]# getfacl /home/file1 getfacl: Removing leading '/' from absolute path names# file: home/file1# owner: root# group: rootuser::---user:alice:rw- #effective:r-- 有效權(quán)限:rgroup::---mask::r--other::rwx[alice@localhost ~]$ cat /home/file1 333[alice@localhost ~]$ vim /home/file1 使用vim打開文件之后無法對文件進(jìn)行修改,因?yàn)槲覀兊膍ask值是r,不是空的,所以alice用戶不會(huì)繼承other的權(quán)限[root@localhost ~]# setfacl -m m::- /home/file1 [root@localhost ~]# getfacl /home/file1 getfacl: Removing leading '/' from absolute path names# file: home/file1# owner: root# group: rootuser::---user:alice:rw- #effective:---group::---mask::---other::rwx[root@localhost ~]# su - alice[alice@localhost ~]$ cat /home/file1 333ddd[alice@localhost ~]$ vim /home/file1這個(gè)時(shí)候使用vim打開文件的時(shí)候就可以對文件的內(nèi)容進(jìn)行修改了,因?yàn)閙ask值為空,所以alice會(huì)繼承other的身份總結(jié):mask的值不為空的時(shí)候,單獨(dú)設(shè)置用戶或者是組的acl權(quán)限就受自己的權(quán)限的影響,不包括user(屬主)和other(其他人),但是如果將mask的值設(shè)置為空,單獨(dú)設(shè)置過acl權(quán)限的用戶會(huì)受other的權(quán)限的影響。default: 繼承(默認(rèn))要求: 希望alice能夠?qū)?tmp/dir100以及以后在/tmp/dir100下新建的文件有讀、寫、執(zhí)行權(quán)限[root@localhost tmp]# mkdir dir100[root@localhost tmp]# touch dir100/file1 dir100/file2一: 賦予alice對/tmp/dir100以及目錄下以存在的文件和文件夾讀、寫、執(zhí)行權(quán)限[root@localhost ~]# setfacl -R -m u:alice:rwx /tmp/dir100[root@localhost tmp]# getfacl dir100/file1 # file: dir100/file1# owner: root# group: rootuser::rw-user:alice:rwxgroup::r--mask::rwxother::r--[root@localhost tmp]# getfacl dir100/file2 # file: dir100/file2# owner: root# group: rootuser::rw-user:alice:rwxgroup::r--mask::rwxother::r--[root@localhost tmp]# touch dir100/file3[root@localhost tmp]# getfacl dir100/file3 # file: dir100/file3# owner: root# group: rootuser::rw-group::r--other::r--二: 賦予alice對以后在/tmp/dir100下新建的文件有讀、寫、執(zhí)行權(quán)限 (使alice的權(quán)限繼承)[root@localhost ~]# setfacl -m d:u:alice:rwx /tmp/dir100[root@localhost tmp]# getfacl dir100/# file: dir100/# owner: root# group: rootuser::rwxuser:alice:rwxgroup::r-xmask::rwxother::r-xdefault:user::rwxdefault:user:alice:rwxdefault:group::r-xdefault:mask::rwxdefault:other::r-x[root@localhost tmp]# touch dir100/file4[root@localhost tmp]# getfacl dir100/file4 # file: dir100/file4# owner: root# group: rootuser::rw-user:alice:rwx #effective:rw-group::r-x #effective:r--mask::rw-other::r--
新聞熱點(diǎn)
疑難解答
圖片精選