5.5 文件访问控制列表

5.5.1 setfacl 命令

setfacl命令用于管理文件的ACL规格,格式为“setfacl【参数】文件名称”

例子1:设置ACL权限

# setfacl -Rm u:linuxprobe:rwx /root
# su - linuxprobe
$ cd /root/
$ ls -l

查看文件,其中(+)代表设置有ACL权限

# ls -ld /root/
dr-xrwx---+ 14 root root 4096 Jan 15 22:20 /root/

取消ACL权限

# setfacl -b /root/

5.5.2 getfacl 命令

getfacl命令用于显示文件上设置的ACL信息,格式为“getfacl 文件名称”

# getfacl /root/
getfacl: Removing leading '/' from absolute path names
# file: root/
# owner: root
# group: root
user::r-x
user:linuxprobe:rwx
group::r-x
mask::rwx
other::---

最后更新于