Score:0

How to compare a remote host fingerprint to the fingerprint of a different host?

kr flag

I have two ways of accessing my remote host ssh server:

  1. using its local IP addres

  2. using its public IP address

Yesterday, I reinstalled my SSH server on the remote host and I updated my known hosts file for the local IP address. I am now off of my local network and trying to connect to my server using its public IP address and I realized I forgot to update my known hosts file after reinstalling the SSH service. This is giving me the common error below.

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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
MD5:FINGERPRINT.
Please contact your system administrator.
Add correct host key in /Users/user/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /Users/user/.ssh/known_hosts:25
ECDSA host key for [PUBLIC IP]:PORT has changed and you have requested strict checking.
Host key verification failed.

I'm 99% sure this is because I changed the SSH server, however, if I wanted to double check and verify, how would I do this?

My question is

How can I verify the new fingerprint of the remote host against the fingerprint saved for the local IP address of the server?

What I've Done

  1. I ran the following command: ssh-keygen -lv -f ~/.ssh/known_hosts and found the SHA256 fingerprint saved for the local ip address of my server.

  2. I compared this to the SHA256 fingerprint being sent to me from my remote host, and they appear to be identical.

How can I be 100% sure? Did I do this properly?

A.B avatar
cl flag
A.B
What you also did: cross-post this question to https://superuser.com/questions/1704774/how-to-compare-a-remote-host-fingerprint-to-the-fingerprint-of-a-different-host . See this meta Q/A about this: https://meta.stackexchange.com/questions/64068/is-cross-posting-a-question-on-multiple-stack-exchange-sites-permitted-if-the-qu/64069#64069
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.