Changing your root password on a Debian server
You can change your root password on your Debian server via SSH with some simple commands by completing the following steps.
First of all, log in to the server via SSH.
When logged in, if you’re using the root user you just need to type:
sudo passwd root
root@DebianServer:~# sudo passwd root New password: Retype new password: passwd: password updated successfully root@DebianServer:~#
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@DebianServer:~# passwd New password: Retype new password: passwd: password updated successfully root@DebianServer:~#