To recover your lost ubuntu password follow these simple steps.
Step #1: Just reboot your system and enter boot menu.
If your are good ubuntu user and had a single boot i.e ubuntu is the only OS on your computer them press and hold Shift key while booting, thus you can see some boot options.
If you are dual boot i.e you use windows/mac/other Linux distribution along with ubuntu then you can automatically see some boot options without the need to hold shift key.
Step #2: From boot options select recovery mode.
Step 3#: After selecting the recovery mode wait until the boot finishes. Once the process finishes you have to select Drop to root shell prompt in the list in order to reset your password.
Step #4: Once you're in, the things are very easy, just type
Note: Here in "ls" l = lowercase of L but not "i"
Step #5: This gives the list of user accounts, Now type this command and press enter.
Here replace username with the username you want to reset.passwd username
Step #6: Now you will be prompted for a new password, just give your new password(you will not see your password while you type) and press enter, you will be prompted to retype so retype the password again.
Step #7: Now simply type exit and press enter to come back to recovery menu. That's it your done with resetting your password.
At recovery menu, select resume normal boot, and now you can login to your ubuntu because you know the password.