facl權限(getfacl/setfacl)


file access control list:文件訪問控制列表

查看facl:

[root@localhost test]# getfacl hei

# file: hei

# owner: root

# group: root

user::rwx

group::rw-

other::rw-

修改facl:

setfacl -m u:test:rw-  file_name   (設置用戶權限

setfacl -m g:test:rw-  file_name  (設置組權限)

注意 u,g,沒有 -o

[root@localhost test]# setfacl -m o:test:rw- hei ---報錯

setfacl: Option -m: Invalid argument near character 3

 

[root@localhost test]# setfacl -m u:test:rw- hei   ---在hei文件上給test用戶rw-權限

[root@localhost test]# getfacl hei

# file: hei

# owner: root

# group: root

user::rwx

user:test:rw-

group::rw-

mask::rw-

other::rw-

[root@localhost test]# ll -d hei

drwxrw-rw-+ 2 root root 6 Oct  3 23:23 hei ---后面有+號表示有facl權限,有了facl權限再看ugo權限無意義。

刪除指定用戶facl權限:

[root@localhost test]# setfacl -x u:test hei       ----選項-x刪除權限

[root@localhost test]# getfacl hei

# file: hei

# owner: root

# group: root

user::rwx

group::rw-

mask::rw-

other::rw-

刪除文件上所有facl權限:

setfacl -b file_name             ---- (-x  remove) (-b remove all)

[root@localhost test]# setfacl -b hei

[root@localhost test]# getfacl hei

# file: hei

# owner: root

# group: root

user::rwx

group::rw-

other::rw-

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM