CentOS 7破解root密码

  • 开机按“e”键
  • 找到linux16开头的行,按“End”键调到行尾
  • 添加割断信息: rd.break console=tty0
  • Ctrl+x 进入救援模式
  • 以读写的方式重新挂载根目录:mount -o remount,rw /sysroot/
  • 切换到根目录:chroot /sysroot/
  • 给root修改密码为123
  • 将/etc/selinux/config中的模式改为disabled或者touch /.autorelabel(标记下一次启动重做SELinux标签)
  • exit reboot

猜你喜欢

转载自blog.csdn.net/anqixiang/article/details/109138509