重置 Centos 7 Root 密码的方式和 Centos 6 完全不同。让我来展示一下到底如何操作。
1 – 在启动 grub 菜单,选择编辑选项启动
2 – 按键盘 e 键,来进入编辑界面
3 – 找到 Linux 16 的那一行,将 ro 改为 rw init=/sysroot/bin/sh
4 – 现在按下 Control+x ,使用单用户模式启动
5 – 现在,可以使用下面的命令访问系统
chroot /sysroot
6 – 重置密码
passwd root
7 – 更新系统信息
touch /.autorelabel
8 – 退出 chroot
exit
9 – 重启你的系统
reboot
就是这样!
本文来自:http://www.centoscn.com/CentOS/config/2014/1031/4032.html