in reply to error_know_host error

Your usage does not match the usage as shown in the documentation. Maybe try it like this:

$ssh2->check_hostkey(LIBSSH2_HOSTKEY_POLICY_TOFU) or $ssh2->die_with_error;

Also, have you verified (using plain ssh) that the hostkey is still the same as in your known_hosts file?

Replies are listed 'Best First'.
Re^2: error_know_host error
by BernieC (Pilgrim) on Oct 16, 2023 at 16:50 UTC
    Should Net::SSH2 have defined that? I got: Bareword "LIBSSH2_HOSTKEY_POLICY_TOFU" not allowed while "strict subs" in use
      it's not properly documented, but based on Net/SSH2.pm source, it requires Net/SSH2/Constants.pm, which sets up export tags, including :policy which includes LIBSSH2_HOSTKEY_POLICY_TOFU -- so I think that use Net::SSH2 qw/:policy/; should work for you (untested).