Special permissions suid sgid sticky

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.