Linux 特殊权限

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




		

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

yolo2016

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值