Clarify the various user ID relationships in Linux

Source: Internet
Author: User

Green represents the process (the nature of the process) orange represents the file (the nature of the file). When the process tries to open the file, the kernel tests the following permissions:

0.  id is 0 (Superuser), which allows access.

1.  id equals the owner of the file id open 1

2.  If the effective group of the process id id id in the diagram. 2.

3.  test file other access rights.

Note: If section 1 step in process active user id id 2 step of the group test. The same is the case with 2,3

Let's take a look at the process of a user executing a process:


(1)   Span style= "Word-wrap:break-word; Font-size:10.5pt "> Each user is logged on with a uid gid id

(2)   Span style= "Word-wrap:break-word; FONT-SIZE:10.5PT "> Each program file (Yellow section) has the same file owner as a normal file id id rwx permissions.

(3) When the user opens the file, Figure 1 describes the X-permission test of the process (but not the process but the user at this time).

(4)WhenA.The user is a super user orB.UserIDand file OwnersIDsame and the file owner hasxpermissions orc.User'sGIDand the group to which the file belongsIDSame and the group that the file belongs to hasxpermissions ord.of the file Otherhavexpermissions, the user can execute the program, producing a process (the green part).

(5)The UID of the user becomes the actual user IDof the process, and the user's gid becomes the actual group ID of the process , The additional group ID of the user becomes the additional group ID of the process .

(6)when the program file is not set"set user ID bit (SUID) "and the"Set the group ID(SGID) bit "when the valid user ID of the process equals the actual user IDof the process, the valid group ID of the process equals the actual group ID of the process .

(7)when the program file is set"set user ID bit (SUID) ", the valid user ID of the process is saved to the process "saved settings user ID", after which the valid user ID of the process becomes the owner of the program file ID .

(8)when the program file is set"Set the group ID(SGID) bit ", the valid user group ID of the process is saved to the process "save set user group ID", after which the valid user group ID of the process becomes the program file for all groups ID.

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.