knaqa has asked for the wisdom of the Perl Monks concerning the following question:

I have seen other POST like this so sorry if duplicated, however my question varies just enough from the others to warrant my post. I am trying to SSH2 to a remote router. SSH1 works fine, however when using protocol=>2 it hangs on

: Sent key-exchange init (KEXINIT), wait response. : Algorithms, c->s: 3des-cbc hmac-sha1 none : Algorithms, s->c: 3des-cbc hmac-sha1 none

I have checked the routers to make sure that i can SSH2 to them and I can. Also i have reloaded the newest Net::SSH::Perl. Any suggestions would be great.

Here is the code that i am using...

my $ssh = Net::SSH::Perl->new($GO, debug=>1, protocol=>2); $ssh->login($username, $passwd); ($stdout, $stderr, $exit) = $ssh->cmd("show configuration interfaces a +t-0/0/1.1");

Edit: g0n - inserted formatting tags

Replies are listed 'Best First'.
Re: SSH2 Hangs
by salva (Canon) on Mar 29, 2007 at 16:24 UTC
    Instead of Net::SSH::Perl try using Net::SSH2. The libssh2 library it is based on, is well maintanined and tested.

    AFAIK, Net::SSH::Port was a direct port of OpenSSH source code from C to Perl, a huge and remarkable effort, but now, it's a module difficult to maintain and corrections on OpenSSH are not being backported :-(

      OK, well I tried Net::SSH2 but i need to pre specify th uname and passwd. I have been unable to find examples on how to use this. I was unable to use Net::SSH due to the issue described above. That is why i resorted to Net::SSH::Perl. Does anyone have examples of how the SSH2 is used??