美文网首页Unix之路
重置CentOS 7的Root密码

重置CentOS 7的Root密码

作者: 陈宝佳 | 来源:发表于2017-09-16 00:12 被阅读18次

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

image

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

image

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

image

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

image

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

chroot /sysroot

6 - 重置密码

passwd root     #需要输入两次新密码

7 - 更新系统信息

touch /.autorelabel

8 - 退出chroot

exit

9 - 重启你的系统

reboot

END

相关文章

网友评论

    本文标题:重置CentOS 7的Root密码

    本文链接:https://www.haomeiwen.com/subject/vntysxtx.html