But how about if you are on an unfamiliar system such as Ubuntu (or any Linux distribution) and you forgot your password. Do you know what steps to take to reset your password so you can log back in to your computer?
Unlike Windows, this process is a lot easier.
To get started, just boot your computer and when you see "Loading Grub" press the ESC (Escape) key. If you missed it, just reboot and try again.
Once you see the Grub prompt, press 'e' to enter Edit mode (as shown by the arow in below screen shot).
Next, highlight the line that begins with kernel and press 'e'.
Now, what you see may seem a little odd, but go the very end of the line, hit the space bar once, then type the following command after the word 'splash':
and press enter, then b to reboot.
After Ubuntu has restarted, instead of loading the GUI, you will see a passwordless root shell. At the prompt, type the following command and replace 'username' with the name of the account you want to change the password.
Type in a new password and retype to verify, once you see the confirmation that your password was updated successfully, reboot.
When GNOME loads enter your new password and you should be good as new again.