Linux Commands Ubuntu

How to Change Root Password in Linux/Ubuntu Root?

Ubuntu is a Multi-user Operating system and changing the Root password occasionally helps the administrator avoid any unauthorized access to the Ubuntu System. As the Root has complete access to the Ubuntu Operating system, any unauthorized access to the system may lead to a data breach and has to be avoided.

In this article, we will explain multiple approaches to change the Sudo User or Root password in Ubuntu.

How to Change Root Password in Linux/Ubuntu Root?

Changing the Root Password at times is useful for the overall security of Ubuntu Systems. Root Password can be changed either by using the GUI or the Terminal. Both methods for changing the root password are discussed below.

Method 1: Change the Root Password in Ubuntu Using the Terminal

The Root Password in Ubuntu can be changed easily using the “passwd” command in Terminal. The following steps explain the method to change the sudo user password or root password.

Step 1: Open Terminal

To start Terminal using the GUI, navigate to the “Show Applications” Menu by clicking on the “Applications Menu” icon:

Once you are in the Applications Menu, look for the Search Bar on top of the Menu. Click on it and type “terminal”. The Terminal Application will appear:

Click on the terminal icon to start it:

You can also open the terminal directly by pressing the “ctrl+alt+t” shortcut keys:

Step 2: Change Root Password

In the terminal, run the “passwd” Command to change the Root Password. The “passwd” command changes the user password. In our case, the user is root:

sudo passwd root

The command line will ask for a new password:

Once you enter the password, it will confirm by asking you to retype the password:

Enter the same password that you provided earlier and hit “Enter”. The root password will be updated successfully:

Step 3: Verify the Change

To verify whether the new password was updated or not, use the “sudo” command with the “-i” flag to log in as the root user in the terminal:

sudo -i

The Terminal will ask for the password, add the updated password and hit Enter:

The terminal command line will change to “root” indicating the root user is logged in and the password was changed:

To log out of the root user, use the “exit” command:


The root user will log out and the log out will be confirmed in the terminal:

This is how you can change the Root Password from the Terminal.

Method 2: Change the Root Password in Ubuntu using the GUI

The User Account Password can also be changed using the GUI. Open the “Show Applications” Menu by clicking on the “Show Applications” icon:

In the Menu, click on the “Settings” icon:

The Settings Menu will appear. Click on the “Users” Option from the left navigation bar:

The User Menu will appear:

In the User Details Menu, click on the Password Option inside the “Authentication & Login” Settings:

A new dialogue box will appear having the “Change Password” Settings:

To change the password, click on the Current Password Input Box and type in the Current Root Password:

The “tick” icon inside the Text Box confirms the correct password pattern:

Now enter the “New Password”. Ensure that you use a mixture of characters that follow the password pattern for better security. The bar below highlights the strength of your password:

Once you have entered the password, click on the “Change” button to apply the changes and your password changes:

The dialogue box will close meaning the root password was changed successfully.


The Root Password can be changed either using the Terminal or the GUI. The “passwd” command changes the sudo user or root password in Terminal. Using the GUI, the root password is changed in the Account Settings. This article discusses both methods for converting the password of sudo user or root in Ubuntu.


Similar Posts