Skip to content

Changing your root password on an Ubuntu server

You can change your root password on your Ubuntu server via SSH with some simple commands by completing the following steps.

See also: Changing your root password on Plesk and cPanel.

Step 1

First of all, log in to the server via SSH.

Step 2

When logged in, if you’re using the root user you just need to type:

sudo passwd root
root@UbuntuServer:~# sudo passwd root
New password:
Retype new password:
passwd: password updated successfully
root@UbuntuServer:~#

Step 3

If you already have root permissions, you will not need to type ‘sudo’.

You can also change the ‘root’ to be a different user if you’ve set one up. If you type ‘passwd’ alone, it will change the password for your current user.

Here’s an example of a root user changing their own password with a shorter command:

root@UbuntuServer:~# passwd
New Password:
Retype new password:
passwd: password updated successfully
root@UbuntuServer:~#

Was this article helpful?

Related guides