User and group management commands and user group management commands
Command parameter description
--------------------------------------------------------------------------------
Useradd is used to create a new user.
-D specifies the user's home directory (default:/home/username)
-D Display Default Value
-Enew account expiration date, in the format of "YYYY-MM-DD"
-G: Specifies an initial user group (it must already exist)
-G: specify one or more extended user groups.
-N: do not create a user group with the same name
-S specifies the default logon shell
-U indicates the UID of the user.
Passwd is used to change the user's password.
-L the user is locked and cannot log on.
-U unlock, allowing users to log on
-- Stdin allows users to change their passwords from standard input
-D: no password for the Account
-E force the user to change the password upon next login
-S: displays the user's password status
Userdel is used to delete a user.
-F force delete a user. The Home Directory and Related Files
-R: deletes users, home directories, and email pools.
Usermod is used to modify user attributes.
-C fill in account remarks
-D-m and-d can be used to re-specify the user's home directory and automatically transfer new data
-E account expiration time, in the format of "YYYY-MM-DD"
-G Change User Group
-G change Extended user group
-L locking a user and forbidding it from logging on to the system
-U unlock a user and allow it to log on to the system
-S: Change the user's logon shell
-U: Modify the UID of a user.
Groupadd is used to create a group.