I tried turning on debugging in SSH2 and I'm not sure what it is telling me but there seems to be a hint at the problem.
d:\Desktop>sshtest libssh2_knownhost_init(ss->session) -> 0x294be38 Net::SSH2::KnownHosts::DESTROY Authentication failed (username/password) (-18 LIBSSH2_ERROR_PUBLICKEY +_UNRECOGNI ZED) at D:\Desktop\sshtest.pl line 13. Net::SSH2::DESTROY object 0x247cf08
It looks almost as though the problem is that the knownhost info is being destroyed before I get to the auth step. The code is
my $ssh2 = Net::SSH2->new(debug => 1); $ssh2->connect("shell02.theworld.com") or $ssh2->die_with_error ; $ssh2->check_hostkey('ask', "d:/profiles/known_hosts.pub") or $ssh2->die_with_error ; $ssh2->auth_password($login{user}, $login{password}) or $ssh2->die_with_error;
As if the check_hostkey works and so doesn't "die" but the fact that it works is lost before I do the auth. It is probably a rough trip, but I guess I should take a look at the code for auth_password and see what it is expecting for its public key check, and then work backwards to see what check_hostkey is supposed to leave behind to make auth_password happy. Everything is so hard...:o)
In reply to Re^2: Can't get $ssh2->check_hostkey to work
by BernieC
in thread Can't get $ssh2->check_hostkey to work
by BernieC
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |