In general, there are two steps to resetting Ubuntu password.
You can login with root mode just by pressing ESC button when system starting up. That'll take you to Grub Screen, when you can select mode that you'll be used while booting. If you have double OS or more on your system (dual boot), you don't need to do this step. It's automatically go to Grub Screen when system starting up.
Then choose the "recovery mode", usually found right below your default option. Press enter, and at the next screen, choose "drop to root sheel prompt" and you'll login to the system as root.
If you want to read this post directly on my blog, click here.
On Grub Screen menu, select default loader (first choice) and press "E" key that means you'll edit manually that loader. Wow On the next screen, find row that contains this word :
ro quiet splash
Then replace that with this :
After that, press "CTRL"+"X" (or maybe "B" key on your system, depend to your kernel) to boot the system with "hacked" loader
Done! You're logged in as root on your system now, and you can do anything you want. Including resetting your password!
2. Resetting your password
Use this command to reset your password :
Fill username with username that you want to reset its password. You'll prompt new password twice.
In this step, you're almost done! Now, make sure the change you've made will be written to disk by :
Reboot your system :
You're done! Your password has been reset, and you can login to your system now.
This post taken from my personal blog, http://www.panoet.com