1. User
A) The system uses the user ID referred to as UID to mark the uniqueness of users
b) The user is divided into three categories: system users, root users, ordinary users
i. Normal User
-
uid greater than 500, the system default normal user UID starting from 500
-
You can only manipulate your own home directory, temporary directory, and other authorized directory operations
ii. root User (root), super user
-
uid is 0
-
Full control over the system
III. System users
UID Range 1-499
Used to run the system, and not necessarily a user who is actually present
2. User groups
A) The system uses group ID abbreviation (GID) to differentiate user groups
b) Each user belongs to at least one user group and can belong to more than one group
3. View common commands for user IDs and user groups
ID command for viewing user information, without parameters for the current user
You can see the UID and GID of the current user and the group name
Groups command, you can view the group information that the user belongs to, see the current user's group information without parameters
2. who command, you can see all users currently logged in
Currently only the root user is logged in and the WHO command executes the following results:
Re-login with Admin user, then execute who command, see the following results
3. User Management
Added users: useradd
The use of the method is simple, after the command with the user name to add, such as to add User1, using the Useradd user1,useradd command to create a user ID starting from 1000
View New User Information
Use the ID command to view the newly added user information, ID user1
You can see that the UID of User1 is 1001, the same as the default created a User1 group with the same name, the group ID is also 1001
Then we went down to the home directory and found that a User1 home directory was created at the same time.
These are the simplest applications for useradd, so can we specify the UID and user groups, as well as the user's home directory? The answer is yes.
Let's do it. Use the-u parameter to specify the UID with the-G parameter to specify the user group, the-d parameter specifies the user's home directory, below we create a UID is 501, belongs to the User1 group, the home directory is/home/user22 user User3
Useradd-u 502-g user1-d/home/user22 User3
You can see that the user has been created according to our set parameters.
More articles about the public number "kick genius"
Linux system command Learning-user management