chmod命令可以把文件权限分为u,g,o三个组,而setfacl可以对每一个文件或目录设置更精确的文件权限。
添加handsome用户 读取test.txt权限
setfacl -m u:handsome:r test.txt
取消权限
setfacl -x u:handsome test.txt
查询权限
getfacl test.txt
本文介绍了Linux中setfacl命令的使用,如何为单个用户精确设定文件或目录权限,如添加特定用户的读取权限,以及如何撤销这些权限。通过setfacl,可以实现比chmod更细粒度的权限控制。
chmod命令可以把文件权限分为u,g,o三个组,而setfacl可以对每一个文件或目录设置更精确的文件权限。
添加handsome用户 读取test.txt权限
setfacl -m u:handsome:r test.txt
取消权限
setfacl -x u:handsome test.txt
查询权限
getfacl test.txt
557

被折叠的 条评论
为什么被折叠?