SuperGeekery: A blog probably of interest only to nerds by John F Morton.

A blog prob­a­bly of inter­est only to nerds by John F Mor­ton.

How to re-add Github key to a server

What Did I Just Do?

Note to self: Don’t erase your knownhosts file. (head­slap!)

I pro­vi­sion servers with Lar­avel Forge and messed up my deploy­ment from Github recent­ly. I was mess­ing around in the .ssh fold­er on my serv­er and delet­ed the known_hosts file. 

The next time I tried to deploy my code base from Github though, I got the fol­low­ing error.

Host key verification failed.
fatal: Could not read from remote repository.

I need­ed to get my serv­er to rec­og­nize” Github as a known host again and wasn’t sure how to do that. Google point­ed me to this solu­tion on Stack­Ex­change.

After log­ging into my remote serv­er via SSH, this com­mand got Github safe­ly back into my known hosts.

ssh-keyscan -t rsa >> ~/.ssh/known_hosts