I am migrating all my work to a new computer. I seem to remember having once - ages ago - generated an SSH key for Git / Github. Where is this key stored? Do I need to find it if I want to access the same Git repos from a new computer? Or can I simply generate new keys?
The key is stored in your home directory at ~/.ssh. For Windows, this means C:\Users\<username>\.ssh. You can copy that whole directory to the new machine to keep the keys the way they are.
However, copying the keys is usually discouraged. The key in question is a private key which should stay private at all costs. Whoever has the key can communicate with GitHub or other sites on your behalf. So it’s recommend that you avoid having to copy it ever to something else (so you don’t accidentally allow others to copy it too).
Instead, you should create a new key on your new machine, add that to GitHub and remove the old one. See this help page on how to do that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With