Gentoo resetting lost root passwords without LiveCD

Posted on November 14th, 2008


Most know to add ‘1’ or ‘single’ to the kernel line in Grub to get runlevel 1 access, if they lost their root passwd. There  are many articles on the web about this. However as we know Gentoo sometimes does things a little differently. To reset the forgotten root passwd on a Gentoo box without LiveCD.

1. Press ESC a few times to get the GRUB prompt, when system is booting

2. select the default kernel and press ‘e’  <–you may have one or more kernels

3. select the kernel line and press ‘e’ again

4. add the end of the kernel line add  ‘single init=/bin/bash’   <–hit enter!

5. Confirm ‘single init=/bin/bash is at the end of the kernel line

6. press ‘B’ to boot

7. It will drop you into runlevel 1

8. mount -o remount, rw /

9. passwd  <–now reset your root passwd

10. mount -o remount,ro /

11.reboot

This method should work on most other distros as well, but you should not have to add ‘init=/bin/bash’ unless required. (gentoo being one of them)  Most other distros can be booted into runlevel 1 just by appending ‘single’ or ‘1’ to the end of the kernel line.