Centos7 forgot root password, reset
1. Restart the system; press the up and down keys to select the operating system to be modified, usually the first, then press e to enter the editing state, delete rhgb and quiet, add init=/bin/bash; and then ctrl+x
two。 Enter the command from mount: mount-o remount,rw /
3. Type the command to change the password using passwd: passwd
Enter the new password twice; this will see Xiaobai fast or garbled, don't panic, just keep going.
4. Then type the command: touch / .autorelabel
5. Last restart: exec / sbin/init
6. The great task has been completed!
Rhgb
And
Quiet
Rhgb
And
Quie