A partial hit with ssh -t -t except I think it empties the input buffer when prompting for the password a second time, which is a shame. The best I've got to is with a here document on the command line like this:-
# ssh -t -t localhost passwd TESTUSER <<-EOSSH
TESTUSER's New password:
Enter the new password again:
3004-781 Password read timed out.
3004-709 Error changing password for "TESTUSER".
Connection to localhost closed.
How annoying is that, unless anyone can spot that I've missed something. I've tried piping another echo Qwerty99! into the ssh and without the - for the -EOSSH, but all getting the same result.
Bah! Am I just hoping for too much? I fancy that some manual work and an edit of /etc/security/passwd or /etc/shadow is looming.
Last edited by rbatte1; 12-23-2014 at 10:49 AM..
Reason: Corrected spleling for :confused: smiley
If your still working on this try the following as root.
echo password | passwd username --stdin
This only works with Linux, I tested it on SLES and it worked. I see you have solaris and AIX tags on this post. I also tested this on Solaris 10 server and it didn't work. You will have to use expect, or use something like sed to do a find and replace for the effected line in /etc/shadow.