This article mainly introduces linux user management and group management (for example, creating users and groups in linux). For more information, see
There are three types of users in linux: 1. super users: root has all the permissions for operating system uid 0
2. common users: general users have limited operating system permissions uid 500-6000
3. pseudo-User: to facilitate system management and meet the requirements of the corresponding system process file owner, you cannot log on to the system uid 1--499.
The management of user files and basic user information are put here./etc/passwd any user has the read permission on it. only the account does not define the password.
A row indicates that a user is divided into seven parts.
Account name: Password: uid: gid: Related information: user's home directory: Interpreter
The password file/etc/shadow is only readable by the root user.
User Name: Password: last Modification time: maximum interval: Minimum Interval: Warning Time: inactive time: Expiration Time
0 can be modified for 999999 weeks at any time
Two simple methods to create an account
1. add a record to/etc/passwd.
2 # ueradd user # passwd password (admin is the affiliated group of the lee user)
View user information:
Common options for the useradd command are as follows:
-D home-dir: specifies the user's home directory.
-E date: the date of the disabled account. format: YYYY-MM-DD.
-F days: the number of days before the account is disabled after the password expires.
-G group-name: group name or GID of the user's main group.
-G group-list: a list of affiliated groups to which a user belongs. multiple items are separated by commas.
-M: If the main directory does not exist, create it.
-M: Do not create the user's home directory.
-N: Do not create a private group for the user.
-R: create a system account with a UID less than 500 without the main directory.
-P: the encrypted password.
-S: specifies the user to log on to the Shell. the default value is/bin/bash.
-U UID: indicates the user's UID, which must be unique and greater than 499
User deletion:
User disabling:
User unlock:
Modify the user login name:
(If a user is locked, the user is locked and the password is disabled. this method is not used unless described above)
Configuration file/etc/group
Group name group password group id other users
Create and delete a group (the deletion of a group is different from that of a user)
Create and delete group passwords
What if I really don't know? View help. Man or -- help