"Authenticity of host can't be established" message pops up when I try to connect an SSH key to github.com

Viewed 78

This is my first time dealing with ssh keys and github as a new developer.
Every time I've tried to connect an ssh key to my Mac Terminal, this message pops up:

The authenticity of host 'github.com (140.82.114.3)' can't be established.
ECDSA key fingerprint is SHA256:p2QAMXNIC1TJYWeIOttrVc98/R1BUFWu3/LiyKgUfQM.
Are you sure you want to continue connecting (yes/no)? 

The fingerprint pasted in the GitHub website never matches the fingerprint in the message.
I followed all of the instructions as I saw them.
Any ideas on what I could do to fix this?

1 Answers

If the output of ssh-keyscan github.com matches the official GitHub's SSH key fingerprints, you can go ahead and type:

ssh-keyscan github.com >> ~/.ssh/known_hosts

That way, SSH should not query you anymore about the authenticity of host 'github.com.

From there, any SSH key added to your GitHub account profile should work, which you can check with:

ssh -Tv git@github.com
Related