SSH key fingerprints don't match

2

I'm trying to SSH from my laptop into my desktop. On the desktop, ssh-keygen -lf ~/.ssh/id_ecdsa.pub yields 08:ac:cb:9c:e8:c2:4f:2c:1d:6e:54:ad:83:c7:27:47, but when I try to connect, I'm told the ECDSA key fingerprint is something completely different.

I can connect to the machine through HTTP, so I know it's the right one. I'm worried someone is trying to MITM me.

Functino

Posted 2015-09-10T19:41:24.223

Reputation: 139

Answers

6

It tells you more than what you present here. You need to understand difference between server host key and your client identity key:

  • This is fingerprint of your local client identity key:

    ssh-keygen -lf ~/.ssh/id_ecdsa.pub
    
  • By calling ssh remotehost you are prompted to verify server host key, which is stored on server and you or somebody with access to the server can create you the same fingerprint by executing

    ssh-keygen -lf /etc/ssh/ssh_host_ecdsa_key.pub
    

These two fingerprints will never match.

This can be found in man sshd.

Jakuje

Posted 2015-09-10T19:41:24.223

Reputation: 7 981