centos7忘记密码处理办法

此界面按e进入grub编辑界面

centos7忘记密码处理办法

 

进入grub编辑界面。把linux16这行的ro修改为rw init=/sysroot/bin/sh。

centos7忘记密码处理办法

 

 centos7忘记密码处理办法

 

 按ctrl+x进入单用户模式

centos7忘记密码处理办法

 

 

 

登陆进去后,输入如下命令:
chroot /sysroot/ #切换到原系统
LANG=en #设置显示语言
passwd root #修改root密码
touch /.autorelabel #如果之前系统关闭selinux,这个可以不执行。

reboot重启即可

 

相关文章:

  • 2021-12-14
  • 2021-10-25
  • 2021-08-27
  • 2021-11-14
  • 2022-12-23
  • 2021-10-17
  • 2021-09-26
猜你喜欢
  • 2021-12-15
  • 2021-06-22
  • 2021-12-25
  • 2021-12-23
  • 2021-09-22
  • 2021-12-04
相关资源
相似解决方案