in reply to Re^2: net::ssh2 connection
in thread net::ssh2 connection

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

Replies are listed 'Best First'.
Re^4: net::ssh2 connection
by Anonymous Monk on Nov 04, 2008 at 11:13 UTC

      But why would the server then accept the key just fine?

      syphilis: wouldn't both c != '\n' and c != 10 effectively test the same thing?

        wouldn't both c != '\n' and c != 10 effectively test the same thing?

        Aaah ... yes, I'm losing the plot. (Somehow I had managed to prove to myself that both '\r' and '\n' were 0x0D .... damned if I can reproduce that work of inspired genius now, though :-)

        Cheers,
        Rob