How to use the Linux usermod command

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.