i forgot password to use sudo and password for logging as root from login prompt I forgot My root Password Please help me To recover my root password.i am not able update my system not able install new software.

  • Do you mean the password you use for sudo ... or password for logging as root from login prompt ? – Soren A Mar 2 '17 at 12:14
  • yes i forgot password to use sudo and password for logging as root from login prompt – Prabhjot Singh Mar 2 '17 at 14:33

Assuming that your user is allowed to execute sudo you can do the following:

  1. Execute bash as root

    sudo bash

    Enter the regular password of your user

  2. Change root password using:

    passwd root

This will allow you to set root password (without the need for the old password)

| improve this answer | |
  1. Boot into recovery mode from the Grub menu (using shift key if Ubuntu is the only OS)
  2. After the boot, go to the option Drop to Root Shell Prompt
  3. Type mount -o rw,remount /
  4. To reset Password, type passwd username (your username)
  5. Then type a new Password and exit from the shell to the recovery menu
  6. Select resume normal boot
  7. Select Ok
  8. Use your Ubuntu with the new Password
| improve this answer | |

Please try this procedure:

  1. restart your computer while holding the shift key until you see the boot options (it may require several attempts)

  2. Moving up and down in the menu with arrows, choose root

  3. on the terminal which opens type "password " followed by your user name (ex "password paul", paul being your user name)

  4. When prompted, enter a new SIMPLE password, confirm.

  5. After re-booting your computer, change again your password to a more sophisticated one.

If you face any problem with step 3 do : mount -rw -o remount /

| improve this answer | |
  • 1
    the command is not password, but passwd in true unix shorthand style – Roland Oct 21 '17 at 22:00

Not the answer you're looking for? Browse other questions tagged or ask your own question.