Linux usermod Command
Linux usermod command modifies the user account.
usermod is used to modify the settings of the user account.
grammar
usermod [-LU][-c <备注>][-d <登入目录>][-e <有效期限>][-f <缓冲天数>][-g <群组>][-G <群组>][-l <帐号名称>][-s <shell>][-u <uid>][用户帐号]
Parameter Description:
- -c <Note> Edit Note text user account.
- -d directory login> modify the directory user logs in.
- -e <expiration date> Edit account expiration date.
- -f <buffer days> to modify the number of days after password expires that is to close the account.
- -g <Group> Edit group the user belongs.
- -G <Group> Edit additional groups the user belongs.
- -l <account name> to modify the user account name.
- -L Lock user password so that it is invalid.
- -s <shell> to modify the user login used by the shell.
- -u <uid> Modify User ID.
- -U Unlock the password lock.
Examples
Change login directory
# usermod -d /home/hnlinux root
Change a user's uid
# usermod -u 777 root