Reset Your Ubuntu Password Easily from the Live CD
Our last article on how to reset your Ubuntu password easily through the grub menu was quite popular, so I’ve decided to make a series on all the different ways to reset your password on either Linux or Windows… today’s lesson is how to use the Live CD to reset the password.
Note that we’ll also cover how to protect yourself against somebody else resetting your password, so stay tuned!

Of course, this method will also work if you’ve installed your Ubuntu Live CD to a thumb drive.
Resetting the Password
You’ll want to boot from your Ubuntu Live CD, choosing “Try Ubuntu without any change to your computer” from the boot menu.
Once the system boots, open up a new Terminal window from Applications \ Accessories and then type in the following command:
sudo fdisk -l
This command is used to tell what device name the hard drive is using, which in most cases should be /dev/sda1, but could be different on your system.
Now you’ll need to create a directory to mount the hard drive on. Since we’re actually booting off the live cd, the directory doesn’t really get created anywhere.
sudo mkdir /media/sda1
The next command will mount the hard drive in the /media/sda1 folder.
sudo mount /dev/sda1 /media/sda1
Now it’s time for the command that actually does the magic: chroot. This command is used to open up a shell with a different root directory than the current shell is using, and we’ll pass in the folder where we mounted the hard drive.
sudo chroot /media/sda1
Now you should be able to use the passwd command to change your user account’s password, and it will be applied to the hard drive since we are using chroot.
passwd geek
Note that you’ll have to type your username after the passwd command in order to change the right password.
Now you should be able to reboot your system and log yourself in with your new password.
Daily Email Updates
You can get our how-to articles in your inbox each day for free. Just enter your name and email below:
| Similar Articles | Featured Wiki Articles |
|
|
| Latest Software Reviews | Quick Linux Tips |
| Geek Arcade | Popular Forum Threads |


I have only disk with vista loaded.
suppose if forget the password then will this method work for resetting the vista passwd ??
abhi
This article has nothing to do with Vista.
For resetting the passwords on Windows you can use the Ophcrack LiveCD. I used to it reset the password on my parents XP computer. While not positive, I think it works for most versions of Vista. Be responsible with it!
Great article, I just put a dual-boot Ubuntu on a 1GB Vista laptop rather than spend Ł30 on another GB of memory. I’d be a total convert if I didn’t have to use Windows for work. This kind of information is just one of those `need to know` things that is bound to come in useful.
Re: the previous comment(s) there is a specific version of Ophcrack for Vista. It manages passwords a little differently to 2000/XP (much much harder to crack if you have a complex password apparently).
To the post above brundle, VMware works in Ubuntu very very well. You should probably give that a shot.
What if you don’t know the user name?
Awesome, hopefully it works. Thanks and GOD Bless you all.
Thank you. I used this technique after I “passwd -l”ed all my users on accident.
If you don’t know the username, you can use this command to display all the users:
cat /etc/passwd