This tutorial will show you how to reset the root password on CentOs 7 / Redhat 7. As a health warning please be sure that when doing this you have taken a snapshot of your VM or if it’s a physical server that you follow the instructions very carefully. With that in mind lets get started.
When the system boots up press e on this screen.
In the screen that appears scroll down to the line were you see Linux 16
Now Change where its says ro to:
Then press ctrl + x
You will now be in emergency mode which will look like the screen below:
Type in the command:
Reset the root password by typing in:
No ensure that selinux will be relabelled by typing the command:
Now reboot by typing in: