Hallo zusammen, ich möchte gerne in meiner DNS Zone mittels SSHFP record den public key des ssh keys vom server hinterlegen, sodass ich vom client aus die Option VerifyHostKeyDNS=yes setzen kann.
Dazu habe ich folgenden Befehl auf dem Server ausgeführt
ssh-keygen -h kronos.example.local -f /etc/ssh/ssh_host_rsa_key
Ich habe folgenden output mit Fingerprint erhalten.
kronos.example.local IN SSHFP 1 1 365f966468f59ed889fb9d94c25f8f6cb858aa7a kronos.example-local IN SSHFP 1 2 162f0117baae8380427698ba8800bdef36e150e6014f220b568d85445832d050
Die Einträge habe ich der Zone hinzugefügt. Mittels dig erhalte ich folgenden output.
;; ANSWER SECTION: kronos.example.local. 3600 IN SSHFP 1 2 162F0117BAAE8380427698BA8800BDEF36E150E6014F220B568D8544 5832D050 kronos.example.local 3600 IN SSHFP 1 1 365F966468F59ED889FB9D94C25F8F6CB858AA7A
Beim Verbinden per SSH bekomme ich allerdings folgenden Fehler.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY! Someone could be eavesdropping on you right now (man-in-the-middle attack)! It is also possible that a host key has just been changed. The fingerprint for the ECDSA key sent by the remote host is SHA256:spASQM+dLQTSn56b4afziyDRb1OWrQvjtaHjD05f7z8. Please contact your system administrator. Update the SSHFP RR in DNS with the new host key to get rid of this message. The authenticity of host '[kronos.example.local]:30 ([192.168.178.40]:22)' can't be established. ECDSA key fingerprint is SHA256:spASQM+dLQTSn56b4afziyDRb1OWrQvjtaHjD05f7z8. No matching host key fingerprint found in DNS. Are you sure you want to continue connecting (yes/no)?
Jetzt stellt sich bei mir die Frage, wieso der Fingerprint nicht übereinstimmt. Was habe ich falsch gemacht? Nutzt ssh beim Verbindungsaufbau einen anderen Schlüssel zu Verifikation?
Gruß Volker