Can you and is it advisable to use the same ssh ke

2019-05-28 17:59发布

问题:

Can you use the same ssh key for different version control hosting services?

And if you can, what are the pros and cons?

Scenario: I have ssh keys that I am using on my computer, can I and should I use the same ssh keys with gitlab/gitbucket on the same computer?

回答1:

No, it is not advisable: a private key should remain used for only one service, that way you can revoke/change it just for that service.

What you can do is set up a ~/.ssh/config file in which you can associate the right private key with the right host, as explained here.