忘记root密码怎么办

进入单用户模式更改一下root密码

  1. 重启系统

3秒钟内,按一下回车键。

输入 ‘e’ 会在启动前编辑命令行,而我们要做的是输入 ‘e’

按一下向下的箭头键,选中第二行,输入 ‘e’

你只需要在后面加一个 “single” 或者 “1” 或者 “s”

<_NO_DM rhgh quiet single

然后先按回车然后按 ‘b’,启动后就进入单用户模式。

 

  1. 修改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

你可能感兴趣的:(忘记root密码怎么办)