Command Parameter Description
------------------------------------------------- ---------------------------------------
useradd is used to create new users
-d specifies the user's home directory (default is /home/username)
-D displays the default value
-e specifies the expiration date of the new account, in the format "YYYY-MM-DD"
-g specifies An initial user group (must already exist)
-G specifies one or more extended user groups
-N does not create a user group with the same name
-s specifies the default login shell
-u specifies the user UID
passwd is used to modify the user's password
-l locks the user and prohibits his/her login
-u unlocks the lock and allows the user to log in
--stdin allows the user's password to be modified from the standard input
-d makes the account passwordless
-e forces the user to change the password the next time they log in
-S displays the user's password status
userdel is used to delete the user
-f forces the user to be deleted , home directory and its related files
-r Delete the user, home directory, mail pool
usermod is used to modify the user's attributes
-c Fill in the remark information of the account
-d -m - m is used with -d to re-specify the user's home directory and automatically transfer new data there
-e Account expiration time, format "YYYY-MM-DD"
-g Change the user group to which it belongs
-G Change the extended user group
-L Lock the user and prohibit them from logging into the system
-U Unlock the user and allow them to log in to the system
-s Change the user's login shell
-u Modify the user's UID
groupadd is used to create groups
The above is the detailed content of Detailed explanation of user and group management commands. For more information, please follow other related articles on the PHP Chinese website!