CentOS 7 forgot the root password modification method
The root password recovery of CentOS 7 is different from that of 5Power6, because 7 uses GRUB2 to start, and it is impossible to reset the root password through single-user mode if you forget your password. Here are two tips to help you easily reset your root password.
The first move to amend the Dafa
Press "esc" to turn on the computer
Select "CentOS Linux (3.10.0-327.)" and press the "e" key to enter
Move the cursor to the line at the beginning of "linux16" and find "ro" instead of "rw init=sysroot/bin/sh"
Press "Ctrl+x" to execute
Enter "chroot / sysroot" after entering
Enter "passwd"
Enter the new password twice according to the prompt
Enter "touch / .autorelabel" to update system information
Enter exit or press Ctrl+d to exit
Enter "reboot" to restart
The second move to amend the Dafa
Press "esc" to turn on the computer
Select "CentOS Linux (3.10.0-327.)" and press the "e" key to enter
Move the cursor to the line at the beginning of "linux16" and add "init=/bin/bash" at the end of the line
Press "Ctrl+x" to execute
Mount the file system to be writable
Enter "passwd"
Enter the new password twice according to the prompt
Enter "touch / .autorelabel" to update system information
Enter "exec / sbin/init" to start the system normally