I’m trying to understand how to set up SSH keys for GitHub. I’m not sure exactly how to word things… So, this is a breakdown of what I’ve done and what I’m trying to do…
-
I generated an SSH key on Server A, from which I’ll be pushing /
pulling to my GitHub repository -
I’ve added an SSH Key in my Account Settings on GitHub and copied over the contents of Server A’s id_rsa.pub file
-
I can now successfully push and pull from Server A to / from my GitHub repository
Now, I want to also setup another server (Server B) so that I can push and pull from that one as well.
My question is: Do I have to generate a new ssh key on Server B, or can I “re-use” the one I’ve already setup? Meaning, do I have to have a completely unique ssh key on each server I’ll be pushing and pulling from? If not, how can I add the id_rsa.pub file so that it’s the same information? Is it just as simple as copying the files?
Its possible to use the same key but its not advised. If someone takes control of Server B you would have to regenerate a new key for A and disable access for old command. Its just not secure enough.
You should generate a new key for all machines you own. So you can individually control access for servers.