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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With