How to Change Your SSH Password

There has been an ongoing debate over which is better between using SSH keys or passwords for user authentication on an SFTP server. Well, both technologies have their pros and cons and while some people use SSH keys for authentication, many others use a password. Mostly because of convenience and easiness to remember or even the browser helping out in filling those details up.

In this post, we look at how to change your SSH password if you wish to probably make it more secured or follow the routine 90-days-password-change practice.

First thing though is to ensure that you have SSH access enabled. You can check up on that here in case you have not.

As soon as you have enabled SSH access, then login to your SSH server using the following on Unix/Linux.

ssh -l <username> <servername>

You would see a prompt demanding for your password if your SSH keys are yet to be sent over to the server. For Windows users, you can use PuTTy for this.

How to change your SSH password

When you are successfully logged in, enter the following command to change your password:

passwd

A prompt would appear asking for the current password you use on the server, as well as your new password.

Type the new password you want. You would be prompted to type it again. Do so and press Enter.

Upon completion, you would see an interface with the following output:

passwd: all authentication tokens updated successfully

Your password has now successfully changed in the password you have chosen.