WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED | GitHub

WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED


If you are using github then it's likely that you may notice issues with the webhook or git commands showing below error.


@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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 /home/runcloud/.ssh/known_hosts to get rid of this message.
Offending RSA key in /home/runcloud/.ssh/known_hosts:1
  remove with:
  ssh-keygen -f "/home/runcloud/.ssh/known_hosts" -R "github.com"
RSA host key for github.com has changed and you have requested strict checking.
Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.



This error message occurs when the SSH client detects that the host key of the remote server has changed since the last time you connected to it. The host key is a unique identifier that is used to verify the identity of the remote server. In this instance, above key change will affect everyone using RSA SSH key for secure git operations like running commands, GitHub actions or webhook etc.

This happens due to GitHub updated their RSA SSH host key which is used to secure Git operations for GitHub.com because private key was briefly exposed in a public GitHub repository.

The solution is to run the command 

 
ssh-keygen -f "/home/runcloud/.ssh/known_hosts" -R "github.com"

Here you can change the known_hosts path with your own. For this case, we are running command as runcloud user.

You can find further instructions in their blog : We updated our RSA SSH host key | The GitHub Blog

In conclusion, the "WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!" error message is a sign that something has changed with the remote server you're trying to connect to. While it can be alarming, taking the above steps should help you resolve the issue and ensure that your connection is secure.

Comments