可以吗,建议对github和gitlab/gitbucket使用相同的ssh键 [英] Can you and is it advisable to use the same ssh key for github and gitlab/gitbucket

查看:48
本文介绍了可以吗,建议对github和gitlab/gitbucket使用相同的ssh键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您可以对不同的版本控制托管服务使用相同的ssh密钥吗?

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

如果可以的话,优点和缺点是什么?

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

方案::我有在计算机上使用的ssh密钥,我可以并且应该在同一台计算机上将相同的ssh密钥与gitlab/gitbucket一起使用吗?

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?

推荐答案

不,这是不可取的:私钥应仅用于一项服务,这样您就可以仅针对该服务撤消/更改它.

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.

您可以做的是设置一个 ~/.ssh/config 文件,您可以在其中关联具有正确主机的正确私钥,例如

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.

这篇关于可以吗,建议对github和gitlab/gitbucket使用相同的ssh键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆