in reply to Re: Net::SSH2 strangeness
in thread Net::SSH2 strangeness

also, just tried using ssh2->error() but it seems to be useless.

You die before actually reaching that code. Something like the following would be needed:

$ssh2->connect($hostname) or do { my ($err_code, $err_name, $err_text) = $ssh2->error(); die "cant connect to $hostname: " . "($err_code, $err_name) $err_text\n"; };

Replies are listed 'Best First'.
Re^3: Net::SSH2 strangeness
by vxp (Pilgrim) on May 18, 2008 at 18:07 UTC
    Now we are getting somewhere:
    [root@lpo-wiki-01 ~]# ./ssh.pl yoda cant connect to yoda: (-5, LIBSSH2_ERROR_KEX_FAILURE) Unable to exchan +ge encryption keys [root@lpo-wiki-01 ~]#

    wtf? :)

      You say "I can manually connect with ssh using the same login credentials as I'm trying here". Was that with ssh's -2 switch (which would duplicate Net::SSH2's lack of ssh protocol version 1 support)?