Using the same github account from multiple PCs

I have my github account and I want to access it from my two workstations, an Ubuntu workstation and a Windows one.

I'm a beginner on SSH and git as well, I followed all the instructions to setup my account with an SSH key on my ubuntu laptop, and everything works, but now if I want to use my git account from my windows laptop, I need to generate another ssh key or I can use the one generated from my ubuntu laptop?

Maybe I need to generate another ssh key from my windows laptop and then register it with my github account along with the one I generated from my ubuntu laptop and use each one from respective machine?

What is the best way to do? Is there a best practice?

If I can use the same SSH key on both, how I can import the key I already use in the other machine?


Solution 1:

It is best practice to use separate SSH keys on each machine, to limit the pain in the event of a compromise (you only have to rekey the compromised machine, and not all of them).

To add another public key to your Github account, login to Github and then visit https://github.com/account (or click the "Account Settings" link in your dashboard), then click "SSH Public Keys" and then "Add another public key". Give the new key a title (usually the machine's name is best) and then paste the key data itself into the large textbox. From then on, you should be able to access Github repositories over SSH from either machine.

Solution 2:

It is acceptable to use the same private key on both machines. Note that if you're using plink on the Windows machine that you may need to convert it from the format used by OpenSSH.