Reset Your Forgotten Ubuntu Password in 2 Minutes or Less
If you've ever forgotten your password, you aren't alone… it's probably one of the most common tech support problems I've encountered over the years. Luckily if you are using Ubuntu they made it incredibly easy to reset your password.
All it takes is adjusting the boot parameters slightly and typing a command or two, but we'll walk you through it.
Reset Your Ubuntu Password
Reboot your computer, and then as soon as you see the GRUB Loading screen, make sure to hit the ESC key so that you can get to the menu.

Root Shell - Easy Method
If you have the option, you can choose the "recovery mode" item on the menu, usually found right below your default kernel option.
Then choose "Drop to root shell prompt" from this menu.
![image[6]](http://www.howtogeek.com/wp-content/uploads/2008/09/image%5B6%5D.png)
This should give you a root shell prompt.
Alternate Root Shell Method
If you don't have the recovery mode option, this is the alternate way to manually edit the grub options to allow for a root shell.
First you'll want to make sure to choose the regular boot kernel that you use (typically just the default one), and then use the "e" key to choose to edit that boot option.
Now just hit the down arrow key over to the "kernel" option, and then use the "e" key to switch to edit mode for the kernel option.

You'll first be presented with a screen that looks very similar to this one:

You'll want to remove the "ro quiet splash" part with the backspace key, and then add this onto the end:
rw init=/bin/bash
Once you hit enter after adjusting the kernel line, you'll need to use the B key to choose to boot with that option.
At this point the system should boot up very quickly to a command prompt.
Changing the Actual Password
You can use the following command to reset your password:
passwd <username>
For example my username being geek I used this command:
passwd geek

After changing your password, use the following commands to reboot your system. (The sync command makes sure to write out data to the disk before rebooting)
sync
reboot –f
I found that the –f parameter was necessary to get the reboot command to work for some reason. You could always hardware reset instead, but make sure to use the sync command first.
And now you should be able to login without any issues.


well that just makes it too easy to hack someones computer… :/ whats the point of the password other than to slow them down now…
Thanks a handful.For the newbies it will be of great help as this is a common problem.I have a question though,is it compulsory to enter numerics as your password so as for it to function?I used characters at first as i was setting up Ubuntu but the password didnt go through.I had to reinstall Ubuntu to re enter a new password and i used numerics to my success!
I must say, Dcw329 is correct, this would make it extremely easy for hackers, or bothersome roommates to get into your computer.
Is there any way to disable this function so a password reset could not occur?
@All
I'm going to cover how to prevent this in the next day or so =)
editing the kernel line is stupid. Just press down again at the grub menu and enter "recovery mode". This is exactly one of the reasons recovery mode is there.
And to everyone complaining it makes it too easy to hack someones computer: Encrypt your drive if you actually care. Otherwise, anyone with physical access can do whatever they want anyway.
Good article– but like the others above, I would really like to see a follow-up on how to lock-down your GRUB, if not more.
@thesquirrelwood
That's a good point, I should have included that… updated.
@DCw329, @J/C.B II
You can first edit /boot/grub/menu.lst to remove the recover entries built in to the boot menu that thesquirrelwood mentioned.
Then, you can put a password on your grub menu so that you need to enter a password before you can edit a boot entry. I forget what the directions are exactly…somebody may want to verify these, but I _think_, off the top of my head, it's…
1. Open a shell and type the command "grub" to enter the interactive grub shell.
2. Type md5crypt and hit enter.
3. Enter the password you want on the menu and hit enter to get the encrypted form.
4. Edit /boot/grub/menu.lst and add the line: password –md5 encryptedpasswordfromstep3goeshere
I'm 99% sure those are the accurate steps…haven't had to set up a Linux install from scratch in quite some time (and I'm on my Windows box now, so I can't verify).
lol… i dont even have linux… so im not too worried… lol… but i thought it was kind-of funny that it is so easy to hack a computer… but if there is a way to stop that (as the geek metioned) then it should be no big deal for you guys…
now that i think of it… i should probly ask… is there a way to do that with windows? should i be worried about my windows vista laptop?
@Dcw329
If somebody has physical access to your computer, they can do almost anything they want, unless your hard drive and data are encrypted.
It's not quite as easy to reset the Vista password, but it is definitely possible.
[Edit] This article will be the first in a series on this topic… I'll try and cover all the important points for Windows and Linux =)
Nice post, good screenshots
I can not believe the amount of comments from this article. The hilarious thing is that if someone did get into my computer, they would find nothing expect a wallpaper.png and perhaps a few comic book files.
If someone seriously wants to gain access to your computer, they'll find a way too.
i'm not worried about the CIA trying to break into my computer… but if my friend wants play a prank or something, i don't want him to be able to get it… if it is common knowledge how to break into a computer, i want to stop it… if its difficult, and uncommon… i don't think i need to worry… (i don't have many computer savvy friends… so i'm not panicking…)
It is not much harder in Windows. Boot from the EBCD boot disk, and change the password.
Its an amazing post..quite useful…….:)
how do i disable that menu for resetting my ubuntu password?
I agree with thesquirrelwood. While it's good to take security precautions, if anyone has physical access to your computer, no password is going to save you. If you want to prevent someone from getting your data go with encryption.