On Thu, Oct 11, 2007 at 03:23:07PM -0700, mainway wrote:
>[snip code]
>
> You see i try to:
> - start "ssh -l root server"
> - send the password to the "[EMAIL PROTECTED]'s password: " prompt
> - send a command ("date") over SSH to the server.
>
> I've found out that SSH doesn't expect the password over the
> "normal-channel".
> Does anybody know if there is the possibility to insert the password into
> the "ssh -l root server"-command?
> That would solve the problem...
Not sure about how to solve the programming problem.
I have to ask, have you thought about using a key with no passphrase[0]?
I'm assuming you want to use this for automation.
ssh -l root -i ~/.ssh/id_rsa "date"
If not there are other open source programs out there [1] that do
something similar as far as passing things to ssh.
Also, I know expect [2] can pass arguments such as passwords to ssh as well.
HTH,
~ stevo
[0] - http://pkeck.myweb.uga.edu/ssh/
[1] - http://clusterssh.wiki.sourceforge.net/Main+Page
[2] - http://rootprompt.org/article.php3?article=9187