Usermod can be used to modify user account settings.
Syntax
Usermod [-LU] [-c <remarks>] [-d <logon Directory>] [-e <validity period>] [-f <buffer days>] [-g <group>]
[-G <GROUP>] [-l <account name>] [-s <shell>] [-u <uid>] [user account]
Parameter description:
- -C <remarks> modify the remarks of the user account.
- -D logon Directory> modify the directory when a user logs in.
- -E <validity period> modifies the validity period of an account.
- -F <buffer days> change 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 group to which the user belongs.
- -L <account name> modify the user account name.
- -L lock the user password to make it invalid.
- -S <shell> modify the shell used after the user logs on.
- -U <uid> modify the user ID.
- -U unlocks the password.
Instance
Change logon Directory
# Usermod-d/home/hnlinux root
Change User uid
# Usermod-u 777 root