12 Linux ACL权限

时间:2023-03-09 16:26:46
12 Linux ACL权限

1、查看facl权限

getfacl /home/test.txt

[root@localhost ~]# getfacl /home/test.txt
getfacl: Removing leading '/' from absolute path names
# file: home/test.txt
# owner: root
# group: root
user::rw-
group::r--
other::r--

  

2、设置facl权限

setfacl -m u:latiny:rw /home/test.txt

setfacl -m u:hulk:rwx /home/test.txt

[root@localhost ~]# setfacl -m user:hulk:rwx /home/test.txt
[root@localhost ~]# getfacl /home/test.txt
getfacl: Removing leading '/' from absolute path names
# file: home/test.txt
# owner: root
# group: root
user::rw-
user:latiny:rw-
user:hulk:rwx
group::r--
mask::rwx
other::r--

3、撤销facl权限

setfacl -x u:hulk /home/test.txt

4、复制facl权限

getfacl file2 | setfacl --set-file=- file2