Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Net::SSH::Perl and SSH protocolsby xorl (Deacon) |
on Mar 22, 2008 at 20:34 UTC ( [id://675674]=perlquestion: print w/replies, xml ) | Need Help?? |
xorl has asked for the wisdom of the Perl Monks concerning the following question:
I'm using Net::SSH::Perl to run a few commands on a remote box.
The above is a sample script. If I run this on box 1 it gets all the way to the line with $ssh->cmd($cmd) and then dies with the following error: Connection closed by remote host. at /usr/lib/perl5/site_perl/5.8.5/Net/SSH/Perl/SSH1.pm line 75 If I change the protocol in the line starting with "my $ssh" from '1' to '1,2', It takes forever but eventually it runs without any errors. If I try '2,1' it again takes forever but eventually it runs without any errors. If I try '2' same extremely long delay but it eventually works. The delay every time is at the login line Now on box2, the unmodified script (where protocol is just '1') runs just fine and is very speedy. What could I have screwed up on box1 to cause this weirdness and how to I make it work like box2?
Back to
Seekers of Perl Wisdom
|
|