RackNerd Billboard Banner

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

  1. Restart your computer.
  2. As soon as your PC begins to boot, hold the Shift key (for BIOS) or tap Esc (for UEFI) to bring up the GRUB boot menu.

Step 2: Edit Boot Options

  1. Use the arrow keys to highlight the default Ubuntu boot entry.
  2. Press e to edit the boot commands.
  3. Find the line that starts with linux—it will look something like this:
    linux /boot/vmlinuz-... root=UUID=... ro quiet splash
  4. Change the ro quiet splash part to rw init=/bin/bash so it looks like:
    linux /boot/vmlinuz-... root=UUID=... rw init=/bin/bash

Step 3: Boot Into Root Shell

  1. Press Ctrl + X or F10 to boot with these settings.
  2. Your system will now boot into a root shell prompt, bypassing the normal login screen.

Step 4: Reset the Password

  1. Type the following command, replacing username with your actual username:
    passwd username
  2. 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

  1. After resetting the password, type:
    exec /sbin/init
    or just hold the power button to reboot.
  2. 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!

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
RackNerd Billboard Banner
© 2025 Computer Everywhere
Your Everyday Guide to the Digital World.
Terms of Service | Privacy Policy
Copy link