Linux 特殊权限
#############################
Set GID
附加在所属组的x位置
作用:设置组的特殊权限,让子文档继承父目录的所属组权限。
chmod g+s 文档...
drwxr-S---
S表示 所属组没有执行权限,小写s 则表示有x权限
#############################
Set UID
附加在所属主的x位置
属主的特殊标识变为s
适用于可执行文件,set uid可以让使用者具有文件属主的身份及其部分特殊权限
chmod u+s 文档... //背景色变为红色
-rwsr-x---
类似一把尚方宝剑
#############################
Sticky Bit
附加在其他人的x位置
-其他人的特殊标识变为t
-适用于开放w权限的目录,可以阻止用户滥用w写入权限(禁止操作别人的文档)
chmod 777 目录...
chmod o+t 目录...
只有属主才能删除,不是你的就不能删除
#############################
ACL权限
能够对个别用户,个别组设置独立的权限
支持 EXT3/4 ,XFS文件系统
setfacl -m u:user1:rx /目录
g:group1
最后为.变成 + 指 more
getfacl /目录
如果设置acl比较多,会把权限的掩码覆盖到所属组的位置上,具体查看用getfacl组的权限
setfacl -x, --remove=acl remove entries from the ACL(s) of file(s)
setfacl -b, --remove-all remove all extended ACL entries
~]# setfacl -h
setfacl 2.2.51 -- set file access control lists
Usage: setfacl [-bkndRLP] { -m|-M|-x|-X ... } file ...
-m, --modify=acl modify the current ACL(s) of file(s)
-M, --modify-file=file read ACL entries to modify from file
-x, --remove=acl remove entries from the ACL(s) of file(s)
-X, --remove-file=file read ACL entries to remove from file
-b, --remove-all remove all extended ACL entries
-k, --remove-default remove the default ACL
--set=acl set the ACL of file(s), replacing the current ACL
--set-file=file read ACL entries to set from file
--mask do recalculate the effective rights mask
-n, --no-mask don't recalculate the effective rights mask
-d, --default operations apply to the default ACL
-R, --recursive recurse into subdirectories
-L, --logical logical walk, follow symbolic links
-P, --physical physical walk, do not follow symbolic links
--restore=file restore ACLs (inverse of `getfacl -R')
--test test mode (ACLs are not modified)
-v, --version print version and exit
-h, --help this help text
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交