1 - 在启动grub菜单,选择编辑选项启动

centos7进入单用户模式
    





            
 

2 - 按键盘e键,来进入编辑界面

centos7进入单用户模式
    





            
 

3 - 找到Linux 16的那一行,将ro改为rw init=/sysroot/bin/sh

如果用的是kvm做了console连接授权,还要把授权的console=ttyS0去掉

centos7进入单用户模式
    





            
 

4 - 现在按下 Control+x ,使用单用户模式启动

centos7进入单用户模式
    





            
 

5 - 现在,可以使用下面的命令访问系统

chroot /sysroot

6 - 重置密码

passwd root

7 - 更新系统信息

touch /.autorelabel

8 - 退出chroot

exit

9 - 重启你的系统

reboot

1 - 在启动grub菜单,选择编辑选项启动

centos7进入单用户模式
    





            
 

2 - 按键盘e键,来进入编辑界面

centos7进入单用户模式
    





            
 

3 - 找到Linux 16的那一行,将ro改为rw init=/sysroot/bin/sh

如果用的是kvm做了console连接授权,还要把授权的console=ttyS0去掉

centos7进入单用户模式
    





            
 

4 - 现在按下 Control+x ,使用单用户模式启动

centos7进入单用户模式
    





            
 

5 - 现在,可以使用下面的命令访问系统

chroot /sysroot

6 - 重置密码

passwd root

7 - 更新系统信息

touch /.autorelabel

8 - 退出chroot

exit

9 - 重启你的系统

reboot

相关文章:

  • 2021-07-20
  • 2021-04-15
  • 2021-11-27
  • 2021-09-12
  • 2021-07-16
  • 2021-12-12
  • 2022-12-23
猜你喜欢
  • 2021-10-20
  • 2021-07-16
  • 2021-08-06
  • 2021-10-20
相关资源
相似解决方案