【SUID】
Set-user Identification
SUID 属性只能运用在可执行文件上,当用户执行该执行文件时,会临时拥有该可执行文件所有者的权限。
示例
# 查找具有 SUID 的文件 root@qhost:/home/walker# sudo find / -perm /4000 walker@qhost:~$ ll /bin/su -rwsr-xr-x 1 root root 40128 May 17 2017 /bin/su* walker@qhost:~$ ll /usr/bin/sudo -rwsr-xr-x 1 root root 136808 Jul 4 2017 /usr/bin/sudo* walker@qhost:~$ ll /usr/bin/passwd -rwsr-xr-x 1 root root 54256 May 17 2017 /usr/bin/passwd* walker@qhost:~$ stat --format=%a /usr/bin/passwd 4755
【SGID】
Set-group identification
SGID 属性可以应用在目录或可执行文件上。当SGID属性应用在目录上时,该目录中所有建立的文件或子目录的拥有组都会是该目录的拥有组。
示例
# 查找具有 SGID 的目录或文件 root@qhost:/home/walker# sudo find / -perm /2000 # 目录 root@qhost:/home/walker# ll -d /var/cache/man drwxr-sr-x 28 man root 4096 Oct 11 06:25 /var/cache/man/ # 可执行文件 walker@qhost:~$ ll -H /usr/bin/write -rwxr-sr-x 1 root tty 14752 Mar 1 2016 /usr/bin/write*
【Sticky】
sticky Bit,saved-text bit,粘着位/粘滞位,也被称作防删除位。
Sticky 属性只能应用在目录,当目录拥有 Sticky 属性所有在该目录中的文件或子目录无论是什么权限只有文件或子目录所有者和root用户能删除。
示例
# 查找具有 sticky 的目录 root@qhost:/home/walker# sudo find / -perm /1000 walker@qhost:~$ ll -d /tmp drwxrwxrwt 14 root root 4096 Oct 11 09:53 /tmp/
【相关阅读】
*** walker ***
转载于:https://blog.51cto.com/walkerqt/2298546