www.libssh2.org | Daily snapshots | Mailing list archive | Docs | Examples | github

Archive Index This month's Index

Subject: Re: Create host key fingerprint like ssh-keygen does

Re: Create host key fingerprint like ssh-keygen does

From: Alexander Lamaison <swish_at_lammy.co.uk>
Date: Mon, 21 Sep 2015 18:33:53 +0100

On 18 September 2015 at 10:35, Andreas Sommer
<andreas.sommer87_at_googlemail.com> wrote:
> Hey,
>
> I'm using libssh2_hostkey_hash(session, LIBSSH2_HOSTKEY_HASH_SHA1) as in
> the example code [1], creating a fingerprint string like "11:22:...".
> However this is not the fingerprint I get displayed when connecting with
> "ssh HOSTNAME" for the first time, or when running "ssh-keygen -lf
> PUBLICKEYFILE" against the server's public key.

That hash is normally the MD5 hash, not the SHA1 hash. Try
LIBSSH2_HOSTKEY_HASH_MD5

Alex

-- 
Swish - Easy SFTP for Windows Explorer (http://www.swish-sftp.org)
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2015-09-21

the libssh2 team