Linux Modify root password single user mode and rescue mode

Source: Internet
Author: User

Single-User mode

  1. Rebooting Linux into the Grub interface

    1. In the system boot interface, such as

      650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M00/9A/41/wKioL1lTZPqAxTomAAATgVx_mb4781.png-wh_500x0-wm_ 3-wmp_4-s_836136213.png "title=" 1.png "alt=" Wkiol1ltzpqaxtomaaatgvx_mb4781.png-wh_50 "/>

    2. Select the first item, and press the E key, enter the edit interface, find the line beginning with linux16, move the cursor to the RO, change the RO to RW init=/sysroot/bin/sh press ctrl+x key to start

      650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M00/9A/41/wKioL1lTZV-A7yLoAAArvWB23g8229.png-wh_500x0-wm_ 3-wmp_4-s_2866864208.png "title=" 2.png "alt=" Wkiol1ltzv-a7yloaaarvwb23g8229.png-wh_50 "/>

    3. After starting to enter the interface as shown below, first enter the original system chroot/sysroot/enter the original system can change the password passwd root if there is an abnormal character, may be a font problem caused lang=en to change the font to English reset password after input touch/.autorela Bel Enter and restart the system.

      650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M02/9A/41/wKioL1lTZkawctOvAAAjADMfoEU545.png-wh_500x0-wm_ 3-wmp_4-s_1360779650.png "title=" 3.png "alt=" Wkiol1ltzkawctovaaajadmfoeu545.png-wh_50 "/>

Rescue mode

If grub is masked and cannot enter, you need to change the password through rescue mode.

1. Enter the system BIOS, set the optical drive to the first boot order, and load the system installation disk into the optical drive to start the system.

2. Select "Troubleshooting" in the Select Installation system interface

3. Select "Rescue a CentOS Linux system" in the next screen

4. In the popup "1. Continue 2. read-only Mount Partition 3. Skip Shell 4. Select 1 when exiting restart.

5. After selecting 1, the following interface appears, similar to the single-user mode, just into the/mnt/sysimage

We switched back to the original system chroot/mnt/sysimage/

Then change the password passwd root

650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M01/9A/41/wKiom1lTaP-iQ5CrAAAkZkf35kY970.png-wh_500x0-wm_ 3-wmp_4-s_1341513560.png "title=" 4.png "alt=" Wkiom1ltap-iq5craaakzkf35ky970.png-wh_50 "/>

6. Eject the optical drive and modify the BIOS boot sequence. Finish


This article is from the "fonphxion" blog, make sure to keep this source http://fonphxion.blog.51cto.com/6434529/1942761

Linux Modify root password single user mode and rescue mode

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.