This brief tutorial shows users how to easily reset a forgotten user password, including the root user on Ubuntu 17.04 | 17.10 and 18.04 LTS… We’re humans, and we forget stuff… when we do, we tend to go back in time to remember what was forgotten.
The same is true with passwords. We do forgot a lot when it comes to passwords… that’s why there are countless password managers to help us manage our passwords.
Forgetting your Ubuntu desktop or server password may prevent you from logging on physically or remotely. There are tools that may be able to help you recover the password. However, the method below is the quickest and easiest way to do it.
When you’re ready, please continue below
Reset Ubuntu password from the recovery mode
1: Boot into the recovery mode
Switch the computer on. Go to Grub menu. Generally, it appears automatically, if not then hold down the shift key until the boot menu appears.
In the grub menu, select the “Advanced Options for Ubuntu”:
Next, select *Ubuntu, with Linux.x.x-generic (recovery mode) .. select the recovery mode for the same Grub version as the default… they both should have the same version number…
2: Drop to root shell prompt
Now you will be present with different options of recovery mode. Here you need to choose “Root Drop into root shell prompt“. Just press enter key to select this option. Like in the picture below:
You’ll see that when you select the root shell prompt option, an option to enter commands appear in the bottom. This is your root shell prompt and this is where you’ll use the commands to reset the password.
3: Remount the root with write access
You need to have write access to the root partition. By default, it has only read-only access.
Use the command below to remount it with write access:
# mount -rw -o remount /
4: Reset username or password
Here, you will be presented with root access. Use the following command to list all the users available:
# ls /home
From the previous command choose the “username” for which you want to reset or (say) hack the password. Now, use the following command to reset the password for the selected “username“:
# passwd username
It prompts for a new password. Enter the new password twice:
Enter new UNIX password: Retype new UNIX password:
Next, type reboot to restart the desktop or server and begin using the new password you just created.
This is how one resets a user or root password on Ubuntu servers and desktop.
This post shows users how to reset a forgotten user password on Ubuntu servers and desktops. It should apply to almost all version of Ubuntu. Follow the steps above to recover your forgotten passwords on Ubuntu 16.04 / 17.10 and 18.04 LTS.
Congratulations! You’ve just learned how to reset or recover forgotten user passwords on Ubuntu
You may also like the post below: