特殊权限
suid 执行命令时以指定用户执行
guid 执行命令时以指定组执行
sticky
实例:
[root@yxlll ~]# chmod 640 /etc/passwd [root@yxlll ~]# ll /etc/passwd -rw-r----- 1 root root 1424 11月 5 14:47 /etc/passwd //此时,用 yxlaa1用户访问 [yxlaa1@yxlll ~]$ cat /etc/passwd cat: /etc/passwd: 权限不够 //再回到管理员用户 [root@yxlll ~]# which cat /usr/bin/cat [root@yxlll ~]# chmod 4755 /usr/bin/cat [root@yxlll ~]# ll /usr/bin/cat -rwsr-xr-x. 1 root root 54080 8月 20 2019 /usr/bin/cat [root@yxlll ~]# //再次切回 yxlaa1用户,可以用访问
关闭了文件对其他用户的权限,改变了 cat命令的权限,当其他用户用 cat命令时利用管理员身份访问文件
其中,suid的方法,chmod 4755 /passwd,4000表示 s,也可以写成 chmod u+s /passwd
改写 sgid的方法,chmod 2777 /opt/ ,2000表示组 s
3、sticky
表示,所有用户都可以在目录中创建文件,但是只能对自己的文件进行更改,不能修改别的用户创建的文件