1 - 在启动grub菜单,选择编辑选项启动
![](https://img-blog.csdnimg.cn/img_convert/ea4b4e87c0eb18a5050319beadd47915.png)
2 - 按键盘e键,来进入编辑界面
![](https://img-blog.csdnimg.cn/img_convert/db357f1812e002a31d8e4e53881483ae.png)
3 - 找到Linux 16的那一行,将 ro 改为 rw init=/sysroot/bin/sh (init 为新增)
如果用的是kvm做了console连接授权,还要把授权的console=ttyS0去掉
![](https://img-blog.csdnimg.cn/img_convert/0a6b9e06d913015df1842842b1394fba.png)
4 - 现在按下 Control+x ,使用单用户模式启动
5 - 现在,可以使用下面的命令访问系统
chroot /sysroot
6 - 重置密码
passwd root
7 - 更新系统信息
touch /.autorelabel
8 - 退出chroot
exit
9 - 重启你的系统
reboot