简体   繁体   中英

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

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM