If your memory or mistyping leaves you without the right password to get into an account on a Linux computer, there’s no need to reformat. You’ll just need to reboot into single user mode to reset it. Here’s how to do it on a typical Ubuntu machine with the GRUB bootloader:
- 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.
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
Once your done, give the three finger salute, or enter ‘reboot’ to restart into your machine’s normal configuration.
That’s all there is to it. Now just make sure to write your password down on a post-it and shove it somewhere safe like under your keyboard.
[ Source: Hackzine.com ]






8 responses so far ↓
Lisa // September 11, 2008 at 8:37 pm
I have tried this and it still does not work. Is there another option i can try? If not then how can i re-install Ubuntu via an NON admin user account ( I cannot remember my password in order to get into my main user account.) I have reset the password before but i have not used this system in such a long time i cannot remember what i changed it to…
burnz // September 12, 2008 at 4:47 pm
Hi Lisa,
Why is the option above not work? Could explain the steps that you use.
Alan // January 6, 2009 at 2:54 am
At least with 8.10, when you select single user mode (either by adding single to your usual kernel line or using the recovery version in grub) you are forced into a Recovery Menu.
If you choose “root – Drop to root shell prompt” you are still prompted for the root password and are unable to reset it.
Anthony LaFace // April 9, 2009 at 5:14 am
you are brutal, your advice sucks
mjavier2k // May 13, 2009 at 9:08 am
goto recovery mode then add “rw init=/bin/bash ” press enter, then press b to boot your system.
hope this helps.
Saeed // May 26, 2009 at 6:41 pm
i can’t understand that….
and i was try this command to reset my password..
but i m not successful.
Plz tell me how to reset my root password on ubuntu.plz plz plz plz
sham // July 18, 2009 at 11:00 pm
Recovery mode, then drop to command line on Ubuntu worked great for me. thanks for the help!
Jaunty // October 29, 2009 at 1:28 am
Excellent! This lead me to right place. I’m using Jaunty.
My route:
1. Reboot the machine.
2. Press the ESC key while GRUB is loading to enter the menu.
3. Select ‘recovery mode’ option.
4. Select ‘drop to root shell prompt’.
5. ‘# nano /etc/passwd’ gives you a list of users
6. change any users password with ‘# passwd [username]’