Lost your Ubuntu user password? Well, it’s not hard to reset your password even you’ve forgot the username and below is how to do it step by step.
1. To get started, you need to boot into Recovery Mode to get a console for running commands.
Start your machine and when you’re at the Grub boot loader, select boot with the entry says something below. You may find it under “Advanced Options for Ubuntu” option:
Ubuntu, with Linux 3.x.x … (recovery mode)
If you don’t see the grub menu, press and hold the Shift key after you pressed the Power button to boot the computer.
2. In the Recovery Mode options list, select “root Drop to root shell prompt” and hit Enter. You should see the black and white command prompt at the end of the screen:
3. Now run below commands one by one:
- First remount the file system with read & write permission:
mount -o rw,remount /
- If you don’t remember the username, below command will show you:
ls /home
- To change user password:
passwd USER_NAME_HERE
Replace USER_NAME_HERE with your username. When it prompts, type in a new password and confirm.
The output “passwd: password updated successfully” means user password has been successfully reset.
Finally run command exit
to back to menu (picture in step 2) and select “resume Resume normal boot” to exit Recovery Mode.