【发布时间】:2015-09-01 05:49:11
【问题描述】:
当使用 SmartGit 作为 SSH 客户端时,它会缓存第一个选择的密钥。当你进一步尝试拉/推到另一个仓库时,SmartGit 会说"Access denied"。
SmartGit 将用于连接 Bitbucket 的密钥保存到首选项中。但所有 repos 都有地址:ssh://git@bitbucket.org 在 SmartGit 首选项中。
【问题讨论】:
当使用 SmartGit 作为 SSH 客户端时,它会缓存第一个选择的密钥。当你进一步尝试拉/推到另一个仓库时,SmartGit 会说"Access denied"。
SmartGit 将用于连接 Bitbucket 的密钥保存到首选项中。但所有 repos 都有地址:ssh://git@bitbucket.org 在 SmartGit 首选项中。
【问题讨论】:
作为mentioned here和this thread,你应该可以reference multiple private ssh keys in a %HOME%\.ssh\config file,将url更改为bitbucket1:userA/myrepo1,bitbucket2:userA/myrepo2。
这意味着:
%HOME%\.ssh\config file :配置:
host bitbucket1
user git
hostname bitbucket.org
port 22
identityfile /C/path/to/.ssh/key1
host bitbucket2
user git
hostname bitbucket.org
port 22
identityfile /C/path/to/.ssh/key2
/C/path/to/.ssh/ 中,您有一个key1(私有)和key1.pub(公共)ssh 文件(key2/key2.pub 相同)【讨论】: