I would like to add github.com to the known_hosts file from the command line as I am creating a puppet manifest to provision a remote server.
I have tried:
"ssh-keyscan -H github.com > /home/ubuntu/.ssh/known_hosts"
But when the server tries to access github:
Failed to add the RSA host key for IP address '220.127.116.11' to the list of known hosts (/home/ubuntu/.ssh/known_hosts).
I've also tried:
"ssh-keyscan -H github.com,18.104.22.168 > /home/ubuntu/.ssh/known_hosts"`
But accessing github throws:
Host key verification failed.
I'm sure this is of no additional use but if I ssh my server and then ssh github and follow the steps I get the following message
Permanently added 'github.com,22.214.171.124' (RSA) to the list of known hosts and then it will work perfectly.