Reset a Forgotten Root Password in Linux Ubuntu

10-Feb-2023

.

Admin

Reset a Forgotten Root Password in Linux Ubuntu

Hi Guys,

This article will give you example of How to Reset or Change the Root Password in Linux. step by step explain Changing the Root Password for Linux. you'll learn Reset the Root Password on Ubuntu. if you have question about Easily Reset Forgotten in Password Ubuntu Linux then I will give simple example with solution. Alright, let’s dive into the steps.

You can use this post for ubuntu 14.04, ubuntu 16.04, ubuntu 18.4, ubuntu 20.04, ubuntu 21 and ubuntu 22.04 versions.

Step 1: Open Terminal


Alternately, you can click Menu > Applications > Accessories > Terminal.

Step 2: Became a Root User

You can use the sudo su or sudo -i commands and input the user password to temporarily switch to the root account in the current login session:

sudo su -

To ensure that the user has been changed, use the whoami command:

whoami

Output:

root

Step 3: Set the Root User Password

Although the root user has been disabled, this does not imply that the root account has been deleted. Because the root account has no password, logging in as root is not feasible.

sudo passwd root

The new root password will be required to be entered and confirmed.

Step 4: Verify Root User New Password

Test it your root password by typing the following command:

su -

#Ubuntu