|
Hi guys, So I'd like to use Cyberduck to copy over some files to a server using SFTP. When I connect I get a request to allow/disallow the connection based upon the validity of the fingerprint of host key certificate. This is given to me as On the remote system, I can see the fingerprint hash is: $ ssh-keygen -L -E md5 -f /etc/ssh/ssh_host_ed25519_key-cert.pub
/etc/ssh/ssh_host_ed25519_key-cert.pub:
Type: ssh-ed25519-cert-v01@openssh.com host certificate
Public key: ED25519-CERT MD5:7b:85:31:77:83:87:38:c9:72:1c:44:e2:ac:0c:20:55
Signing CA: ED25519 MD5:b4:c6:ed:f1:95:dc:b0:76:c2:e0:7f:9c:8a:3f:4d:57 (using ssh-ed25519)
Key ID: "9e73f821e7a680a14611541dd1617693b6e9c10f97732f9794ae62cfa2d9cf55"
Serial: 10659949471223322586
Valid: from 2024-04-12T11:58:29 to 2034-04-10T11:58:59
Principals:
machine001
machine001.private.lan
Critical Options: (none)
Extensions: (none)I checked the implementation of SSHj and believe that this should return the same hash of the fingerprint as above. The debug output of Cyberduck seems to also show that it takes this value as SSHj computes it, but already in the logs the hash is different. I found a previous issue #12944 that has a similar premise but the answer doesn't clear this up for me. Why is there a difference? Cheers, |
Replies: 3 comments 2 replies
|
Normally you have multiple keys/certs in |
|
I think I can clarify why the fingerprints differ. Root causeThe discrepancy isn't caused by algorithm negotiation picking a different key. The actual cause probably is that Cyberduck/SSHj and OpenSSH are hashing different data:
Since a certificate's serialized blob is a superset of the raw public key blob, hashing the two produces completely different MD5 values — even though it's provably the same key/certificate on the wire. Why this is hard to verify manuallyExtracting just the raw public key from a Effect on
|
|
I did some testing on a VM configured with a certificate-based host key and have to partially revise my comment above. It's rather Cyberduck calculating the fingerprint from the entire certificate than OpenSSH. That's the reason you see a differing fingerprint in Cyberduck. We need to extract the public key from the certificate before doing the calculation of the fingerprint. |
OK, I think I understand and also found how to compute that fingerprint:
or if colons are desired:
Thanks for your help!