Locked out of Ubuntu and staring at a login prompt that won’t accept anything you type? An ubuntu forgot password situation has two reliable fixes, both of which work on every supported Ubuntu release in 2026. One uses the built-in recovery menu and takes under five minutes. The other needs a live USB and works when the recovery menu is hidden or broken.

What You Need Before Resetting Your Ubuntu Password

Both methods need physical access to the machine. The recovery route uses nothing else. The live USB route requires a spare USB stick and a second working computer to write the ISO to it.

ItemMethod 1Method 2
Physical access to the PCYesYes
USB drive (4GB or larger)NoYes
Second working computerNoYes
Ubuntu ISO fileNoYes

Ubuntu now powers around 13.7% of identifiable Linux web servers, so the same recovery steps apply whether you’re on a laptop, workstation, or cloud VM with console access.

Method 1: Reset Ubuntu Forgot Password Through Recovery Mode

This is the path most people should try first. No extra hardware, no ISO download.

Step 1: Open the GRUB Menu

Shut the machine down completely. Power it back on and hold the Shift key as it starts. On UEFI hardware, press Esc instead. The GRUB boot menu will appear.

Use the arrow keys to pick Advanced options for Ubuntu, then highlight the entry that includes (recovery mode) and press Enter.

Step 2: Drop to a Root Shell

The recovery menu lists several actions. Pick root – Drop to root shell prompt. You’ll see a hash prompt at the bottom of the screen. The filesystem is mounted read-only at this point, so you can’t change anything yet.

Remount it with write access:

mount -o remount,rw /

Step 3: Reset the Password with passwd

If you don’t remember the username, list the home directories first:

ls /home

Then run the password command for that user:

passwd your-username

Type the new password twice. The terminal won’t show characters as you type — that’s normal. Once it confirms the update, reboot:

exec /sbin/init

You’ll land at the login screen. Sign in with the new password.

When Recovery Mode Doesn’t Show Up

Some installations hide GRUB. Hold Shift earlier in the boot process, before the manufacturer logo clears. If that fails, the GRUB menu may have been disabled in /etc/default/grub — in which case Method 2 is the way forward.

Method 2: Use a Live USB to Fix Ubuntu Forgot Password

This works on every Ubuntu version, including encrypted setups (with the passphrase) and machines where recovery mode was stripped out.

Step 1: Create the Bootable USB

On a working computer, download the latest Ubuntu Desktop ISO from ubuntu.com. Write it to a USB drive with Rufus on Windows, Etcher on macOS, or Startup Disk Creator on another Linux machine. Anyone setting up Ubuntu fresh will already be familiar with this process.

Step 2: Boot the Locked Machine from USB

Plug the USB into the locked machine. Power it on and press the boot menu key — usually F12, F10, or Esc depending on the manufacturer. Pick the USB drive from the list.

When the Ubuntu welcome screen appears, choose Try Ubuntu without installing.

Step 3: Mount the Internal Disk

Open a terminal with Ctrl+Alt+T and list the partitions:

sudo fdisk -l

Find the largest ext4 partition — that’s almost always your root partition. The identifier looks like /dev/sda2 or /dev/nvme0n1p2. Mount it:

sudo mount /dev/sdXY /mnt

Replace /dev/sdXY with the actual identifier from your output.

Step 4: Chroot and Reset

Switch into the mounted system:

sudo chroot /mnt

Now you’re operating as root inside your installed Ubuntu. Reset the password:

passwd your-username

Type the new password twice. When done:

exit
sudo umount /mnt

Pull the USB out and reboot. Sign in with the new password.

Method Comparison: Which One to Pick

Time to Complete Each Method (minutes)
Recovery Mode
~4 min
Live USB (with USB ready)
~10 min
Live USB (from scratch)
~18 min
FactorRecovery ModeLive USB
DifficultyBeginnerIntermediate
Works if GRUB is hiddenNoYes
Works on encrypted disksYesYes (with passphrase)
Risk of data lossVery lowVery low

Fixing the Keyring Error After Ubuntu Forgot Password Reset

Once you log in with the new password, Chrome or other apps may throw a keyring unlock error. The keyring was tied to your old password and didn’t get updated when you reset.

Open the Passwords and Keys application (also called seahorse). Right-click the Login keyring and pick Change Password. Enter the old password, leave the new one blank or set it to your new login password. The error stops appearing after that.

Securing Your Account After Ubuntu Forgot Password Recovery

The same physical access that just helped you also helps anyone else with hands on your hardware. A few habits cut that risk down.

Pick a password with mixed case, digits, and symbols, but make it long enough to remember without writing on a sticky note. Twelve characters of a phrase you actually recall beats eight random characters you’ll forget in two weeks.

Turn on full-disk encryption when you reinstall. LUKS is built into the Ubuntu installer and stops the live USB trick cold — without the passphrase, the disk reads as random data. Reviewing what services run at boot also helps you spot anything that shouldn’t be there after a reset.

How to Avoid Ubuntu Forgot Password Lockouts in the Future

A password manager handles this completely. KeePassXC, Bitwarden, and 1Password all run on Ubuntu and store credentials behind one master phrase. You only have to remember the master.

If you’d rather not run a manager, write a hint that means something to you and keep it somewhere physical — not a sticky note on the laptop, but a notebook in a drawer. Set a recovery email on your Ubuntu One account if you use one.

For servers and headless machines, key-based SSH login removes the password from the daily login flow entirely. Keep your system patched and boot services lean so recovery mode stays available when you need it.

Does Easy Password Reset Make Ubuntu Insecure?

The short answer: not really, because the threat model assumes physical access. Anyone sitting at your keyboard with a live USB can already read every unencrypted file on the disk, password or not. The reset is just a faster way to do what they could already do.

The fix is full-disk encryption, not blocking password resets. With LUKS active, the live USB sees encrypted blocks and the recovery shell can’t mount the partition without the passphrase. Ubuntu also ships with the root account locked by default — the first user gets sudo, but that’s not the same as root, which is part of why Linux holds 44.8% of the server OS market in security-sensitive deployments.

FAQs

How do I reset my Ubuntu password without the recovery mode?

Boot from an Ubuntu live USB, mount your root partition with sudo mount /dev/sdXY /mnt, run sudo chroot /mnt, then use passwd username to set a new password. Unmount and reboot.

Why doesn’t my new Ubuntu password work after reset?

Two common causes: the filesystem stayed read-only during the reset, or you typed a different password the second time. Run mount -o remount,rw / first, then redo passwd username carefully.

Can I reset the Ubuntu password without losing my files?

Yes. Both the recovery mode and live USB methods only change the password file. Your home directory, applications, and settings stay intact. No data gets deleted during a password reset.

Does ubuntu forgot password reset work on encrypted drives?

Only if you have the LUKS passphrase. The disk encryption sits below the user password, so live USB recovery requires unlocking the encrypted volume first. Without the passphrase, the data is unreadable.

How do I find my Ubuntu username if I forgot it?

From the recovery root shell or chroot, run ls /home to list user folders. Each folder name matches a username. You can also check cat /etc/passwd for accounts that have a real shell assigned.

Willie has over 15 years of experience in Linux system administration and DevOps. After managing infrastructure for startups and enterprises alike, he founded Command Linux to share the practical knowledge he wished he had when starting out. He oversees content strategy and contributes guides on server management, automation, and security.