Published: March 27 2023

Fix for GitHub Error - WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!

I tried pushing some changes to a GitHub repo this morning and got the error:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!


The Cause

It turns out GitHub updated their RSA SSH host key a few days ago because it was briefly exposed in a public GitHub repo.

The Solution

I fixed the problem by removing the old SSH key with the following command:

ssh-keygen -R github.com


Then the next time I ran git push I added the new SSH key by answering yes to the following question:

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


I'm running Windows 10 with PowerShell and git version 2.28.0.

For more info about why GitHub updated their SSH key see https://github.blog/2023-03-23-we-updated-our-rsa-ssh-host-key/.

 


Need Some Git Help?

Search fiverr for freelance Git developers.


Follow me for updates

On Twitter or RSS.


When I'm not coding...

Me and Tina are on a motorcycle adventure around Australia.
Come along for the ride!


Comments


Supported by