Changing a Forgotten Password in Linux Mint

I created a Linux Mint virtual machine for some testing then mothballed it, returning to it months later. I followed security best practices for the main user account password:

  • I used a unique, complex password.
  • I didn’t write the password down.
  • I didn’t share the password with anyone.
  • I forgot the password.

It’s very secure.

So, here’s a password “recovery” procedure that works with Mint (and may also work with other distributions):

  • Reboot the computer and hold down the SHIFT key as the boot process starts. This should load the GRUB boot menu.
  • Select your Linux installation.
  • Press the E key to edit.
  • Use the Arrow keys to navigate to a line that looks similar to this:

linux /boot/vmlinuz-[kernel version]-generic root=UUID=[letters and numbers][letters and numbers] ro quiet splash vt.handoff=7

Change:

ro quiet splash vt.handoff=7

to:

rw init=/bin/bash

so it now reads:

linux /boot/vmlinuz-[kernel version]-generic root=UUID=[letters and numbers][letters and numbers] rw init=/bin/bash

  • Press F10 to boot your system.
  • Your system will boot up into a root shell with no password.
  • Set your new password by entering:

passwd [your-user-name]

Note: if you have also forgotten your username, type:

cat /etc/passwd

…first to get a list of all defined users.

  • Set your new password.
  • Restart your system.

© mylevel4cache.com, 2019. Unauthorized use and/or duplication of this material without express and written permission from this site’s author and/or owner is strictly prohibited. Excerpts and links may be used, provided that full and clear credit is given to mylevel4cache.com with appropriate and specific direction to the original content.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s