Linux - Rights Management

 


Linux kernel: everything is a file

Create user-related files: wd save

Type less /etc/passwd at the command line

The first line    : (each line represents a user's information, divided into 7 segments with: as a separator)

The root user, x represents a password, which is a placeholder. Otherwise, the user information is leaked, which means that the user's permissions are leaked.

    Delete the x to indicate that there is no password, log in directly with the user name

 

0 means user id == uid is the first person to come to this operating system, which means that this is equal to 0, indicating that there is user authority

       0-500 are executive-level, and after 500, ordinary users can use it

0 means group id == gid, which group is marked in

root represents the description of the user

/root represents root's home directory 

/bin/bash The first executable file logged by the user, as long as it is bash under bin, it proves that the user can log in to the operating system

        User exits twice before exiting

 

 

Second line    :

bin user

sbin/nologin inoperable                        input successfully exits automatically

 

 So /bin/bash can be changed to sbin/nologin to achieve the function that users cannot log in

 

uid:

If you want to modify it, enter the directory file

  After deleting the uid, there is an empty space there

The password is actually placed under etc/shadow

Enter the command to view

Another point is that the root user is limited by uid

 guide

less /etc/group

 

The group corresponds to tom 500; shizhengwen 501; . .

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325064571&siteId=291194637