Tuesday, June 23, 2009

How to reset or change forgotten login password in Ubuntu

If you have forgotten your login password in Ubuntu, here's how you can reset or change it:
  1. Boot your computer.

  2. After the initial hardware splash screen, you get a second screen with a countdown timer that says something like: "GRUB Loading... Press ESC to enter the menu"

  3. Press the ESC key.

  4. This brings you into the GRUB menu.

  5. Using the arrows keys, navigate to the "Recovery Mode" of the Ubuntu kernel with the highest/latest version number and press the ENTER key.

  6. This will bring you into Ubuntu's root shell.

  7. At the command prompt, type: passwd your_username (replace your_username with your actual username).

  8. The system will prompt you for a new password with the message: "New UNIX Password."

  9. Type in your new login password.

  10. Voila! Your password has been reset/changed without the need to know your forgotten login password.

  11. To restart the system, type: reboot

  12. After rebooting, login with your username and new login password.

Question: What if Ubuntu asks you for a root password?

Answer: By default, Ubuntu does not require you to set a root password. However, if you did set a root password, then you will need to enter the root password when prompted in Ubuntu's Recovery Mode. If you have forgotten your root password, here is the work around:
  1. Insert an Ubuntu Install CD and boot into the command prompt.

  2. Type: rescue

  3. Follow the onscreen instructions to get into Terminal mode.

  4. When you are in the Terminal, type: passwd root

  5. Type in your new root password and re-type it when prompted.

  6. Next, you will need to create a new user account with root privileges. Type: adduser

  7. Enter your new user information when prompted.

  8. Next, type: adduser your_newuser_name admin (replace your_newuser_name with your actual new username). This enables you to login with your new username as admin and access all the system tools as root.

  9. Remove the Ubuntu Install CD and reboot by typing: reboot

  10. Login with your new user id and password.

No comments:

Post a Comment