ServicesAboutGet Started
LinuxUbuntuLinux Mint

Resetting a Lost Admin Password on Ubuntu / Linux Mint

Recover sudo access on an Ubuntu or Linux Mint system when the admin password has been lost — no boot disk required.

If your IT department or MSP is doing things right, then the user account that you log in to a computer with will not have administrative access.

In the Linux ecosystem this means you cannot execute the sudo command or log in as root.

Normally an account other than the one you use day to day is made with sudo rights that is only used as needed. If the password for this account is lost, then there is no longer a way to administer the computer.

In the Windows world, you shutdown the system and then boot to a specially crafted USB boot disk that you can read the Windows information and then reset the admin password.

For Ubuntu / Linux Mint, you simply need to reboot and interrupt the normal grub boot sequence to get into single user mode.

💡

Note: This guide assumes that you have physical access to the computer. This is also why physical access to you equipment means no security for the data on it, Windows, Linux, Mac or anything else.


Steps

  1. Reboot the system. As soon as it powers back on, begin tapping the ESC key.

    💡

    Technically, we are only wanting to stop grub from automatically booting. But with modern SSD or NVMe drives, this can go by so fast you never knew it was available to interrupt.

  2. The first grub entry should be highlighted by default and is normally the one you want. Press e to edit that entry.

  3. Find the line beginning with linux.

  4. Go to the end of the line and add init=/bin/bash.

  5. Press F10 to boot to this modified file without permanently saving it.

  6. The system will boot to a command prompt similar to root@(none):/#.

  7. Enter mount -o remount,rw / and press Enter.

  8. Now you can reset the admin account password with the passwd command: passwd YOURADMINNAME.

  9. Enter the new password, then again to confirm it.

  10. Type exit and then use the power button to reboot the computer.