Replace Linux root password
September 6, 2008
I never realized the it was even easier to replace a lost (or to hack a machine given you have physical access) a Linux machine. Jason Striegel posted this example over at Hackszine.com on how to reset a lost Ubuntu password. It’s surprisingly simple to reset, simply follow the steps outlined below. Here’s how to do it on a typical Ubuntu machine with the GRUB bootloader:
Boot Linux into single-user mode
- Reboot the machine.
- Press the ESC key while GRUB is loading to enter the menu.
- If there is a ‘recovery mode’ option, select it and press ‘b’ to boot into single user mode.
- Otherwise, the default boot configuration should be selected. Press ‘e’ to edit it.
- Highlight the line that begins with ‘kernel’. Press ‘e’ again to edit this line.
- At the end of the line, add an additional parameter: ’single’. Hit return to make the change and press ‘b’ to boot.
Change the admin password
The system should load into single user mode and you’ll be left at the command line automatically logged in as root. Type ‘passwd’ to change the root password or ‘passwd someuser’ to change the password for your “someuser” admin account.
Reboot
That’s it, just reboot into your normal configuration with the new root password.










