Enter single user mode
在选择内核的时候,摁e【机器开启后,注意观察下方提示信息,会有显示'e'字母的时候摁下】
则会进入以下界面
找到ro 修改为rw 并打空格后添加init=/sysroot/bin/sh
再按Ctrl+x,就可进入单用户模式
Switch system
After entering single-user mode, enter the following command to switch to the normal system so that you can use the command to change the password:
chroot /sysroot
change Password
Enter the following command twice to be prompted for a new password and then confirm the password:
passwd root
Exit system
exit
Restart the system
reboot
#重启后,即可使用新密码登录