# how to add github to known hosts

**URL:** <https://forum.ansible.com/t/how-to-add-github-to-known-hosts/16610>\
**Category:** Ansible Project\
**Created:** [October 25, 2014, 5:38pm UTC](https://forum.ansible.com/t/how-to-add-github-to-known-hosts/16610 "2014-10-25T17:38:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sam4](https://avatars.discourse-cdn.com/v4/letter/s/b5e925/32.png) [@sam4](https://forum.ansible.com/u/sam4)\
**Post date:** [October 25, 2014, 5:38pm UTC](https://forum.ansible.com/t/how-to-add-github-to-known-hosts/16610/1 "2014-10-25T17:38:05Z")

</div>

I’ve been using the following to add github to my known hosts:

shell: ssh-keyscan -H [github.com](http://github.com) \>\> ~/.ssh/known\_hosts

…but it started failing, here’s the result:

[https://gist.github.com/uunsamp/28ae7967222f757c9c37](https://gist.github.com/uunsamp/28ae7967222f757c9c37)

I mentioned this in IRC, and someone linked to a blog post where  
the author is doing something similar:

[https://juriansluiman.nl/article/151/managing-ssh-known-hosts-with-ansible](https://juriansluiman.nl/article/151/managing-ssh-known-hosts-with-ansible)

I tried what the author was doing and I had the same results as previously:

[https://gist.github.com/uunsamp/1408198189d58002543a](https://gist.github.com/uunsamp/1408198189d58002543a)

I could use some help on this, hope someone here as ran into this issue previously.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [October 30, 2014, 5:55pm UTC](https://forum.ansible.com/t/how-to-add-github-to-known-hosts/16610/2 "2014-10-30T17:55:05Z")

</div>

There’s an accept\_hostkey parameter to the git module which is a good thing to use in this case when adding something for purposes of using it with git.

(I would ask that folks please do not use gist for short things on the mailing list, it limits ability to search for problems later on Google and requires opening a giant sum of tabs…)
