In the myhome/.ssh/
directory are local SSH keys for my personal GitHub account, the directory has the id_rsa
and id_rsa.pub
files that allow me to authenticate with GitHub.
I am setting up a server (compute engine on GCP), and this server needs these keys because it needs to authenticate to my GitHub to pull a repo. Should I either:
id_rsa
, `id_rsa.pub that I have locally onto the server, and use those on the server.(2) seems like the right approach, but we are not certain.
Indeed option 2. As a best practice, you should not share the same private key.
Go ahead and generate a new SSH key following the docs: https://docs.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh