Steps:
- Reboot. You should see the menu with CentOS 7 and have a few split seconds to press
e
for edit. - Scroll down, you’ll have to probably resize the VM console view. Sometimes going to the end and scrolling back is easier.
- Look for
ro
and change torw init=/sysroot/bin/sh
- Press
control-X
and wait a short while to see the prompt about Emergency Mode chroot /sysroot
- passwd root
If you get passwd command not found
, you have an issue.
Otherwise,
exit
Then
reboot
Screenshots:
#1
#2
#3
#4
Fin.
Running Ubuntu? Try this instead:
Change ro to rw and add init=/bin/bash to the end of the line.