进入单用户模式更改一下root密码
重启系统
3秒钟内,按一下回车键。
输入 ‘e’ 会在启动前编辑命令行,而我们要做的是输入 ‘e’
按一下向下的箭头键,选中第二行,输入 ‘e’
你只需要在后面加一个 “single” 或者 “1” 或者 “s”
<_NO_DM rhgh quiet single
然后先按回车然后按 ‘b’,启动后就进入单用户模式。
修改root密码
输入修改root密码的命令 ‘passwd’:
[root@localhost /]# passwd Changeing password for user root. New password: Retry new password: passwd: all authentication tokens updated successfully.
修改后,重启系统
[root@localhost /]# reboot
转载于:https://blog.51cto.com/gjr0512/1537989