用户权限ACL
命令:-d删除
setfacl -m g:hr:rwx /home/file1
设置 -设置选项 用户名组名其他人ugo:用户名/组名:权限 文件名
setfacl -m o::rw /home/file1 //设置所有其他人读写
setfacl -m u::rwx //设置所有用户读写执行
getfacl /tmp/file123 //查看文件权限
例子:
setfacl -m u:user01:rw /home/test.txt //设置用户user01文件读写
setfacl -m u:user02:r /home/test.txt //设置用户user02只读
例子:
删除:acl
setfacl -x u:user01 /tmp/file123 //删除用户user01的acl权限
setfacl -x g:hr /tmp/file123 //删除组hr 和acl的权限
setfacl -b /temp/file123 //删除所有的acl权限
例子:
UGO和ACL区别:
ACL:文件权限管理,设置不同用户,不同基本权限(r/w/x)对象数量不同
UGO: 设置基本权限,只能设置一个用户/一个组/一个其他人