Modify user name and user group name

Source: Internet
Author: User

A user is created in the RedHat installation system. It takes too long to change it to a short point. The modification method is as follows (all under root );

1. Modify the user's
Login Name and logon directory, edit the/etc/passwd file, find your current user's entry, and modify it:

Newname: X: 500: 500:/home/newname:/bin/bash

2. Modify the username entry in/etc/shadow:

Newname: $1 $ cnry3oel $ zcuzip1q1x75prfwq. dkm1: 14983: 0: 99999: 7 :::

3. Modify the logon directory:

MV/home/oldname/home/newname

4. Modify the group name, edit the/etc/group file, find the entries in the group, and modify them:

Newgroupname: X: 500: newname

5. If sudo is started, modify the/etc/sudoers file. Change oldername to newname

User name, group name, and sudo can take effect only after the configuration file is modified, but the login directory must be restarted before using Cd ~ Command to enter the new logon directory.

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.