linux完善的用户及权限管理,sid/gid很少使用的。如passwd(sid权限位)非root也可以使用

权限位

标识及数值

实践

#setuid(4 ux-us)

//chmod u+s  xxx  (-rwx-> -rws)

[root@c6-172-24-20-52 bin]# ll
-rwxr-xr-x 1 root root 168656 Jan 25 21:47 a2ps   //-rwxr-xr-x
[root@c6-172-24-20-52 bin]# chmod u+s a2ps   //-rwsr-xr-x
[root@c6-172-24-20-52 bin]# ll
-rwsr-xr-x 1 root root 168656 Jan 25 21:47 a2ps

//chmod u-s xxx ( -rws -> -rwx)

#setgid(2 gx->gs)

//chmod g+s xxx  (-rwxr-x -> -rwxr-s)

[root@c6-172-24-20-52 bin]# ll
-rwxr-xr-x 1 root root 168656 Jan 25 21:47 a2ps  //-rwxr-xr-x
[root@c6-172-24-20-52 bin]# chmod g+s a2ps 
[root@c6-172-24-20-52 bin]# ll
-rwxr-sr-x 1 root root 168656 Jan 25 21:47 a2ps  //-rwxr-sr-x

//chmod g-s  xxx (-rwxr-s -> -rwxr-x)

#stick(1 ox->ot)

//chmod o+t xxx (drwxr-xr-x ->drwxr-xr-t)

[root@c6-172-24-20-52 bin]# ll
drwxr-xr-x 2 root root   4096 Jan 27 19:16 tmp
[root@c6-172-24-20-52 bin]# chmod o+t tmp/
[root@c6-172-24-20-52 bin]# ll
drwxr-xr-t 2 root root   4096 Jan 27 19:16 tmp

//chmod o-t xxx (drwxr-xr-t -> drwxr-xr-x)