How to change the root password if you forget it in VMware CentOS7
1. When the page comes in, click the up and down keys immediately to stop automatic entry.
(Immediately click the up and down buttons on the incoming page to stop automatic entry)
2. Press the e key on the keyboard to enter the editing page e
(Click the keyboard e key to enter the editing page)
e
3. Find this line of code linux16/vmlinuz... and enter the code after the last UTF-8
(Find this linux16/vmlinuz … This line of code, enter the code after UTF-8 at the end)
rw init=/bin/bash
4. Press ctrl+x to enter the bash terminal
(Press ctrl+x to enter the bash terminal)
ctrl+x
5. Change password using bash command line
(Insert code)
passwd root
Enter the password after New password, regardless of the password length prompt, and proceed to the next step to confirm the password
.
5. Enter the command
(Insert code)
touch /.autorelabel
6. Enter the command to exit editing.
(Insert code quit edit mode)
exec /sbin/init