How To Reset Lost Administrator Password In Ubuntu Or Linux Mint
If you forgot the administrator account password for your Ubuntu or Linux Mint system, don't worry, it's quite easy to set a new password and you don't need any extra tools to do it.
The steps of recovering the admin password are similar for Ubuntu and Linux Mint, the only difference being that under step 2, the option you need to select mentions Ubuntu, respectively Linux Mint, depending on which one of the two you're using. This should also work on any Ubuntu or Linux Mint flavor (Xubuntu, Kubuntu, Ubuntu MATE, and so on).
Step 1. To start the process of setting a new admin password, boot (or reboot) the Ubuntu or Linux Mint machine and hold down the
If the system is a VirtualBox machine, make sure to click inside the machine window as soon as it starts, then hold the
Step 2. From the GRUB menu, select
On older Ubuntu / Linux Mint versions, you may not have the
Step 3. In
Step 4. From the
You should now see the root prompt (something like
Step 5. Since the filesystem is read-only, let's remount it with write permissions by typing this command:
Step 6. We can now reset the administrator account password. Type this command (replacing
You'll be prompted to enter a new password, and then type it again to confirm it. Note that you won't be able to see the password while typing it on the command line.
Here are these last steps in a screenshot:
You're done with changing the administrator password. Run the
Now you should be able to log in using the new administrator password on your Ubuntu or Linux Mint system.
The steps of recovering the admin password are similar for Ubuntu and Linux Mint, the only difference being that under step 2, the option you need to select mentions Ubuntu, respectively Linux Mint, depending on which one of the two you're using. This should also work on any Ubuntu or Linux Mint flavor (Xubuntu, Kubuntu, Ubuntu MATE, and so on).
Step 1. To start the process of setting a new admin password, boot (or reboot) the Ubuntu or Linux Mint machine and hold down the
Shift
key when it boots up.If the system is a VirtualBox machine, make sure to click inside the machine window as soon as it starts, then hold the
Shift
key. Without clicking inside the machine early on, key presses are ignored by the virtual machine.Step 2. From the GRUB menu, select
Advanced options for Ubuntu
(here it says Linux Mint
instead of Ubuntu, for those of you using Mint) and press the Enter
key:On older Ubuntu / Linux Mint versions, you may not have the
Advanced options
menu entry, but directly the recovery mode
option, so you can skip this step in that case (go to step 3).Step 3. In
Advanced options
, select the recovery mode
GRUB menu entry by using the ↓
(down arrow) key, like this:Step 4. From the
Recovery Menu
, press the ↓
(down arrow) key to select the root (Drop to root shell prompt)
option, then press Enter
(you may need to press the Enter
key twice):You should now see the root prompt (something like
root@linuxuprising:~#
).Step 5. Since the filesystem is read-only, let's remount it with write permissions by typing this command:
mount -o rw,remount /
Step 6. We can now reset the administrator account password. Type this command (replacing
linuxuprising
with the username for which you want to change the password) to change the password:passwd linuxuprising
You'll be prompted to enter a new password, and then type it again to confirm it. Note that you won't be able to see the password while typing it on the command line.
Here are these last steps in a screenshot:
You're done with changing the administrator password. Run the
sync
command to make sure the data is written to disk before rebooting, and then reboot the system:sync
reboot
Now you should be able to log in using the new administrator password on your Ubuntu or Linux Mint system.