You’ve probably sat in front of your Linux computer and entered the password you believe to be yours, only to be greeted by the dreaded message of “incorrect password.” This can be very disappointing if you are certain you entered it correctly last week. However, do not worry. You are not the only one in this position. There are ways to resolve a forgotten Linux password.
I’ll show you, with this easy-to-follow guide, the easiest ways to regain access without having to know a ton of terminal magic. Whether you have another computer with admin privileges or can boot from a USB drive, we will explore the easiest ways to get back to the data that matters to you. Here we go.
Why Linux Makes This a Little Different
Unlike Windows or macOS, most Linux distributions don’t have a built-in “Forgot Password?” button on the login screen. That’s because Linux prioritizes security and multi-user setups—your password protects your files and the entire system. But Linux is flexible, so there are straightforward ways to regain access.
Here are the best methods, starting with the simplest ones that most people can do without extra tools.
Method 1: Reset Using Another Admin Account (Completely Graphical – Easiest!)
f there’s at least one admin account (with sudo rights), you can reset a forgotten password for any other user entirely through the GUI—no terminal, reboot, or USB needed.
Short & simple steps:
- Log in to the admin account.
- Open Settings (Ubuntu/Pop!_OS: top-right → Settings; Mint: Menu → Preferences → Users and Groups; Fedora: Activities → Settings → Users).
- Go to Users or Accounts.
- Select the locked/forgotten user account.
- Unlock the panel (enter the admin password if prompted).
- Click the Password field (or Change button).
- Enter a new password twice (add a hint if desired).
- Click Change or Apply.
- Log out and log in to the affected account with the new password.
Pro tip: If you only have one account right now, create a second admin account (even a basic one) for emergencies like this. It takes less than a minute to set up in the same Users settings.
Method 2: Using the Graphical Recovery Menu (Minimal Terminal)
Reset forgotten password in recovery mode (Ubuntu, Mint, Fedora, etc.):
- Restart your computer.
- Hold Shift (or Esc on some machines) during boot until the GRUB menu appears.
- Select Advanced options → the (recovery mode) entry → press Enter.
- In the recovery menu, choose root – Drop to root shell prompt → Enter.
- At the prompt, type: mount -o remount,rw / → Enter (makes the filesystem writable)
- Then type: passwd yourusername → Enter (replace “yourusername” with your actual login name)
- Enter new password twice (it won’t show as you type).
- Type: exit → Enter.
- Select resume – Resume normal boot → Enter.
Method 3: Using a Live USB (Mostly Graphical)
- On a working computer, download Ubuntu ISO from ubuntu.com (free).
- Create bootable USB:
- Windows: Use Rufus (select ISO & USB).
- Mac/Linux: Use built-in tools or dd command.
- Insert USB into locked machine & restart.
- Enter BIOS/UEFI (tap F2/F10/F12/Del/Esc during boot—check screen for key).
- Set USB as first boot device, save & exit.
- At Ubuntu menu, select Try Ubuntu.
- On live desktop, open File Manager—your hard drive appears in sidebar. Click to mount (password often blank).
- Open Terminal: type sudo nautilus → Enter (blank password for live session).
- In root file manager, go to mounted drive → etc → right-click shadow → Open with Text Editor.
- Find line starting with your username (e.g., john:$6$…). Delete text between first & second colon (becomes john::).
- Save (Ctrl+S) & close.
- Shut down, remove USB, boot normally.
- Log in with blank password.
- Go to Settings → Users → set new password via GUI.
Done! Data safe. Pro tip: Create a second admin account for future ease.
Extra Tips to Avoid This in the Future
In case, you’ve reset your password and want to avoid this headache ever again, here are a few simple, human-friendly tips to keep things safe and easy:
- Use a password manager. Download FastestPass. Store all your passwords there. You only need to remember one master password—the rest are auto-filled and super strong. No more forgetting logins.
- Turn on automatic login (if it’s your home computer). Go to Settings → Users → Automatic Login, and enable it for your main account. This way, your computer boots straight to your desktop without asking for a password every time. (Just be careful if anyone else uses the house.)
- Create a second admin account. Right now, while everything is working: Settings → Users → Add User → Make it an Administrator account. Give it a simple name like “Backup” or “Emergency” and a password you won’t forget. This is your lifeline next time something goes wrong.
- Write down your main password. Put it on paper and store it somewhere safe (a drawer, safe, or trusted person’s house). Never save it on the computer or in a photo on your phone.
Final Thoughts
Resetting a forgotten Linux password is much easier than it looks. If you have a second admin account, it’s all point-and-click: log in there, go to Settings > Users, unlock the locked account, and reset the password in a few clicks. If there’s only one account, try recovery mode first—just hold Shift (or Esc) during boot, pick the recovery option, and type a couple of simple commands to change it.
If that doesn’t work, boot from a live Ubuntu USB, mount your drive, use one quick command to open a file manager with admin rights, edit the shadow file to clear the password, and log in blank—then set a new password right away. Once you’ve done it once, it all makes sense, and you’ll feel way more in control of your Linux machine.
Generate passkeys, store them in vaults, and safeguard sensitive data! Receive the latest updates, trending posts, new package deals,and more from FastestPass via our email newsletter.
By subscribing to FastestPass, you agree to receive the latest cybersecurity news, tips, product updates, and admin resources. You also agree to FastestPass' Privacy Policy.
Secure and Create Stronger Passwords Now!
Subscribe to Our Newsletter