How to change password via SSH in Linux/Centos?
How to change password via SSH in Linux/Centos? First, you need login SSH to your Linux server, then use command passwd to change password. below example is change root password for a Centos:
-bash-3.2# su - root - you don't need to do this if you already login ssh as root
[root @ ComfortVPS.com ~]# passwd root - usage: passwd <accountName> , passwd root means change password for accountname root
Changing password for user root.
New UNIX password: (You should type your new password here)
Retype new UNIX password: (You should retype your new password again)
passwd: all authentication tokens updated successfully.
Done, you have successfully changed your password!
SSH Change password Failed example:
[root @ ComfortVPS.com ~]# passwd
Changing password for user root.
New UNIX password:
BAD PASSWORD: it is WAY too short
Retype new UNIX password:
Sorry, passwords do not match.
New UNIX password:
Retype new UNIX password:
Sorry, passwords do not match.
New UNIX password:
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password:
Sorry, passwords do not match.
passwd: Authentication information cannot be recovered
As a general guideline, passwords should consist of 8 to 15 characters including one or more from each of following sets:
- Lower case alphabetics
- Upper case alphabetics
- Digits 0 thru 9
- Punctuation marks
You can change root password via our control area if you forget the root password which means you can't login via ssh.
Tutorial: How to change root password if I can't ssh login?