in reply to Can't get $ssh2->check_hostkey to work

Post your code, please!
  • Comment on Re: Can't get $ssh2->check_hostkey to work

Replies are listed 'Best First'.
Re^2: Can't get $ssh2->check_hostkey to work
by BernieC (Pilgrim) on Aug 09, 2018 at 19:31 UTC
    Here is the code I'm trying
    use Net::SSH2 ; my ( %login); my $ssh2 = Net::SSH2->new(); $ssh2->connect("shell02.theworld.com") or $ssh2->die_with_error ; $ssh2->check_hostkey(Net::SSH2::LIBSSH2_HOSTKEY_POLICY_ADVISORY(), "d: +/profiles/known_hosts.pub") or $ssh2->die_with_error ; $ssh2->auth_password($login{user}, $login{password}) or $ssh2->die_with_error; $ssh2->auth_ok() ; #### print "Logged in\n" ; ####

    as I posted, it never gets past the "check_hostkey"