Root User UID and GID Documentation

Asked 2 years ago, Updated 2 years ago, 49 views

I think the root user's UID and GID are assigned a zero, but what is the documentation for this issue?

Question 1)
Where is the official information (primary information) about the above?

Question 2)
Is it possible to check the above information with man or info?

linux

2022-09-29 21:52

2 Answers

Linux distributions (hereinafter simply referred to as "Linux" means Linux distributions) must use the Linux kernel and should not have a root user UID and GID of 0 (there must be a root user with a UID and GID of 0).However, because implementing each Linux at will only confuse the world, most Linux compliance is based on industry standards such as Linux Standard Base (LSB) for mutual compatibility.

LSB was built to scale based on POSIX and Single UNIX Specification (SUS).POSIX and SUS are UNIX standards.Because Linux was designed to be compatible with UNIX, LSB was also based on POSIX and SUS.However, it is not that Linux is POSIX compliant, so I think you should look at LSB as the official primary information for Linux.

LSB is internationally standardized as ISO/IEC 23360The current latest version is LSB 5.0 (ISO/IEC 23360:2021) released on June 2, 2015.LSB is divided into several chapters and sections.rootUser references are がPart 1-2: Core specification generic partart.Specifications are available at the following site:

ISO/IEC 23360-1-2:2021 Linux Standard Base (LSB)—Part 1-2: Core specification generic part

The price is 198 Swiss francs.However, you can download and view it for free for standardization.Try following the link from "download" in the first note.

rootThe user is described in 23.2 User & Group Names on page 940.

Table 23-1 descriptions required mnemonic user and group names.This specification makes no attempt to numerically assign user or group identity numbers, with the exception that the user ID and group ID for the user root shall be equal to 0.

Table 23-1 lists the required mnemonic user and group names.Although this specification does not assign user and group identification numbers, the exception is that the user ID and group of the root user must both be zero.

In the comments section of Table 23-1, it says Administrative user with all appropriate privileges.However, it does not specify how many UIDs or GIDs should be for users other than root.

LSB specifications standardized as ISO/IEC are originally purchased for a fee and cannot be reproduced and distributed without permission, although they are free to download for standardization.Separately, it is also available from the LSB Specifications-Linux Foundation and is GFDL.Some Linux contain LSBs internally and may have Linux that can be viewed as man or info.(I couldn't find it, so I'll leave it to someone else.)


2022-09-29 21:52

I think the expression "User ID 0 is assigned the username root" is actually close.

User ID0 privilege

The user whose ID is 0 is a privileged user (superuser).This privilege is set to

man7 capabilities

explained in .

The privileged user ID 0 is written in the Linux kernel and cannot be changed.Also, most Unixes have 0.

Note: Does the root account always have UID/GID0?

The username

root

As a strong custom and tradition, the user ID 0 is set to the username root.From there, privileged users are also referred to as "root users.However, this name is not technically required from the Linux kernel at least.

This assignment is made in /etc/passwd which is pre-prepared for most distributions.

man5passwd

Standards

POSIX does not mention this.

POSIX.1 has no superuser concept.Instead, some operations require "appropriate permissions," but POSIX.1 leaves the definition of "appropriate permissions" to the implementation.
—— From the book Detailed UNIX Programming 3rd Edition 2.2.2 IEEE POSIX

As for the Linux Standard Base, raccy's response, but the degree of respect for this standard varies with distribution.


2022-09-29 21:52

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.