Reset lost root password in Ubuntu

Recently while installing Xubuntu 12.04 on my old PC, I encounter the problem where Xubuntu was not accepting my root/admin password that I set during the installation.

I found the solution to my problem on http://askubuntu.com/questions/24006/how-do-i-reset-a-lost-administrative-password. I'm posting this solution here so that I can keep a record of the problem I've faced and working solutions for them.

By default the first user's account is an administrative account, so if the UI is prompting you for a password it's probably that person's user password. If the user doesn't remember their password you need to reset it. To do this you need to boot into recovery mode.
Boot up the machine, and after the BIOS screen, hold down the left Shift key. You will then be prompted by a menu that looks something like this:
enter image description here
I've noticed on some systems that timing when to hit the left Shift key can be tricky, sometimes I miss it and need to try it again.
Hit the down arrow until you select the 2nd entry from the top (the one with the recovery mode in the description) and then hit Enter.
Now you should see this menu:
enter image description here
Using the arrow keys scroll down to either root or netroot (doesn't matter in this case) and then hit Enter.
You should now see a root prompt, something like this:
root@ubuntu:~#
At this stage you should have a read-only filesystem. You have to remount it with write permissions:
mount -rw -o remount /
Now we can set the user's password with the passwd command. (In this example I will use jorge as the example, you need to substitute whatever the user's username is):
passwd jorge
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
root@ubuntu:~#
Type in what you want the new password to be at the prompt. After it's successful reboot the machine and the user will be able to log in with their new password.
Cheers, if it helps you too.

MG


Comments

Popular posts from this blog

Project Wild Penguin 12.4.2017: Installing Broadcom Wireless Drivers to connect to JBL Bluetooth Speaker on Xubuntu 16.10

Project Wild Penguin 22.4.2017: To delete directories inside current directory whose contents are less than a given size

ANPR Project Day 1: Standard Format of Indian Number Plate