1.重启虚拟机系统
2 选择第一行按 e 进行编辑
3 找到 linux 开头的段落,然后在此行结尾也就是 quiet 后面空格然后输入 rd.break
4 按 Ctrl+x 开始
5 switch_root:/# mount -o remount,rw /sysroot
6 Switch into a chroot jail, where /sysroot is treated as the root
of the filesystem tree
switch_root:/# chroot /sysroot
7 Set a new root password:
sh-4.2# passwd
8 Make sure that all unlabeled files (including/etc/shadow at this
point)get relabeled during boot.
sh-4.2# touch /.autorelabel
9 sh-4.2# exit
10 switch_root:/#