English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Linux usermod command

Linux Command大全

Linux usermod command is used to modify user accounts.

usermod can be used to modify various settings of user accounts.

Syntax

usermod [-LU][-c <remark>][-d <login directory>][-e <validity period>][-f <buffer days>][-g <group>][-G <group>][-l <account name>][-s <shell>][-u <uid>][User account]

Parameter Description:

  • -c<remark>  Modify the remark text of the user account.
  • -d<login directory>  Modify the directory when the user logs in.
  • -e<validity period>  Modify the validity period of the account.
  • -f<buffer days>  Modify the number of days after the password expires to close the account.
  • -g<group>  Modify the group of the user.
  • -G<group>  Modify the additional group of the user.
  • -l<account name>  Modify the user account name.
  • -L  Lock user password, making the password invalid.
  • -s<shell>  Modify the shell used after user login.
  • -u<uid>  Modify user ID.
  • -U  Remove password lock.

Online Examples

Change the login directory

# usermod -d /home/hnlinux root

Change the user's uid

# usermod -u 777 root

Linux Command大全