Share your love
Reset Root Password on Ubuntu 20.04 with Easy Steps

In this guide, you will learn How To Reset Root Password on Ubuntu 20.04. In Linux, root privileges (or root access) refer to a user account that has full access to all files, applications, and system functions.
However, what if the superuser (or root user) loses his/her password? They will have to recover the lost password before booting into the login screen. This allows any malicious user with physical access to your Linux host to gain complete ownership. This article on the Orcacore website takes a look at how to recover a lost root password on Ubuntu 20.04.
Table of Contents
Steps To Reset Root Password on Ubuntu 20.04
In this guide, we will show you how to reset the Lost Root Password from the Grub Menu on Ubuntu 20.04. Follow the steps below to complete this guide.
1. Reset Root Password from Ubuntu Grub Menu
First, you need to restart your system, and while doing that, press and hold the Shift key on your Keyboard. This will drop you into the Grub menu of Ubuntu 20.04.
Next, you need to press the ‘e’ key on your keyboard. This will let you edit the Grub’s boot prompt. Don’t touch or delete anything here. Once you have the editor, move to the next step.
At this point, use your arrow key and move to the end of the line starting with “Linux“. There is at the end of this line type rw init=/bin/bash.
rw init=/bin/bash

After adding the syntax, boot your system with this configuration. To do this, you can use Ctrl+X or F10.
2. Ubuntu Root Shell Access Without Password
At this point, without providing any password, you will have Ubuntu’s shell with root access. First, let’s check whether your user has read and write access to the file system where the OS has been installed.
To do this, run the following command:
mount | grep -w /
If you see (rw,realtime) in your output, it means you have real-time read and write access to the file system.
3. Change Root Password on Ubuntu 20.04
Now you can simply change your root password with the following command:
passwd
The system will prompt you to add a new password twice.
To change the password of a user other than root, we have to mention the username of the same. The syntax is like the following command:
passwd username
When you are done resetting your Linux password, restart your system to log in with the changed password. For rebooting, run the command below:
exec /sbin/init
After that, hit the Enter key.
From here, you can log in and access your system with the newly set root password.
Conclusion
At this point, you have learned to Reset Root Password on Ubuntu 20.04. Resetting the root password on Ubuntu 20.04 allows you to regain access to your system if it’s lost. It involves booting into recovery mode, accessing the root shell, and setting a new password using the passwd command.
Hope you enjoy it. Please subscribe to us on Facebook, Instagram, and YouTube.
You may also like these articles:
Install and Use Podman on Ubuntu 20.04
Install and Configure Django on Ubuntu 20.04
How To Install and Use Cockpit on Ubuntu 20.04
Install and Configure XAMPP on Ubuntu 20.04