How to export ssh gpg keys from github to my local computer?

It happened to me that my local laptop needs a fresh installation, and I didn’t do a good backup. I seriously do NOT want to generate ssh/gpg keys and have the key renewed on github.com again. I wonder if there is a way to just export the key on github.com to my local computer directly?

If so, how?

Thank you

Pei

1 Like

Hi @jiapei100 ,

Unfortunately, that will not be possible. GItHub only has the public parts of your gpg and ssh keys, not the private parts, those only exist on your local computer. If you didn’t back those up before reinstalling, then I’m afraid that they are lost and you will need to generate new keys.

2 Likes

However, if you are  100% sure the private key in question  is not   compromised   and safely destrcuted (which is  not the case by default with a fresh installation), you  can just leave the old key up on GitHub so your commits will continue to show up as  Verified while also putting your new key alongside the old key up on GitHub.

1 Like