Home Linux How to Reset Forgotten Root Password in Ubuntu Linux

How to Reset Forgotten Root Password in Ubuntu Linux

Statistics say that almost 25% of people usually forget their computer’s password within 14 days after a clean OS installation. So don’t panic if you can’t remember the root password of your Ubuntu Linux. Moreover, if you are a Linux system administrator, very often, you may get the forgotten password issue from your clients. Resetting the forgotten root password in Ubuntu Linux is not unethical when you need to enter the system. But of course, that doesn’t give you the right to break every computer and look inside the system. You can reset the root password of a Ubuntu Linux system without knowing the current password.

Resetting Password in Ubuntu Linux


In Ubuntu, the system’s root password is written inside the root directory of the Linux filesystem. The root password is essential because you can not log in inside the system without the password. Even, you can not assign any administrative tasks without knowing the root password. In this post, we will see how to reset the forgotten root password in Ubuntu Linux.

Step 1: Enter into Recovery Mode in Ubuntu Linux


To reset the Ubuntu root password, you need to restart your machine and go to the GNU GRand Unified Bootloader (GRUB) menu. You may need to find the boot menu hotkey for your system. Once the boot menu is opened, select “Advanced options for Ubuntu” and hit the Enter button. If you can’t find the boot menu from your system, make sure that the appropriate bootloader option is enabled from your BIOS settings.

advanced option for recovery

In this step, a new window will open, and you will see some drop-down menu for the recovery option. Select the generic recovery mode. In my case, I am selecting the “Ubuntu, with Linux 5.4.0-40- generic (recovery mode)“. You may notice that there are two options to reach the recovery mode. You can choose only one option according to your Linux kernel and direct-access storage device (DASD) version.

Reset Root Password in Ubuntu Linux XEL

Step 2: Access the root Directory of Ubuntu Linux Filesystem


After entering the recovery mode, some system checkups will happen. Then you will be able to see the recovery menu of your Ubuntu Linux. I should remind you that in recovery mode, you will get the read-only permission of the filesystem. But no worries, later we will see how to enable both read-write permissions.

Now, as we are going to reset the root password of our Ubuntu Linux system, so we have to select the root menu from the drop-down menu. Use the keyboard arrow keys to reach the root menu. Selecting the root menu will let us use a shell prompt. We will use the shell commands to reset our Ubuntu Linux password.

Reset Root Password in Ubuntu Linux root

Step 3: Recover Root Password in Ubuntu Linux


As we have got access to the shell command, now we can reset the Ubuntu root password through the command shell. Press the Enter button to continue the password resetting process. Now we have to mount, remount, and enable the read-write permission for the root filesystem.

After mounting the root filesystem, we will now type the password recovery command following by the system username. Here, my username is ubuntupit, you have to use your username. Then we will get an option to enter a new password. After entering the new password, retype the password for security purposes.

If everything is done successfully, you will be able to see a message saying: “Password updated successfully.” There you go! The process of resetting the root password of your Ubuntu Linux is done. Now, reboot your system to continue.

Final Reset Root Password in Ubuntu Linux EL

~# mount -n -o remount,rw / 
~# passwd ubuntupit
New password:
Retype new password:
passwd: password updated successfully
~# reboot

Finally, Insight


When you forget the root password of your Ubuntu Linux, you may think of deleting the operating system from your system and reinstalling the entire system. But why would you do that while you know the method of resetting the root password in Ubuntu Linux? In this post, I have covered the concept of where the root password is stored and how to reset the root password successfully in Ubuntu Linux through the recovery mode.

For the newcomers, Ubuntu is a very adaptable distro of Linux. You can apply much theoretical knowledge on Ubuntu to get the pragmatic thrill of Linux. If you find this post useful and convenient, please share this post on your social media. Also, you can write any observations regarding this post in the comment section.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Post

The 10 Best Raspberry Pi Stores Available in the Market

Raspberry Pi is the most discussed single-board computer nowadays, which is highly applied in the development of IoT. It...

How to Install Moodle Learning Platform in Ubuntu Linux

Modular Object-Oriented Dynamic Learning Platform, or in short, Moodle is one of the best online learning platforms for all...

The 20 Best Wallpaper Apps for Android Device in 2020

Mobile phones are the only thing that is almost always in our hands. After waking up from sleep, the...

The 20 Best Platform Games for Android Device in 2020

If we spend a few minutes thinking about the old games we loved in our children, no wonder we...

Most Talked Post

Most Stable Linux Distros: 5 versions of Linux We Recommend

At the very beginning, I would like to mention why the term ‘Stable’ comes in relation to Linux OS...

Linux or Windows: 25 Things You Must Know While Choosing The Best Platform

Choosing the best platform - Linux or Windows is complicated. Because both the system is versatile and capable of...

15 Best Things To Do After Installing Linux Mint 19 “Tara”

Linux Mint is one of the best Linux distros for newcomers, especially who comes from other Operating Systems like...

Linux Mint vs Ubuntu: 15 Facts To Know Before Choosing The Best One

Ubuntu and Linux Mint are two popular Linux distros available in the Linux community. Ubuntu is a derivative of...

You Might Also LikeRELATED
Recommended to you