Monday, July 25, 2011

ssh login problem

Problem: When I try to connect target board using ssh, it gives me error of 'password has expired'. The log is given below.


$  ssh root@
root@'s password:
WARNING: Your password has expired.
You must change your password now and login again!
Changing password for root
New password:
Bad password: too short
Retype password:
Password for root changed by root
Connection to closed.

Soln: change the entry in shadow file,
old entry: root:$1$bmWHS8dA$cWZORf5md8ecQbEvL.Ule.:0:0:99999:7:::
new entry: root:$1$bmWHS8dA$cWZORf5md8ecQbEvL.Ule.:11851:0:99999:7:::

The problem is in shadow file, in this 'days since last password changed' field is set 0, so change modify it.