Resetting a Lost Admin Password on Ubuntu Linux

I recently picked up a development project I set aside a couple years ago using an old Dell Optiplex and Ubuntu Linux 12.04, which is now outdated.  Problem was, though, I couldn’t remember the password for the only profile I set up those two years ago. Here’s the fix.

First, hold down the left SHIFT key when the computer boots the BIOS.  That should load the GRUB menu. Select “recovery mode” from the GRUB menu.

That should load another menu. Select the “root  —  Drop to root shell prompt” option and it should drop you into a terminal prompt as root.

But before you can change the password you have to remount the filesystem as read/write instead of read-only and thereby avoid an “authentication token manipulation error.”

mount -o remount,rw /

Now, reset the password:

passwd <username>

In other words, if my username was mrbookman the command would be:

passwd mrbookman

It should now ask or a new UNIX password. Enter it. Then re-enter it.

Now, just reboot the system.

reboot -f

The only issue I encountered after booting into the Ubuntu desktop as normal was that this new password didn’t match the password stored in Ubuntu’s keychain.  This doesn’t (or hasn’t yet) posed a problem but I’ll update later on how to fix it.

UPDATE: the first thing you should do after gaining desktop access is changing the password for that account from within the system settings BEFORE Ubuntu hibernates or locks out due to inactivity or whatever.  Select “System Settings” then “User Accounts.” Select the account for which you just reset the password and do it again here so that the keychain will update.  Else you may have to run through the entire process again.

Leave a Reply