If you forgot your ubuntu password, don’t be panic 😀 .. Ubuntu have a method for recovery a password.
The first, you must calm down :), and then boot up or reboot your computer, and when prompted, choose *Advanced options for Ubuntu :
And then you will see the prompted like this, after that you choose root, and press Enter.
Next, remount the shell with read and write option with type this in your shell prompt :
mount -rw -o remount /
after running the above command, the shell should be remounted with read and write permission for file system.
And now, you can set your new password with run passwd command in your shell.
for example my username is legolas, i used this command :
after changing your password, using this command for reboot your ubuntu system. The sync commands makes sure to write out data to your disk before system reboot.
And now you can use your ubuntu with a new password..
Have a nice day ^_^