Sometimes you forgot user password it’s probably one of the most common problems you face. Fortunately on the off chance that you are using Ubuntu they made it extraordinarily simple to reset your password.
Reset Your Ubuntu Password
Reboot your system, and after the BIOS screen, hold down the left Shift key. You will then be prompted. Hit the down arrow until you select the 2nd entry from the top (Advanced options for Ubuntu) and then hit Enter.
Now, you can choose the “recovery mode” item on the menu from the top (the one with the recovery mode in the description) and then hit Enter.
Using the arrow keys choose “Drop to root shell prompt” from this menu.
You should now see a root prompt.
Now, you have to remount it with write permissions because you should have a read-only filesystem.
# mount -rw -o remount /
Now we can set the user’s password using passwd command.
# passwd dennis
Once you are reset your password successful reboot the machine and the user will be able to log in with their new password.