For security reasons, your ssh based account has limited access to the server. You can only upload or download files using scp, sftp, rsync and so on. You may execute limited number of commands such as passwd, ls and so on.
Also, it is a good idea to change your password every month or at least every four months. Make sure you use combination of alphabets (upper and lower case characters), numbers, and special characters as a password to safeguard your account. You should choose a password of at least ten characters.
Changing the password for Linux or Unix over ssh
The procedure to change the user password on Linux or Unix over ssh:
- Open the Terminal application
- Type the following command to change password for vivek user using ssh:
ssh -t vivek@IP-here passwd
- Type the following command to change password for root user using ssh:
ssh -t root@server-IP-here passwd
- Type your current password when prompted. You must type new password twice
Let us see syntax and example in details.
The syntax is:
ssh -t user@server-name-here passwd ssh -t userName@server.ip.address.here passwd ssh -t userName@192.168.1.20 passwd ssh -t userName@192.168.1.20 /bin/passwd
- -t : This option force pseudo-tty allocation. This can be used to execute arbitrary screen-based programs (such as passwd) on a remote machine, which can be very useful, e.g. when implementing menu services. Multiple -t options force tty allocation, even if ssh has no local tty.
In this example, change password for user called nixcraft on server1.cyberciti.biz by issuing the passwd command over ssh:
ssh -t firstname.lastname@example.org passwd ssh -t vivek@nas01 passwd
Warning: If you skip the -t option, either you will see password in a plain text on screen or you will get an error that read as follows:
passwd: pam_chauthtok(): conversation failure
In this example, change password for user called vivek on nas01 by issuing the passwd command without the -t over ssh:
ssh email@example.com passwd ssh vivek@nas01 passwd
- Read man pages for more info: ssh(1),passwd(1)