If you have forgotten your Linux password, don't worry. Many people have faced this problem,  so you are not alone. It is probably one of the most common tech support problems. Luckily, if you are using Ubuntu or a distribution based on Ubuntu, it is incredibly easy to reset your password.

Now, you'll have a root shell and you can use the passwd command to reset your password.

To use the passwd command to reset your password, all you have to do is type passwd YourUserName

You will then be asked to enter a new password for your username and then, once you reboot your computer, you will be able to log in using the password you created.