"Warning: Remote Host Identification Has Changed" - Answered

I got this error yesterday and panicked...

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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 RSA key sent by the remote host is
SHA256:uNiVztksCsDhcc0u9e8BujQXVUpKZIDTMczCvj3tD2s.
Please contact your system administrator.
Add correct host key in /Users/niallmaher/.ssh/known_hosts to get rid of this message.
Offending RSA key in /Users/niallmaher/.ssh/known_hosts:1
Host key for github.com has changed and you have requested strict checking.
Host key verification failed.
fatal: Could not read from remote repository.

Turns out on March 24th 2023 GitHub updated their RSA SSH host key.

You will get that message if you have GitHub’s previous key fingerprint in your SSH client before that date.

GitHub has a post [here}(https://github.blog/2023-03-23-we-updated-our-rsa-ssh-host-key/) with details on the fix but here's the TLDR.

Run:

ssh-keygen -R github.com

And then the next time you connect (pull, push or clone) you should just need to confirm the new fingerprint. The message will look like this:

Are you sure you want to continue connecting (yes/no/[fingerprint])?

And once it's confirmed it should be it fixed. ❤️

Happy coding!


For more fixes you can see the article I referenced above: https://github.blog/2023-03-23-we-updated-our-rsa-ssh-host-key/

HelpQuestionBugGithub
Avatar for Niall Maher

Written by Niall Maher

Founder of Codú - The web developer community! I've worked in nearly every corner of technology businesses: Lead Developer, Software Architect, Product Manager, CTO, and now happily a Founder.

Loading

Fetching comments

Hey! 👋

Got something to say?

or to leave a comment.