in reply to Re^3: Net:SSH2 channels
in thread Net:SSH2 channels

Perfect suggestion!! In the code I had

$ssh2->auth_password($login{user}, $login{password}) ; $ssh2->auth_ok() ;
and I was assuming that auth_ok was telling me truth. Not so. As you suggested, I put in an explicit error check on the auth_password and now I get:
d:\Desktop>sshtest Authentication failed (username/password) (-18 LIBSSH2_ERROR_PUBLICKEY +_UNRECOGNI ZED) at D:\Desktop\sshtest.pl line 13.
Now I have to figure out what PUBLICKEY_UNRECOGNIZED means. I think it means that it doesn't recognize the servers key and I need to figure out how to get that "accepted" -- I know I've had to do that in my sftp and ssh clients, I didn't think it'd be a problem with this. Is it worth a bug-report on Net::SSH2 that auth_ok doesn't seem to work?

Replies are listed 'Best First'.
Re^5: Net:SSH2 channels
by syphilis (Archbishop) on Aug 09, 2018 at 11:25 UTC
    Now I have to figure out what PUBLICKEY_UNRECOGNIZED means

    According to the documentation it means that "The username/public key combination was invalid".
    It's therefore a rather strange error - because you weren't even providing a "username/public key" combination.
    Instead, you were providing a "username/password" combination.

    However, that's the exact same error as I, too, experience when I try to authorize using auth_password. (As I mentioned in my previous post, I experience no problems if I seek authorization with auth_publickey.)
    It has a very buggy feel about it, but I'm not sure what the bug is or whether it has been fixed in a more recent version of Net::SSH2 (I have version 0.63) or libssh2 (I have version 1.8.0).

    Cheers,
    Rob