使用 ssh config(ssh_config Recipes). 在 .ssh 目录下新建一个 config 文件,配置对应不同 Host 使用不同的 key. 例如: Host gitcafe.xxx HostName gitcafe.com User git IdentityFile ~/.ssh/id_rsa_gitcafe_xxx Host gitcafe.yyy HostName gitcafe.com User git IdentityFile ~/.ssh/id_rsa_gitcafe_yyy Host github.xxx HostName github.com IdentityFile ~/.ssh/id_rsa_github_xxx # 此行是代理配置,请无视 ProxyCommand ~/.ssh/socksproxywrapper.sh %h %p 比如 id_rsa_github_xxx 是你在 github 上 xxx 用户的 key, 就可以使用 git clone git@github.xxx:xxx/project.git 这样的方式来拉取 github 上的项目。
使用 ssh config(ssh_config Recipes). 在
.ssh
目录下新建一个config
文件,配置对应不同 Host 使用不同的 key. 例如:比如
id_rsa_github_xxx
是你在github
上xxx
用户的 key, 就可以使用这样的方式来拉取
github
上的项目。