How to reset lost administrator password in Ubuntu or Linux Mint

If you have forgotten the administrator account password of Ubuntu or Linux Mint system, don’t worry, setting a new password is very easy and does not require any other tools.
The steps to recover the administrator password are similar to Ubuntu and Linux Mint, the only difference is that under step 2, the options you need to select mention Ubuntu and Linux Mint respectively, depending on whether you are using both. This should also apply to any Ubuntu or Linux Mint version (Xubuntu, Kubuntu, Ubuntu MATE, etc.).
Step 1. To start the process of setting a new administrator password, boot (or reboot) the Ubuntu or Linux Mint computer and press and hold Shift The key at startup.
If the system is a VirtualBox computer, make sure to click it as soon as the computer window starts, then hold down Shift key. If you do not click inside the computer as soon as possible, the virtual machine will ignore the keystrokes.
Step 2. From the GRUB menu, select Advanced options for Ubuntu (Said here Linux Mint Instead of Ubuntu, for users using Mint), then press Enter key:On older Ubuntu/Linux Mint versions, you may not have Advanced options Menu items, but directly recovery mode Option, so you can skip this step in this case (go to step 3).
Step 3. In Advanced options, Select recovery mode By using GRUB menu item (Down arrow) key, as shown below:Ubuntu GRUB recovery mode

Step 4. From Recovery Menu, Press (Down arrow) key selection root (Drop to root shell prompt) Option and press Enter (You may need to press Enter Key twice):Ubuntu put into root shell prompt

You should now see the root prompt (similar to [email protected]:~#).
Step 5. Since the file system is read-only, let us remount it with write permission by entering the following command:

mount -o rw,remount /

Step 6. Now, we can reset the administrator account password. Type this command (replace linuxuprising And the user name whose password you want to change) to change the password:

passwd linuxuprising

You will be prompted to enter a new password, then enter it again to confirm. Please note that you will not see the password when you type it on the command line.
These are the final steps in the screenshot:Reset administrator password Ubuntu Linux Mint

Changing the administrator password is complete. Run over sync Command to ensure that data is written to disk before rebooting, and then reboot the system:


You should now be able to log in using the new administrator password on Ubuntu or Linux Mint systems.