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)