is it safe to store ssh keys on github?

Erèbe picture Erèbe · Aug 8, 2012 · Viewed 8.3k times · Source

I would like to know if is it safe to store public and private key on a public git repository ? These keys are password protected.

I'm willing to do that in order to save my current linux configuration. If it's not safe to do so, do you know a way to achieve my goal ?

Regards

Answer

Jonas G. Drange picture Jonas G. Drange · Aug 8, 2012

Private keys should stay private. Putting them on a public git repository is very paradoxical. Even if they have a passphrase they can be forcefully opened.

Github was just hacked so you should assume that everything you upload on Github is for everybody to see, even the private repositories.

You could save your Linux config on Github, but not the private keys. They must stay private (on your server, in your home folder). Take a look at this very helpful answer at serverfault.com: