Accidentally forgot the root password of Linux

Source: Internet
Author: User

Many times, because the root user, we are not commonly used, so forget the password is often the case, then how can we solve it? I now know that there are two types of boot-time access to single-user mode can be directly modified root password:

Method One:

The first step:

When powered on, it enters a 3-second wait state as shown in

This time you need to quickly put the mouse into the screen (I use the virtual machine, so need to manually click into it), followed by the following state:

Step Two:

This time, press the E key to enter the grub edit state, the following interface will appear:

Step Three:

Select the second item (beginning with the kernel kernel), and press the E key to enter the editor and enter:

Fourth Step:

At the end of the manual add a single, and press ENTER enter key, will return to the third step interface, but at the end there will be one, this time by pressing the B key, will go into one-user mode, and can be successfully opened, get root login privileges

Fifth Step:

After power-on, the acquired permissions are root

Change Password with command passwd

Follow the prompts, enter the new password two times, enter the reboot restart command to

The second method:

In the first method of the first step, press the A key, and then press the space bar, in the press 1 key, you can turn on the boot, after the operation of the same, no difference

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.