How to Change Root Password in Ubuntu Linux?

Jun 27, 2022 . Admin

Hi Guys,

I will explain step by step tutorial Change your password. I would like to share with you Changing and resetting the root password. this example will help you Change root or user password in Ubuntu. we will help you to give example of Can't change root password in Ubuntu. Here, Creating a basic example of Reset or Change User or Root Password in Ubuntu.

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:



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 -