search

Home  >  Q&A  >  body text

How to add multiple public keys to git? I host the project on github and osc

ssh-keygen -t rsa -C "your_email@example.com"

This method directly overwrites the public key under ~/.ssh/id_rsa.pub.
I want to add multiple public keys, how do I do it/

世界只因有你世界只因有你2827 days ago757

reply all(4)I'll reply

  • 巴扎黑

    巴扎黑2017-05-02 09:42:46

    ssh-keygen -f ~/.ssh/osckeyfile

    Then add the ~/.ssh/config file, configure the git domain name, and your ssh private key path above

    Host git.oschina.net # 我没用过,你换osc的域名
        IdentityFile ~/.ssh/osckeyfile

    PS: Multiple websites can use the same key and do not have to be separated

    reply
    0
  • 仅有的幸福

    仅有的幸福2017-05-02 09:42:46

    The public key of a machine should be unique

    reply
    0
  • 怪我咯

    怪我咯2017-05-02 09:42:46

    Please refer to:
    http://stackoverflow.com/ques...

    reply
    0
  • 仅有的幸福

    仅有的幸福2017-05-02 09:42:46

    1. Can share a public key

    2. Different key names will not be overwritten

    reply
    0
  • Cancelreply