Resetting root password on Debian

Nov 07, 2008 17:10


Originally published at Vitae Ordinatraliter. You can comment here or there.

Everyone knows that to reset a root password you just boot into single user mode and away you go. Easy. Unless it’s a box like the one I dealt with today…
Debian Etch Using grub as a bootloader. Booting into single uer mode got me to “enter root password for maintenance. Or press ctrl-D to continue”. Prss ctrl-D… I end up at a login prompt. Can’t reset root password that way….
So instead of booting into single uer mode, edit your normal grub boot (press ‘e’ at the grub menu) and add ‘init=/bin/bash’ to the end of the kernel boot line. Then boot as normal. Oh look, a root prompt… Once you come up remember to remount / (’mount -o remount,rw /’). You are now in as root with a r/w filesystem. Use ‘passwd’ and you’re done.
If you’re an employer, you could of course avoid such issues by remembering to ask your IT slave for a list of all the admin passwords before firing them…

linux

Previous post Next post
Up