How to Reset Forgotten Passwords in Ubuntu 16.04

Forgot your Ubuntu login password? Well, this quick tip is going to show you how to reset user (or root) password in Ubuntu 16.04 LTS.

It’s easy to change a password in Ubuntu Linux via passwd command. The key is how you can get into the root command console with super user privilege.

1. Boot into root shell:

For those who have not enabled root user, it’s easy to get into the root shell via the recovery mode from Grub boot-loader. To do so:

1. Start your computer, when you’re at Grub boot-loader, select Advanced Options for Ubuntu and then select boot with the recovery mode.

recovery mode

Tip: For single system and single kernel, you may press and hold Shift key to show Grub while starting up.

2. At Recovery Menu, select “Drop to root shell prompt” and hit Enter.

root shell

Hit Enter again or type in root password if enabled, and continue changing your password via the “Reset password” section (see below).

For those who forgot the root password, you can still get into passwordless root shell by adding kernel parameter in boot menu:

1. Boot into Grub menu, and highlight the default Ubuntu entry.

grub menu

2. Press ‘e‘ on your keyboard to edit the boot parameter, then scroll down and add init=/bin/bash in the end of kernel (or linux) line.

edit boot parameter

Then press Ctrl+X or F10 will boot directly into root shell prompt without password.

Reset Password:

Once you’re in root shell, run the commands below one by one to reset forgotten passwords:

1. Remount Ubuntu system with read and write permission:

mount -rw -o remount /

2. Check the username if you forgot it:

ls /home

3. Reset password via command:

passwd USERNAME_HERE

or use passwd root to reset the root password.

reset password

Finally run reboot command to reboot or resume normal boot and login with the new password.

About ml

ml is a part time stay-at-home dad who've been using Ubuntu Desktop for a few years. He writes in the free time and wishes to share some useful tips with Ubuntu beginners and lovers.

14 comments

  1. Whew, well after all the running around i thought about how to fix this. I opened up a new account and gave it administation functions. Then went into that account and fixed the first one… you know , password etc etc… then went back in and bang, got it… i m still hanging onto 2nd one though too in case i do something else to screw it up..lol

  2. My webserver on Desktop 16.10 has been hacked and password changed, who knows what else. I’ve tried following instructions as stated above but when go to reboot (Cntrl X) the screen goes blank and no actions . . . Help!

  3. Done all that, now it says
    name@name:~$
    How can i proceed to ubuntu?

    • Run reboot command:

      reboot

      It will bring you back to the recovery menu (see the second pic in the tutorial). Choose resume to resume normal boot.

      • Hi! The reboot doesn’t work for some reason.
        The system replies “shutdown: Unable to shutdown system”

        • Upon typing “ls /home” no username was given, therefore I changed the password of a ‘blank user’. I remembered my username, but I just wanted to check, and I thought I had to leave it blank, as it didn’t appear upon the said command. After I submitted the password change with the correct username, I was able to reboot and access Ubuntu with the new password.
          Thank you!

  4. When I type the new passwd it gives
    Passwd: authentication token manipulation error
    Passwd: passwd unchanged
    And I can’t login again

    • Hey did you figure out the solution of above error ? I am having the same error do help if you have fixed it.

    • because remounting system with read/write access is not succeeded.
      type>>
      mount -rw -o remount /
      and try to change useraccount’s password again
      passwd #useraccount

      I just succeeded now!
      hope it helps!

  5. What do I do if it says passwardunchanged?

  6. reboot or shutdown no command is working.
    Failed to connect to bus: no such file or directory
    What to do?