0

I'm trying to share the ssh I created on two machines, one my work laptop and the other my personal laptop in order to be able to make changes and commit to my repos, and also update the activity on my Github timeline. I don't want to create to ssh keys on separate machines if I'm working on two laptops for the same Github account. I came across this post on where to find the key and what to send, but I'm not sure if I can simply use just the rsa.pub file (the public key) by itself and share this same key on both machines, or if I need to copy the entire .ssh folder with it's contents: id_ed25519, id_ed25529.pub and known_hosts files. The ssh was created on my old laptop, which I'm still using, but I'm not sure where to put the key on my new laptop and where it goes. I'm assuming a .ssh folder at the root?

JackJack
  • 181
  • 1
  • 1
  • 20
  • You need to have the private key, so only copying the public key is not sufficient. – Mark Rotteveel May 22 '22 at 16:50
  • Recall that the public key is what you give to *other people* (like GitHub) to verify you are who you say you are. That's why it's called "public". You need the *private* key locally to prove that it matches the public key you gave to someone else. You don't need the public key at all locally. – larsks May 22 '22 at 16:52
  • With that being said, if I own the github account, how do I get the private key on both machines? Any links would help. I can't find any articles where someone has actually done this. It seems that if I create separate ssh keys for the same Github account, my contribution history does not update depending on which machine I'm using. – JackJack May 22 '22 at 19:01
  • 1
    On linux the default location is normally root i.e. ~/.ssh/id_rsa (private key) and ~/.ssh/id_rsa.pub (public key). You only need the private key on your local machine to auth to github. On mac the default when you use ssh-keygen is normally /Users/USERNAME/.ssh/id_rsa and same path with id_rsa.pub. – sc-leeds May 26 '22 at 08:31

0 Answers0