Sometimes you might have experienced a situation where you forgot your Ubuntu login password. I have came across such a situation. This post is about resetting a forgotten login password in Ubuntu.
Resetting a forgotten password in Ubuntu is very easy with the help of root-shell. All you have to do is to follow these simple steps.
Firstly you have to reboot your system, and press the ESC key when GRUB starts loading. From the menu, select the ‘Advanced options for Ubuntu‘ as shown.
Now select the ‘recovery mode‘ option from the menu.
From the recovery menu, select the option ‘root‘ which opens the root-shell prompt.
Now type the following commands and enter your new password when prompted,
mount -rw -o remount /
passwd <username>
sync
reboot -f
For example, I have to reset the password for the username ‘greetz’. Then my command will be like,
mount -rw -o remount /
passwd greetz
sync
reboot -f
Note: If you skip the command ‘mount -rw -o remount /’ you might get ‘Authentication token manipulation error’.
That’s it, you can again login with your new password.