Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 926
jspinella Avatar asked Aug 07 '17 01:08

jspinella


Video Answer


2 Answers

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.

like image 143
jspinella Avatar answered Oct 12 '22 06:10

jspinella


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.

like image 39
Jared Beach Avatar answered Oct 12 '22 06:10

Jared Beach