/Linux · 2023年 5月 14日 0

centos7忘记root密码怎么办

CentOS 7忘记root密码
1 – 重启系统 进入此界面后,按e进入配置界面
file
2 – 按键盘e键,来进入编辑界面
file
3 – 找到Linux 16的那一行,将ro改为rw init=/sysroot/bin/
file
4 – 现在按下 Control+x ,使用单用户模式启动
file
5 – 现在,可以使用下面的命令访问系统
chroot /sysroot
file
6 – 重置密码
passwd root
file
注:此处输入新密码不会显示
7 – 更新系统信息
touch /.autorelabel
file
8 – 退出chroot
exit
9 – 重启你的系统
reboot