How to Change Linux Account Password Through SSH: A Beginners’ Tutorial

People are sometimes given access to Linux/Unix and asked to change their initial passwords. But for beginners, changing a Linux/Unix password is not an easy task, especially when there is only SSH log on allowed to the Linux/Unix server. This post introduces how to change password of user USER on host HOST remotely using SSH.

linux-passwd.png

Steps are as follows. Note: you will need to replace HOST and USER with the actual username and hostname you are using.

Step 1. Log on the HOST as USER.

On Linux and Mac OS X, open a terminal and run

ssh USER@HOST

If it asks whether your are continuing connecting if you do this for the first time, you can enter “yes” to continue.

It will display

USER@HOST's password:

You will need to enter the password. You can’t see what you have entered here.

Step 2. Change the password

In side of the SSH login, run

passwd

It will display

Changing password for user USER.
Changing password for USER.
(current) UNIX password:

Enter your old password here. You can’t see what you have entred too.

It will then display

New password:

Enter new password. It will then display

Retype new password:

Enter new password again

If you see

passwd: all authentication tokens updated successfully.

or

passwd: password updated successfully.

Step3. Exit the SSH session

You can exit the SSH session by running

exit

Eric Zhiqiang Ma

Eric is interested in building high-performance and scalable distributed systems and related technologies. The views or opinions expressed here are solely Eric's own and do not necessarily represent those of any third parties.

One comment:

Leave a Reply

Your email address will not be published. Required fields are marked *