Debian boot to single-user mode
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.
DEBIAN / UBUNTU root PASSWORD RECOVERY
- First screen - grub - press e
- Modify kernel line: add
single
betweenro quiet
and at the end of this line addinit=/bin/bash
- Press F10
- When the prompt is
root@(none):/#
you have to remount the / partition to have read-write access:mount / -rw -o remount
- Now you are ready to modify the root password: type
passwd
and change it!
Good luck
P.S: try to look at the /etc/shadow file to find other users...
Your tutorial refers to Grub (legacy Grub). This is Grub2. The line beginning with linux would be the kernel line in Grub.