在開機時按e進入編輯啓動列表
在UTF-8那一行加入 rd.break
ctrl-x自動重啓,進入編輯
重新mount sysroot,確保rw
mount |grep /sysroot
mount -o remount,rw /sysroot
chroot /sysroot
設置新密碼爲test
echo test|passwd --stdin root
最後一步,重要!不做就不生效(針對SELinux)
touch /.autorelabel
兩次exit 重啓
SELinux relabel
重啓後測試使用root密碼 test生效
done