Linux usermod command parameters and usage detailed

Source: Internet
Author: User

Command: Usermod

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.

Parameters

-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.

Application Examples:

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

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.