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

Viewed 34348

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.

4 Answers

I found that my home profile was loading as "P:\" in git bash (because of my work's IT team...).

Ensure that in git bash you have generated an ssh key using ssh-keygen and that GitLab knows about the key.

If you still have the issue, run ssh -o StrictHostKeyChecking=no <gitlab-host> uptime to make gitlab trusted.

I re-created ssh keys in git for Windows and it worked!

In Windows, I was receiving this error from Git on MS Visual Studio Code.

I had to launch it from Git Bash to pull in my git and ssh environment configuration.

<your git bash prompt> $ Code

VS Code should Launch, and you should be able to clone a repo via ssh then.

Related