in reply to net::ssh2 connection

#$ssh2->debug(1);

Do you get anything useful if you enable this?  If not, you might try enabling debugging for the server side, too (if you have the appropriate permissions on the Fedora box, that is).

Replies are listed 'Best First'.
Re^2: net::ssh2 connection
by sintoad (Initiate) on Nov 03, 2008 at 19:53 UTC
    C:\Perl>perl ssh2.pl Unable to login Net::SSH2::DESTROY object 0x1a44f1c
    The Fedora box is just my test box so I will put it into debug as well and see what I can get.
      Okay, Debugged the server. My server accepts the key just fine. The connection is closed by my WinXp box.
      Connection closed by "my authenticating host" dispatch_protocol_error: type 90 seq 5 fatal: read from socket failed:connection reset by peer
      Unable to login

      I was wondering if there could be a problem with the way that auth_publickey() reads file with windows line endings. In the libssh2 library, the public file is read with:
      while (!feof(fd) && (c = fgetc(fd)) != '\r' && c != '\n') pubkey_len++;
      I was thinking that perhaps, for windows line endings, that needs to be:
      while (!feof(fd) && (c = fgetc(fd)) != '\r' && c != '\n' && c != 10) pubkey_len++;
      I guess you could check that by storing the keys in files with nix line endings, and see if that makes any difference. Other than that, it might be useful to find out what  dispatch_protocol_error: type 90 seq 5 actually means. (Or it might not :-)

      Cheers,
      Rob