How to setup Github SSH key on second computer

后端 未结 3 1757
北海茫月
北海茫月 2021-02-04 08:10

I\'ve got a Github account setup on one computer. I would like to also access my Github account on a second machine using the same SSH key I used for the first computer. How do

3条回答
  •  爱一瞬间的悲伤
    2021-02-04 08:57

    It'd be best to create a new private key if github allows you to have several associated with your account. (Sharing private keys among machines is very much like sharing passwords on multiple accounts.) But not all services allow multiple keys, so...

    You don't specify that you copied the private portion of the key; make sure you copy the private portion.

    You don't specify that you configured the ~/.ssh/config block to use the ~/.ssh/github key for the github.com host. Make sure you add a new block to your ~/.ssh/config file just like block on the machine you stole the key from.

    host github.com
        IdentityFile ~/.ssh/github
    

    (I don't know that the host is github.com -- if you use a different hostname, then use that.)

提交回复
热议问题