Articles in this section

Git Error for GitHub repositories: warning: remote host identification has changed

kb: technical ext: git

Symptoms

  • Unable to pull from a GitHub repository with the following 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 /var/www/vhosts/example.com/.ssh/git_known_hosts to get rid of this message.
    Host key for github.com has changed and you have requested strict checking.
    Host key verification failed.

Cause

On March 24th, 2023, GitHub updated its SSH keys:

Resolution

  1. Connect to the server via SSH
  2. Remove Github key:

    # ssh-keygen -R github.com

In case that the issue persist, consider the alternatives described on the official GitHub blog thread here.

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.