Server host key not cached
I’ve been having problems with Git on my Windows PC tonight and wanted to share the solution.
I was trying to push my commits to the remote repo but getting this error:
The server's host key is not cached in the registry. You have no guarantee that the server is the computer you think it is. The server's rsa2 key fingerprint is: ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx Connection abandoned. fatal: The remote end hung up unexpectedly
The error means the host key of origin isn’t present in my machines known_hosts file. Normally using ssh to connect to machine would solve the problem, but this being Windows it wasnt that simple.
Since I’m using MSYS Git on Windows and PuTTY I had to connect using plink. Typeing plink.exe <host> was all that was required in the end.