New and deleted users in Linux can use the command: Useradd
Let's first use the man command to understand the use of useradd.
New and delete user actions need to get advanced user Rights First
Input command: Sudo-i
Enter advanced user password after OK
Create a new user Cindy using Useradd
Input command: Useradd Cindy
Create a home folder for users
Input command: Test–d/home/cindy
Take a look at the information about the user Cindy you just created
Input command: grep cindy/etc/passwd/etc/shadow/etc/group
Create a row of account-related data in/etc/passwd, including creating a Uid/gid/home folder, etc.
In/etc/shadow, fill in the password related parameters of this account.
Add a group name that is the same as the account name in/etc/group
Set the password for the created account, there is no way to set the password to login, we still first use the man command to understand the usage of passwd
Input command: passwd Cindy
After confirmation, you will be prompted to enter a new password, once again confirm the password
If the password is the same, the prompt changes successfully
If the password is inconsistent two times, the prompt change is unsuccessful
Now let's use the newly created user Cindy Login to see it.
Input command: su Cindy
OK to enter Cindy User action
- 9
Remove add extra user, include user's home folder to delete together
Input command: Userdel–r Cindy
New and deleted users in Linux can use the command: Useradd