Ubuntu reset root password command line

Change root user password in linux ubuntu using command line; In this tutorial, i am going to show you how to change root user password in linux ubuntu using command line.

Ubuntu reset root password command line

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

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

Step 1 – Start Terminal

Start the terminal using the keyboard shortcut CTRL+ALT+T.

Step 2 – Became a Root User

Run 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

Run the following command on command line to set or change root user password on linux ubuntu machine:

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

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

su -

Conclusion

In this tutorial, i have shown to you how to change root user password in linux ubuntu using command line.

More Linux Ubuntu Tutorials

Leave a Comment