xorinzor asked:
I forgot my root password and am attempting to change it by booting into single-user mode, however when booting I get this screen:
Then I press “e” to edit the boot configuration and I get this screen:
However, in the tutorial I’m following it says I should navigate to the line that starts with “kernel”, but as you can see, I dont have this line.
So I tried changing “quiet” to “single” on the line that starts with “linux /boot/vmlinuz….” but this doesn’t boots the system into single-user mode.
What line am I supposed to edit in order for this to work?
My answer:
One method:
-
Append
init=/bin/bash
to the end of the grub line which begins withlinux
(and ends withquiet
). -
Reset your password and reboot normally.
-
Don’t forget it again.
-
Consider installing
sudo
.
Another method:
- Since this is apparently a virtual machine, you can mount its disk on another (working) virtual machine and manually remove the password from the
/etc/shadow
file. Or usekpartx
to work with the virtual machine image file from the host or from another machine.
View the full question and any other answers on Server Fault.
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.