If you forget your password for your Ubuntu account, there is a way to reset it using Recovery Mode.

To start Recovery Mode, press the Shift key (for Ubuntu 9.10 and later) or the Esc key (for Ubuntu versions earlier than 9.10) while your computer is booting. The GNU GRUB menu displays. Using the arrow keys, choose the second option, or the “(recovery mode)” option. Press Enter to select the option.

GRUB menu for Ubuntu

The Recovery Menu displays. Use the arrow keys again to choose the “root” option and press Enter to select it.

Recovery Menu for Ubuntu

You will not see a normal login screen. Instead, you will see a root terminal prompt that looks something like:

root@something:~#

Type the following command at the prompt to reset the password for your account and press Enter.

# passwd username

Replace “username” with your username.

Root prompt

Ubuntu prompts you for a new password. Enter your desired password, press Enter and then type your password again, pressing Enter again once you are done. Ubuntu asks for your password twice to make sure you did not make a mistake while typing it the first time.

NOTE: Try to choose a secure password but one you can remember. There are options for storing password that are secure. We mentioned two ideas for storing password securely in our post, Two Free Methods for Generating Strong, Secure Passwords.

Entering the

To return to the normal system environment, Type the following command at the prompt and press Enter.

# init 2

Entering the

The above command does not actually open the graphical Gnome environment directly. You are first asked for your login information. Enter your username at the login prompt and then enter your new password at the Password prompt.

Once you log in, you have one more step to return to the familiar graphical Gnome desktop environment. Type the following command to start X Windows environment, or the Gnome desktop.

$ startx

Logging in and starting the Gnome session

You are returned to the Gnome desktop and you can continue using and enjoying Ubuntu.

by Lori Kaufman