重启系统后按'e'键,进入编辑模式,在'UTF -8'后空格输入'rd.break'后,按快捷键'Ctrl+X'进入新界面进行编辑,代码如下:
switch_root:/# mount -o remount,ru /sysroot/
switch_root:/#mount
switch_root:/#chroot /sysroot
sh-4.2# passwd root
New password:(输入新密码)
Retype new password:(重新输入密码)
sh-4.2# touch / .autorelabel
sh-4.2#exit
swich_root:/# reboot
重置密码完成