FACL:filesystem access control list,文件系統(tǒng)訪問控制列表
FACL可以針對單一用戶、單一文件或目錄來進(jìn)行r,w,x的權(quán)限控制,對于需要特殊權(quán)限的使用狀況有一定幫助。如,某一個文件,不讓單一的某個用戶訪問。它是對Linux傳統(tǒng)的owner,group,other的rwx權(quán)限的一種補(bǔ)充。
getfacl:取得某個文件/目錄的ACL設(shè)置項目
setfacl:設(shè)置某個文件/目錄的ACL設(shè)置項目
setfacl 參數(shù)
? ? ? ? -m:設(shè)置后續(xù)acl參數(shù)
? ? ? ? ? ? ? ? setfacl -m u:uid(用戶名也可以):perm ? ?/somewhere/file
? ? ? ? ? ? ? ? setfacl -m g:gid(組名也可以):perm? ? /somewhere/file
? ? ? ? ? ? ? ? setfacl -m u:502:rw /root/test.txt
? ? ? ? -x:取消后續(xù)acl參數(shù)
? ? ? ? ? ? ? ? setfacl -x u:uid /somewhere/file
? ? ? ? ? ? ? ? setfacl -x g:gid /somewhere/file
? ? ? ? -b:刪除全部的acl參數(shù)
? ? ? ? -k:刪除默認(rèn)的acl參數(shù)
? ? ? ? -R:遞歸設(shè)置acl參數(shù),包括子目錄
? ? ? ? -d:設(shè)置默認(rèn)的acl參數(shù)
注:所設(shè)置的權(quán)限并非只根據(jù)ACL配置來決定,它是由用戶基本權(quán)限和ACL權(quán)限進(jìn)行“與”運(yùn)算來決定的