How to Change Root Password in Linux Ubuntu

Change root user password in linux ubuntu using command line; Through this tutorial, we will learn how to change root user password in linux ubuntu using command line.

Note that :- By default, in Ubuntu, the root account has no password set. Use the following recommended approach is to use the sudo command to run commands with root-level privileges.

How to Change Root Password in Linux Ubuntu

Follow the following steps to change root user password in linux ubuntu using command line:

  • Step 1 – Open Terminal
  • Step 2 – Became a Root User
  • Step 3 – Set the Root User Password
  • Step 4 – Verify Root User New Password

Step 1 – Open Terminal

First of all, open the terminal using the keyboard shortcut CTRL+ALT+T.

Step 2 – Became a Root User

Execute the sudo -i command on the command line to became a root user on linux ubuntu:

sudo -i

Run the whoami command to verify that the user is changed:

whoami

Output of the above given command:

root

Step 3 – Set the Root User Password

Execute the following command on command line to set or change root user password on linux ubuntu system:

sudo passwd root

After that, prompt will be open for enter and confirm the new root password.

That’s it! The root password has been changed.

Step 4 – Verify Root User New Password

Execute the following command on command line to test or verify root user new password on linux ubuntu:

su -

Conclusion

Through this tutorial, we have learned how to change root user password in linux ubuntu using command line.

Recommended Linux Ubuntu Tutorials

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button