【发布时间】:2014-09-11 05:07:15
【问题描述】:
尽管关于这个主题有很多问题,但我在尝试完成这项工作时遇到了麻烦。要么我错过了什么,要么他们不是我想要的。
我在 github 上有两个帐户 - account1 和 account2 及其各自的存储库
git@bitbucket.org:account1/repo.git
git@bitbucket.org:account2/repo.git
在我的 PC 上,我为 account1_id_rsa 和 account1_id_rsa 分别创建了 2 个单独的 SSH 密钥
当我将它们命名为 id_rsa 时,它们都单独工作,默认情况下它们都可以工作。但是我希望能够保留它们名为 account1_id_rsa 和 account1_id_rsa 的键,并且仍然能够推/拉,而无需根据我目前想要处理的存储库重命名每个键。
在阅读了许多关于该主题的 QA 之后,我仍然不知道该在我的 .ssh\config 中添加什么。到目前为止我已经尝试过
Host bitbucket
HostName bitbucket.org
IdentityFile ~/.ssh/account2_id_rsa
User account2
Host bitbucket
HostName bitbucket.org
IdentityFile ~/.ssh/account1_id_rsa
User account1
【问题讨论】: