Git – Cloning git repo causes error – Host key verification failed. fatal: The remote end hung up unexpectedly

gitssh-keys

I am using SSH to clone a git repo to my web server, but every time I get this error

$git clone git@github.com:aleccunningham/marjoram.git
Cloning into marjoram...
Host key verification failed.

I have tried almost everything that has shown up in Google searches, and I am dumbfounded on why this will not work. Any ideas?

Also, I am not using anything like Jenkins.

Best Answer

The issue could be that Github isn't present in your ~/.ssh/known_hosts file.

Append GitHub to the list of authorized hosts:

ssh-keyscan -H github.com >> ~/.ssh/known_hosts