Linux-Single user mode (forget the root password of Linux)

Source: Internet
Author: User
1. Restart Linux
Restart: Reboot, init 6, Shutdown-r now
Shutdown: Init 0, Poweroff
2. Press the arrow key when the following screen appears at the moment of reboot. and select the first one. and press E, the following interface appears.
3. This interface is the grub interface. Grub: Boot tool to manage the boot program of the system disk. Boot the hard drive to boot and load the kernel.
Find the rows and change the RO to RW. RO: Read only. RW: Read and write.
As shown in the following:
Add again: Sysroot is the directory where the system resides.
3. Press CTRL+X, the following interface will appear. Note: In the following interface, the command can be entered. Equivalent to Safe mode.
4.chroot/sysroot/#切换到原来的系统当中去

5.PASSWD Root #修改root密码,
Note: garbled situation, the solution: Ctrl + C input: lang=en (definition language, change into English, if not garbled, can be directly modified)

6. Change the root password
passwd Root Input password

7.touch/.autorelabel (key) if not executed, unable to login system
8. Restart the system, enter the user name, login with the new password.

Linux-Single user mode (forget the root password of Linux)

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.