search

Home  >  Q&A  >  body text

github - How does Git create multiple SSH KEYs on one machine and specify a certain KEY when using it?

The specific problem is that I may have these projects on git now, and then I want to use these projects through different ssh keys.
This requires generating multiple sshkeys on one machine, and then Different projects use different keys when pushing. Has this been used before?
Ask for advice

我想大声告诉你我想大声告诉你2790 days ago836

reply all(2)I'll reply

  • 高洛峰

    高洛峰2017-05-02 09:52:10

    No, generally using multiple ssh keys is managed by corresponding to multiple github accounts

    Generate the specified key ssh-keygen -t rsa -C "email address" -f ~/.ssh/youname

    Modify different hosts

    vim ~/.ssh/config

    reply
    0
  • 大家讲道理

    大家讲道理2017-05-02 09:52:10

    I don’t think there is such a usage. I think the poster’s request is very strange. However, there are some very practical functions on github that may be of some use to the poster. You can find these functions in the "Settings" menu of github:

    • SSH and GPG keys

    You can use multiple ssh-keys or gpg-keys on Github to associate your account, but it cannot meet the requirements of the original poster.

    • Personal access tokens

    This is a token-like function, a bit like Oauth's access token. This is how I understand it, that is, when we want to temporarily give a user permission to push to the warehouse, we can generate a Personal access token, grant the corresponding permissions, and then send this permission to that user, and that user can have Push permissions. Isn’t it a bit like a token?

    reply
    0
  • Cancelreply