HomeHow-to GuidesHow to Reset a Forgotten Ubuntu Password (Recovery Mode)

How to Reset a Forgotten Ubuntu Password (Recovery Mode)

Reset Forgotten Ubuntu passwordForgot your Ubuntu login password? You’re not alone. It’s one of the most common problems, especially on a computer you haven’t used for a while or right after changing your password. I’ve done it myself on one of my systems. Fortunately, resetting a forgotten Ubuntu password is easy using recovery mode, and you won’t lose any data.

How to Reset a Forgotten Ubuntu Password

1. Restart your computer. As it starts, hold the Shift key (on older BIOS computers) or press Esc repeatedly (on UEFI computers) to open the GRUB boot menu. If you have more than one operating system installed, the GRUB menu may appear automatically.

2. Select Advanced options for Ubuntu, then select the entry that ends with (recovery mode) and press Enter.

Select “recovery mode” from the menu

3. In the Recovery Menu, select root (Drop to root shell prompt) and press Enter. Press Enter again if asked. You’ll now see a root command prompt.

Select “Drop to root shell prompt.”

4. The disk is mounted as read-only in recovery mode, so remount it with write access, so that your new password can be saved:

mount -o remount,rw /

5. If you’ve forgotten your username as well, list the user folders with:

ls /home

6. Reset the password by typing passwd followed by your username. For example, for the user kroshan:

passwd kroshan

Type the new password twice when asked (nothing appears on the screen while you type; that’s normal). You’ll see the message password updated successfully.

change password

7. Restart the computer:

reboot

You can now log in with your new password.

Note: If your home folder is encrypted, or you use a keyring for saved passwords, you may be asked for your old password to unlock the keyring after logging in. In that case, you can create a new keyring. Also, anyone with physical access to a computer can use this method, so protect sensitive data with full-disk encryption.

Roshan Karkera
Roshan Karkera
Roshan Karkera is a passionate blogger and a software engineer by profession, driven by a love for technology, science, and continuous learning. With a strong belief in sharing knowledge, he started this blog to inspire and inform readers through simple, insightful content. When he's not coding or exploring the latest in tech, you’ll find him writing about ideas that matter. Connect with him on Twitter or your favorite social platform to stay updated.
RELATED ARTICLES

1 COMMENT

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular