Linux Forgot roo Password solution

Source: Internet
Author: User

There are three ways to fix Linux forgetting the root password:

The first of these is detailed below:

    1. After restarting the system, the Grub interface appears on the boot loader menu, using the UP and DOWN ARROW keys to select the system you forgot your password for, type "E" to enter edit mode.

    2. 2

      Next you can see the screen as shown, then you use the up and down keys to select the latest kernel (here is the second line, kernel ...). ), and then continue to press the "E" key.

    3. 3

      Then add "Space" to the edit interface rhgb quiet, and then type "single", or enter the number "1" directly and return to OK.

    4. 4

      After Enter, press "B" key to launch into single user mode, here to change the root password.

    5. 5

      After this reboot, the root password has been modified!

The second approach:

1th step: When using Lilo to boot the system: type Linux single when the Lilo: prompt appears
Screen Display Lilo:linux single
2nd step: Enter directly into the Linux command line
3rd: Use the following command "Vi/etc/shadow" to delete the first line, that is, Root: After and Next: The first row will be similar to root:: ... Save
Vi/etc/shadow
4th step: Reboot reboot, the root password is empty.

The third approach:

1th step: In the system into a single user state, directly with passwd root to change.
2nd Step: Boot the system with the installation CD, the Linux rescue State, the original/partition hook up, as follows:
CD/MNT mkdir HD mount-t auto/dev/hdax (the partition number where the original/partition is located) HD CD HD chroot./passwd Root
The 3rd step: Take down the hard drive of this machine and hang it on the other Linux system, using the same method as the second one.

Linux Forgot roo Password solution

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.