Table of Contents
SUID
其他用户执行该文件时,将拥有所有者用户的权限
针对执行文件设置
针对U位置设置
例如
chmod u+s /usr/bin/cat
ll /usr/bin/cat
-rwsr-xr-x. 1 root root 51856 Jan 11 2019 /usr/bin/cat
su - tom
cat /etc/shadow
SGID
创建目录或文件会自动继承父目录所属组
针对目录设置
针对G位置设置
mkdir test
chmod g+s test
ll -d test
drwxr-sr-x. 2 root root 6 Sep 10 23:43 test
SBIT粘滞位权限(Sticky)
为公共目录(权限为777)设置,权限字符为“t”
用户不能删除该目录中其他用户的文件,但是可以删除自己的
针对目录设置
针对O位置设置
ll -d /tmp
drwxrwxrwt. 3 root root 186 Sep 10 23:46 /tmp
mkdir /test
chmod 1777 /test #chmod o+t /test
ll -d /test
drwxrwxrwt. 2 root root 6 Sep 10 23:52 /test
发表回复