Lessons learned from Linux to modify the user name of the root account

Source: Internet
Author: User

Before the password of the Linux server was changed, and then called the owner of the server to reset the root account (server owner in the customer's company), after resetting, the leader called the change under root

User name and password, so I apart began to find ways to find an article is probably such a procedure:

vi/etc/passwd
Press the I key to enter edit state
Modify the 1th row 1th root to a new user name
Press ESC to exit the edit state and enter: X Save and exit
Vi/etc/shadow
Press the I key to enter edit state
Modify the 1th row 1th root to a new user name

Press the ESC key to exit the edit state and enter: x! Force save and exit

I do not know what the wind, after modifying the passwd file, close the command window, try to log in with the modified user name, password error, and then back to root login, or password error, at this time

I realized the seriousness of the problem, because these two files are user profiles, where passwd is the account, shadow saved the account password and other information, I only changed a file,

Both sides of the user do not correspond, resulting in the inability to login, and then find the appropriate solution on the Internet, most of the solution to the use of single-user mode to reset the password, but the server in the customer's company, but also

is to contact them to solve, no way, things have reached this point, can only solve, so later trouble customer company maintenance personnel to deal with, very sorry.

Online query, found that they are not a person, but this problem, I am very ashamed of myself, the server has been root reset, the operation of Linux on the line after the operation of the system is still in

The local virtual machine runs first, hoping that no similar errors will be repeated in the future!!!

Lessons learned from Linux to modify the user name of the root account

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.