Published on

Ubuntu Password Reset

Authors

1. Boot into Recovery Mode

  1. Restart your computer.
  2. As the system boots, hold down the Shift key (or press Esc repeatedly on UEFI systems) to access the GRUB menu.
  3. In the GRUB menu, select the option labeled Advanced options for Ubuntu.
  4. From the submenu, select a kernel with (recovery mode) appended.

2. Access the Root Shell

  1. When the recovery menu appears, select root - Drop to root shell prompt.
  2. You’ll be prompted with a command-line interface as the root user.

3. Remount the File System with Write Permissions

The root filesystem is mounted as read-only in recovery mode. To change it to read-write, enter:

mount -o remount,rw /

4. Reset Your Password

To reset the password for a user account, type:

passwd username

Replace username with your actual username. You’ll be prompted to enter a new password.

5. Update Permissions (if needed)

If you encounter permission issues, update file permissions with:

chmod 640 /etc/shadow

6. Reboot the System

Once done, reboot the system:

reboot

Tips:

  • If the above fails due to encryption or other security settings, you might need additional troubleshooting.
  • Always ensure you remember your passwords or have a recovery mechanism in place.