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.

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.

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
Filed under:
UBUNTU
Leave a comment