VMware CentOS7 忘记root密码如何更改

VMware CentOS7 忘记root密码如何更改

1、进来的页面马上点上下键停止自动进入

(Immediately click the up and down buttons on the incoming page to stop automatic entry)

在这里插入图片描述

2、点键盘e键进入编辑页面e

(Click the keyboard e key to enter the editing page)

e

3、找到这个linux16 /vmlinuz…这行代码,在最后UTF-8的后面输入代码

(Find this linux16/vmlinuz … This line of code, enter the code after UTF-8 at the end)
在这里插入图片描述

rw init=/bin/bash

在这里插入图片描述

4、按住 ctrl+x 进入bash终端

(Press ctrl+x to enter the bash terminal)

ctrl+x

5、bash命令行改密码

(Insert code)

passwd root

在New password后面输入密码,不用管密码长度提示,直接下一步确认密码
.
Enter the password after New password, regardless of the password length prompt, and proceed to the next step to confirm the password

在这里插入图片描述

扫描二维码关注公众号,回复: 17071396 查看本文章
5、输入命令

(Insert code)

touch /.autorelabel

在这里插入图片描述

6、输入命令退出编辑

(Insert code quit edit mode)

exec /sbin/init

在这里插入图片描述

密码更改完毕!Success!

猜你喜欢

转载自blog.csdn.net/agatha_aggie/article/details/133304301