三个特殊权限
方法1:
t 粘滞位 (只对目录有效)
在目录中建立的文件只有文件的所属者可以删除。
方法一 chmod 777 /tmp/test chmod o+t /tmp/test t表示粘滞位 方法二 chmod 1777 /tmp/test
在目录中建立的文件或者目录属组会继承父目录的属组
方法1
chmod 777 /tmp/rootdir/
chmod g+s /tmp/rootdir
方法2
chmod 2777 /tmp/rootdir
当一个可执行文件具有suid权限,无论谁运行该文件,谁就具有该文件所属者的权限。
which vim
chmod u+s /usr/bin/vim
chmod 4755 /usr/bin/vim
which find
chmod u+s /bin/find
普通用户
find /opt -name rh -exec "/bin/dash" \;
检查系统中谁获得root权限
find / -perm 4755 针对权限进行查询系 统中所有具有suid权限的命令
find / -perm +4000 忽视后面权限只要带suid的都查