Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^5: instantiating an SFTP object

by zentara (Archbishop)
on Jun 13, 2017 at 19:29 UTC ( #1192728=note: print w/replies, xml ) Need Help??


in reply to Re^4: instantiating an SFTP object
in thread instantiating an SFTP object

Hi, I don't want to feel like a dufus, but I tried
my $return = $ssh2->check_hostkey(LIBSSH2_HOSTKEY_POLICY_ASK); print "Return: $return\n\n\n\n";
and all I get is Return 00 and the normal filehandle printout. How exactly do I efficiently print out the returns from the check_hostkey command.? I'm cultivating laziness. :-)

I'm not really a human, but I play one on earth. ..... an animated JAPH

Replies are listed 'Best First'.
Re^6: instantiating an SFTP object
by salva (Abbot) on Jun 13, 2017 at 21:35 UTC
    If the remote host key is good enough for the given policy, the method returns a true value. Otherwise it returns undef and the error (or die_with_error) method can be used to find out the failure cause.
    $ssh2->check_hostkey(LIBSSH2_HOSTKEY_POLICY_ASK) or $ssh2->die_with_error;
    The 0-but-true value 00 is equal to LIBSSH2_KNOWNHOST_CHECK_MATCH.
      The 0-but-true value 00 is equal to LIBSSH2_KNOWNHOST_CHECK_MATCH.

      That's good isn't it? :-)


      I'm not really a human, but I play one on earth. ..... an animated JAPH

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1192728]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (4)
As of 2018-10-24 01:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When I need money for a bigger acquisition, I usually ...














    Results (127 votes). Check out past polls.

    Notices?