3 Special permissions for Linux

Source: Internet
Author: User
Tags parent directory

3 Special permissions for Linux

Special privileges are divided into 3 types, namely:
SUID: Acting on the user; can only be used for executable binaries Sgid: Acting on the owning group, only for executable binary sticky: sticky bits. Act on someone else, only you can delete your own files (except root)

The user accesses the file through the program (the general program is executable for everyone, and of course, with exceptions), depending on whether the user has Execute permission on the program file
When the user (initiator) to run a process, he is the owner of the process, the group of the process is also the initiator of the group (in this case, the owner is represented as the owner of the program, the existence of the process, and the program on the hard disk owner is not related, This explains that different people run the same program execution permissions but not the same.
SUID:
The following example is not the same as the one described above.

650) this.width=650; "Src=" Http://upload-images.jianshu.io/upload_images/6144185-f964e79c9d8537b7.png?imageMogr2 /auto-orient/strip%7cimageview2/2/w/1240 "style=" Border:0px;vertical-align:middle;height:auto; "alt=" 1240 "/>


The above example relates to special permissions (SUID), Wang This user does not have permission to change the password, but Wang is through passwd this process to access, and passwd This command is given special permission, and this special permission in the owner's position, is also the SUID permission, so he is equivalent to passwd the owner of the program to send information to borrow its original owner's permission, so Wang can have permission.
Observe the following example:

650) this.width=650; "Src=" Http://upload-images.jianshu.io/upload_images/6144185-590c62c3de5e6d8c.png?imageMogr2 /auto-orient/strip%7cimageview2/2/w/1240 "style=" Border:0px;vertical-align:middle;height:auto; "alt=" 1240 "/>


The above example shows that after adding special permissions to a program, the original user does not have permission but can borrow the permissions of the owner of a command and have permission to some files
SGID:
Let's take a look at the following example:

650) this.width=650; "Src=" Http://upload-images.jianshu.io/upload_images/6144185-749deb479cfc3b25.png?imageMogr2 /auto-orient/strip%7cimageview2/2/w/1240 "style=" Border:0px;vertical-align:middle;height:auto; "alt=" 1240 "/>


In this example, Wang can access the shadow because the cat's owning group has special permissions assigned to the Wang user, so Wang is able to use cat to shadow R permissions
Sticky: You can see the following example to understand Sticky this special permission:

650) this.width=650; "Src=" Http://upload-images.jianshu.io/upload_images/6144185-3a7ca472f7967ba1.png?imageMogr2 /auto-orient/strip%7cimageview2/2/w/1240 "style=" Border:0px;vertical-align:middle;height:auto; "alt=" 1240 "/>

Alt text

650) this.width=650; "Src=" Http://upload-images.jianshu.io/upload_images/6144185-f929b0d2c9cccfc2.png?imageMogr2 /auto-orient/strip%7cimageview2/2/w/1240 "style=" Border:0px;vertical-align:middle;height:auto; "alt=" 1240 "/>

650) this.width=650; "Src=" Http://upload-images.jianshu.io/upload_images/6144185-3b806667b8c416a3.png?imageMogr2 /auto-orient/strip%7cimageview2/2/w/1240 "style=" Border:0px;vertical-align:middle;height:auto; "alt=" 1240 "/>

650) this.width=650; "Src=" Http://upload-images.jianshu.io/upload_images/6144185-e097891da618c3ec.png?imageMogr2 /auto-orient/strip%7cimageview2/2/w/1240 "style=" Border:0px;vertical-align:middle;height:auto; "alt=" 1240 "/>

650) this.width=650; "Src=" Http://upload-images.jianshu.io/upload_images/6144185-8c1ae9780484a9de.png?imageMogr2 /auto-orient/strip%7cimageview2/2/w/1240 "style=" Border:0px;vertical-align:middle;height:auto; "alt=" 1240 "/>

650) this.width=650; "Src=" Http://upload-images.jianshu.io/upload_images/6144185-a387de129bdbd591.png?imageMogr2 /auto-orient/strip%7cimageview2/2/w/1240 "style=" Border:0px;vertical-align:middle;height:auto; "alt=" 1240 "/>

650) this.width=650; "Src=" Http://upload-images.jianshu.io/upload_images/6144185-d868fbf7a962c5e2.png?imageMogr2 /auto-orient/strip%7cimageview2/2/w/1240 "style=" Border:0px;vertical-align:middle;height:auto; "alt=" 1240 "/>


Note: The Sgid function in the directory: the owning group of the newly-opened file automatically inherits the owning group of the parent directory
The weights corresponding to these three special privileges: suid:4; sgid:2; sticky:1;

650) this.width=650; "Src=" Http://upload-images.jianshu.io/upload_images/6144185-c289d13442613c07.png?imageMogr2 /auto-orient/strip%7cimageview2/2/w/1240 "style=" Border:0px;vertical-align:middle;height:auto; "alt=" 1240 "/>


This article is from the "12922045" blog, please be sure to keep this source http://12932045.blog.51cto.com/12922045/1930729

3 Special permissions for Linux

Related Article

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.