Forgotten password: how to recover from this in Ubuntu, Linux Mint or Debian

Back to the home page

You can't retrieve a forgotten or lost password, but you can set a new one ("change" the old password). It's not simple, because of security concerns. But if you follow the instructions below carefully, it shouldn't be hard to do.

Note: don't use this method when you've encrypted your home directory or your entire system! Because then it will remain inaccessible. This method is only meant for the normal situation, in which nothing has been encrypted.

1. First you do a one-time hack of the boot menu of Grub.

If you never get to see the Grub menu, you can make the Grub menu visible when you turn on your computer, by pressing the Shift key immediately after the BIOS screen disappears, and keeping it pressed. Usually it's the left Shift key, but sometimes it's the right Shift key.

2. Normally the boot line of Linux Mint or Ubuntu is highlighted; if not, make it so.

Press the e key to edit this boot line.

3. Now look for the following line in the text that you see:

linux /boot/vmlinuz-(...much text omitted...) ro quiet splash $vt_handoff

Move the cursor to the end of that line (use the arrow keys for that) and delete:

ro quiet splash $vt_handoff

Replace the deleted text by this:

rw init=/bin/bash

The line should therefore become like this:

linux /boot/vmlinuz-(...much text omitted...) rw init=/bin/bash

4. Press F10 or use the key combination 'Ctrl x'. With that, you'll boot your computer with the altered boot line.

5. Now wait a while: Ubuntu or Linux Mint will boot without a graphical user interface. You'll end up with a "bare" terminal with a lot of text, of which the bottom line looks like this:

root@(none) / #

6. Now check the existing user accounts on the system. Type:

ls /home

(the first letter is a small L)

Press Enter. You'll see a list of the user accounts. Note that there are no capital letters in their names.

7. Then type:

passwd your_own_username (for example: passwd john)

press Enter.

Now you should be able to enter your new password ("Enter new UNIX password").

Note: don't use spaces or accents in your new password and don't use special characters that might vary with different keyboard layouts. Keep it simple and foolproof: use only letters and figures.

Note (2): when you type your new password, it remains invisible. Not even asterisks will show, which is normal. In this window it's being called a Unix password: Linux's roots are becoming visible!

8. Press the key combination Ctrl Alt Delete in order to reboot.

You're done! Now you can log in with your new password.

Want more tips?

Do you want more tips and tweaks for Linux Mint or Ubuntu? There's a lot more of them on this website!

To the content of this website applies a Creative Commons license.

Back to the home page


This website is being sponsored by Google Ads.

Are you using an ad blocker? Then you're also blocking my earnings from advertisements....

If you wish to support my website, you can configure your ad blocker to make an exception for this website.

Thanks in advance....