Automating ssh logins (without keys) with 'expect'
Feb 04, 2010, 01:33 (0 Talkback[s])
How to Help Your Business Become an AI Early Adopter
[ Thanks to Dave for
this link. ]
"You need to automate a task across many machines. You
know the user name and password, but for some reason, either by
policy or otherwise, you are not allowed to use PKI, or Public Key
"Well, not to give up hope just yet, because there is a nice
little tool that is extremely powerful, yet not widely utilized.
it's called 'expect'.
"Expect does just as you would, uh expect it to do. It will
start a process that would normally have interaction, and then you
can tell it what to expect in return. Maybe you have to answer a
yes or no question or supply it with a name or password. It's not
just limited to that. You can specify conditions as to what kind of
conversation expect would have. Let's use SSH as an example:"