Special permissions under the Linux file system

Source: Internet
Author: User

    

SUID, SGID, Sticky

1 permissions
R, W, X

User, group, other

2 Security context
Premises: The process has a group of owners and genera;
(1) Any executable program file can be started as a process: depending on whether the initiator has EXECUTE permission on the program file;
(2) After initiating as a process, the owner of the process is the initiator, and the group of the process belongs to the initiator;
(3) When a process accesses a file, it depends on the initiator of the process:
(a) The initiator of the process, the owner of the same document: The application file is the master authority;
(b) The initiator of the process, belonging to the group of documents, the application file is a group of permissions;
(c) Application of the file "other" permission;

3 SUID
(1) Any executable program file can be started as a process: depending on whether the initiator has EXECUTE permission on the program file;
(2) After initiating the process, the owner of the process is the owner of the original program file;

Permission settings:
chmod u+s FILE ...
chmod u-s FILE ...

4 SGID
By default, when a user creates a file, the group is the base group to which the user belongs;
Once a directory has been set to Sgid, the user who has write permission to this directory is the group of the groups to which the files created in this directory belong;

Permission settings:
chmod g+s DIR ...
chmod g-s DIR ...

5 Sticky
For a multi-person writable directory, if the sticky is set, then each user can only delete their own files;

/tmp directory sticky permissions are set by default

Permission settings:
chmod o+t DIR ...
chmod o-t DIR ...

You can also use numbers to add special permissions:

Suid=4,sgid=2,sticky=1

For example: chome 4755 file to add suid permissions to files

Several permission bit mappings:
Suid:user, occupying the master's execution authority;
S: Owner has x permission
S: Owner does not have X permission
Sgid:group, occupy the group's execution permission bit;
S:group has x permissions
S:group no x permission
Sticky:other, occupying ohter's execution privilege bit;
T:other has x permissions
T:other no x permission

Special permissions under the Linux file system

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.