Thursday, February 04, 2010

Rescuing a Linux box

If you have a Linux computer that boots up through Grub (like Ubuntu does) and you don't know the user names and Grub has the Recovery Mode entry in its menu then you may be able to regain control of the computer using the following steps. (Lots of preconditions but they are pretty common for Debian-based systems.)
  1. Highlight the Recovery Mode option.
  2. Press e for edit.
  3. Highlight the kernel line and press e again.
  4. Remove the ro single kernel parameters and append the line with rw init=/bin/bash.
  5. Press enter then b to boot.
  6. Wait for all the boot-up processes to finish.
  7. Change the password(s) with the passwd command.
  8. Press Ctrl+Alt+Del to reboot.
Thanks to sisco311 in the Ubuntu Forums for that description.

No comments: