centos7密码遗忘

1:开机,出现开机选项菜单时,立即按下键盘上的e键
centos7密码遗忘
2:在最后加上 rd.break
centos7密码遗忘
3:按下 Ctrl+x
centos7密码遗忘
4:挂载并切换
mount -o remount,rw /sysroot
chroot /sysroot
centos7密码遗忘
5:设置密码
passwd
输入两遍新密码(在屏幕上是不可见的)

centos7密码遗忘
6:创建隐藏文件
touch /.autorelabel
centos7密码遗忘
7:退出并重启
exit
exit
centos7密码遗忘
8:以新密码登录
centos7密码遗忘

相关文章: