There are three types of users under Linux: 1. Super user: root has all permissions to the operating system uid0
2. Ordinary users: Ordinary users have limited permissions of the operating system uid500-6000
3. Pseudo user: This is to facilitate system management and meet the requirements of the corresponding system process file owner. It cannot log in to the system uid1--499
Manage user files and basic user information are placed here/etc/passwd. Any user has read permission to it. Only the account is defined and the password is not defined
One line represents a user divided into seven parts
Account name: Password: uid: gid: Related information: User home directory: Class library
The user’s password file /etc/shadow is only readable by root
Username: Password: Last changed: Maximum interval: Minimum interval: Warning time: Inactivity time: Expiration time
0can be changed at any time to 999999 for one week
Two easy ways to create an account
1Add a record in /etc/passwd
2#ueradd user#passwd password (lee user’s affiliated group is admin)
View user information:
Common options for the useradd command are as follows:
-dhome-dir: Specify the home directory.
-edate: The date the account was disabled, in the format: YYYY-MM-DD.
-fdays: The number of days after the password expires before the account is disabled.
-ggroup-name: The group name or GID of the main group to which the user belongs.
-Ggroup-list: A list of affiliated groups to which the user belongs. Multiple items are separated by colons.
-m: If the home directory does not exist, create it.
-M: Do not create the user directory.
-n: Do not create user private groups for users.
-r: Create a system account without a home directory with a UID greater than 500.
-p: Encrypted password.
-s: Specify the user to log in to the Shell, the default is /bin/bash.
-uUID: UID of the specified userlinux sets user group permissionssuse linux, it must be uniquelinux sets user group permissions, and is less than 499
Deletion of user:
User disablement:
User’s Unlock:
Change of user login name:
(If a user is locked, the password will be locked. Linux server configuration and management are all strictly prohibiting users from logging into the system. This method is not only mentioned in the above, so I will not give examples one by one)
Group configuration file/etc/group
Group name group password group id other users
Creation and deletion of groups (deletion of groups is different from that of users)
Creation and deletion of group password
What to do if you really don’t know? View help. Man or --help
The above is the detailed content of 999999Two simple ways to create an account in one week, did you know?. For more information, please follow other related articles on the PHP Chinese website!