Your cart is currently empty!
How to Quickly Reset a Forgotten Password on Ubuntu
Forgetting your Ubuntu password can stop your day cold, but resetting it is easier than you might think. Here’s a simple, step-by-step guide to get you back in without reinstalling or losing your files.
Step 1: Reboot and Access the GRUB Menu
- Restart your computer.
- As soon as your PC begins to boot, hold the
Shift
key (for BIOS) or tapEsc
(for UEFI) to bring up the GRUB boot menu.
Step 2: Edit Boot Options
- Use the arrow keys to highlight the default Ubuntu boot entry.
- Press
e
to edit the boot commands. - Find the line that starts with
linux
—it will look something like this:linux /boot/vmlinuz-... root=UUID=... ro quiet splash
- Change the
ro quiet splash
part torw init=/bin/bash
so it looks like:linux /boot/vmlinuz-... root=UUID=... rw init=/bin/bash
Step 3: Boot Into Root Shell
- Press
Ctrl
+X
orF10
to boot with these settings. - Your system will now boot into a root shell prompt, bypassing the normal login screen.
Step 4: Reset the Password
- Type the following command, replacing
username
with your actual username:passwd username
- Enter a new password when prompted. Type it again to confirm. (If you’re not sure of your username, type
ls /home
to list user folders.)
Step 5: Reboot
- After resetting the password, type:
exec /sbin/init
or just hold the power button to reboot. - Log in using your new password.
Tips & Precautions
- For encrypted home folders: This process won’t work if your home directory is encrypted and you’ve lost the encryption passphrase.
- Don’t forget: This method gives you root access—use it responsibly. Anyone with physical access to your machine can do this, so keep your device secure.
- For servers: If you’re working with a remote server, you’ll need physical access or console access via your hosting provider.
Getting locked out of Ubuntu is frustrating, but you’re only a few commands away from getting back in. Bookmark this guide so you always have a way back into your system!
Tech enthusiast and content creator passionate about making technology simple for everyone. I share practical tips, guides, and reviews on the latest in computers, software, and gadgets. Let’s explore the digital world together!