Search code examples
gitgit-bashputty

Why is the prompt for updating the host key not working in git-bash (Windows) / PuTTY?


GitHub recently changed their host key:
https://github.blog/2023-03-23-we-updated-our-rsa-ssh-host-key/

I use PuTTY for SSH keys ans git-bash for Windows.

When pushing my repository to GitHub, I get the following message:

enter image description here

But no matter if I enter y/n/nothing and hit Return, nothing happens, the cursor just jumps to the next line. How to solve this?


Solution

  • You are using PuTTY/Plink for SSH with your Git for Windows. The Plink does not work well within Git when it needs an input.

    • Either switch to OpenSSH.

    • Or just cache the github.com SSH hostkey outside of Git first.

      Either from PuTTY (by trying to connect to github.com):

      enter image description here

    • Or using Plink in console (cmd or bash or whatever):

      C:\>plink github.com
      

      enter image description here