Host key validation failed - GitLab with Visual Studio Code on macOS

I keep getting the error "Host key verification failed" when trying to redirect changes to a managed git folder / project in Gitlab. For some reason, it works fine using Visual Studio for Mac, and I can log into my Gitlab account just fine through a web browser.

+6


source to share


3 answers


Solved by removing any / all Known_hosts files in ~ / .ssh / and then executing ssh git@gitlab.com

in Terminal and answering yes (which re-adds git@gitlab.com to known_hosts after recreating the new known_hosts file).



I played around with known_hosts, which is probably what caused the problem.

+11


source


I recreated the ssh keys in git for windows and it worked!



0


source


I found that my home profile was loading as "P: \" in git bash (due to my IT team work ...).

Make sure that in git bash you have generated the ssh key using ssh-keygen

, and that GitLab knows about the key.

If the problem ssh -o StrictHostKeyChecking=no <gitlab-host> uptime

persists , run to make gitlab trusted.

0


source







All Articles