Function Description: Modify user account.
Syntax: Usermod [-lu][-c < remarks >][-d < login directory >][-e < expiration >][-f < buffer days >][-g < group >][-g < group >][-l & lt; account name >][-s ][-u] [user account]
Supplemental Note: Usermod can be used to modify the user account settings.
-c< Notes > Modify the user account's memo text.
-D Login Directory > modify the user login directory.
-e< expiry date > change the expiration period of account number.
-f< Buffer days > Modify the number of days after the password expires to close the account.
-g< Group > Modify the group to which the user belongs.
-g< Group > Modify the additional groups to which users belong.
-l< Account name > Modify user account name.
-L LOCK the user's password to invalidate the password.
-S modifies the shell used by the user upon login.
-U modifies the user ID.
-U unlocks password.
Usermod does not allow you to change the user account name on the line. When Usermod is used to change the user ID, it must be confirmed that the user did not perform any programs on the computer. You need to manually change the user's crontab file. You also need to manually change the user's at work file. The use of NIS server requires that the related NIS settings be changed on the server.
1. Add Newuser2 to Group staff
# USERMOD-G Staff Newuser2
2, modify the NewUser user name is Newuser1
# usermod-l Newuser1 NewUser
3, Lock account Newuser1
# usermod-l Newuser1
4, Unlock the Newuser1
# usermod-u Newuser1