Host Key Verification Failed - GitLab with Visual Studio Code on macOS

jspinella picture jspinella · Aug 7, 2017 · Viewed 14.1k times · Source

I keep getting a "Host Key Verification Failed" error when trying to push changes to a git controlled folder/project to Gitlab. For whatever reason, it works fine using Visual Studio for Mac, and I can login to my Gitlab account just fine via web browser.

Answer

jspinella picture jspinella · Aug 7, 2017

Resolved by deleting any/all Known_hosts files in ~/.ssh/ and then executing ssh [email protected] in Terminal and answering "yes" (which re-adds [email protected] to known_hosts after re-creating a new known_hosts file).

I did some messing around in known_hosts which probably caused the problem.