1. Problem Summary
I was trying to push changes from my local machine to a remote repository on Github using VSCode today. The system hung up repeatedly. I tried to only pull, then push, to sync, and to even update the remote server. But VSCode kept hanging and not syncing with the remote server.
I then tried to push using a Git Bash terminal. Instead of hanging up, it told me:
WARNING - POTENTIAL SECURITY BREACH!
The server's host key does not match the one PuTTY has cached.
This means that either the server administrator has changed the host key, or you have actually connected to another computer pretending to be the server.The new rsa2 fingerprint is: [redacted]
If you were expecting this change and trust the new key, enter "y" to update PuTTY's cache and continue connecting. If you want to carry on connecting but without updating the cache, enter "n". If you want to abandon the connection completely, press Return to cancel.
Pressing Return is the ONLY guaranteed safe choice.
2. What I've Tried None of those options (Y, n, Return) worked in Bash. I then used PuTTY to generate a new public/private key pair, and the same error message came up when I tried to push. I tried to use ssh-add to load the key, and it kept telling me that the key had invalid format. I assume this was the issue with the old key. So, I then tried ssy-keygen -t rsa -b 4096 -C "[email protected]" to generate a new key from Git Bash. I added that key to the remote server on Github for this repository, and when I tried to Push through Git Bash, it failed again. With the same error as above.
I then went to my tablet which has access to the same local drive. From there I opened VSCode, opened the local folder with the repository, and tried to push/pull (sync) from VSCode, repeating the first step above from a different terminal. Of course, this other terminal connects to the same remote repository with a different ssh key, and this time VSCode did not hang up and I was able to push the changes to the remote.
3. No code to show, but a couple of specific questions
- Why does VSCode hang and not generate a similar error (WARNING - POTENTIAL SECURITY BREACH!)? That was a bit of a time sync as it simply hung. I could continue to code, run code, etc., but the window for version control was simply stuck.
- How do I overcome the ssh key problem I am having on one terminal? This has never happened to me before in this repository or any others.
- Why does Bash hang when entering Y, n, or Return when prompted? This seems buggy - is there a way around it?
I am running both terminals on Windows.