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
5、输入命令
(Insert code)
touch /.autorelabel
6、输入命令退出编辑
(Insert code quit edit mode)
exec /sbin/init