Changing your root password on a Debian server

You can change your root password on your Debian server via SSH with some simple commands whenever you need to by completing the following steps.

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

Step 1

First, access the server via the SSH interface.

Step 2

If you are logged in as the root user, then you just need to type:

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

Step 3

If you are logged in as a user that already has root permissions, then you will not need to type ‘sudo‘.

You can also set the ‘root’ to be a different user if you have multiple users set up.

In this case, you can type ‘passwd‘ alone and it will change the password for the current user.

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

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

Was this article helpful?

Check out some of our related guides

Need a hand? Search over a hundred step-by-step support guides