How can you make SSH read the password from stdin, which it doesn't do by default?
+1
A:
FreeBSD mailing list recommends the expect library.
If you need a programmatic ssh login, you really ought to be using public key logins, however -- obviously there are a lot fewer security holes this way as compared to using an external library to pass a password through stdin
.
Mark Rushakoff
2009-08-27 11:12:31