4 suid: When a file's host has s permission, it means that any user who executes the program is no longer part of its execution, but belongs to the owner of the program file. For the executable file. Example:/USR/BIN/PASSWD
2 Sgid:
1 Sticky: Files in this directory, only the file owner and root user can be deleted.
[[email protected] tmp]# ID user1uid=501 (user1) gid=501 (user1) groups=501 (user1), 504 (gtest) [[email protected] tmp]# ID user2uid=502 (User2) gid=502 (user2) groups=502 (User2), 504 (gtest)
[Email protected] tmp]# ls-ltotal 4drwxr-xr-x. 2 root gtest 4096 08:21 dirtest
[Email protected] tmp]# chmod g+w dirtest/[[email protected] tmp]# ls-ltotal 4drwxrwxr-x. 2 root gtest 4096 11:44 dirtest
[Email protected] dirtest]$ ls-ltotal 0-rw-rw-r--. 1 user2 user2 0 12:09 a.user2-rw-rw-r--. 1 User1 user1 0 12:10 B.user1
User1 users and User2 users cannot modify files created by each other, without write permission.
After dirtest the directory with sgid permissions, User1 and User2 files created in this folder belong to the group of folder Dirtest and can modify each other's files.
[Email protected] tmp]# ls-l dirtest/total 0-rw-rw-r--. 1 user2 user2 0 12:09 a.user2-rw-rw-r--. 1 User1 user1 0 12:10 b.user1-rw-rw-r--. 1 user2 gtest 0 12:20 b.user2-rw-rw-r--. 1 user1 gtest 0 12:20 C.user1
Special permissions suid sgid sticky