【发布时间】:2018-01-27 07:19:54
【问题描述】:
我使用三个 ssh 密钥访问 GitHub、GitLab 和 BitBucket。但我不知道为什么我只能访问 GitLab。我使用ssh -T 进行测试。 GitHub 和 Bitbucket 都显示了这个git@github.com: Permission denied (publickey)。我确信我已经为这些服务添加了密钥。
这是我的 .ssh 文件夹中的配置。 请帮帮我。
# --- Sourcetree Generated ---
Host Rukeith-GitHub
HostName github.com
User Rukeith
PreferredAuthentications publickey
IdentityFile /Users/rukeith/.ssh/Rukeith-GitHub
UseKeychain yes
AddKeysToAgent yes
# ----------------------------
# --- Sourcetree Generated ---
Host Rukeith-Bitbucket
HostName bitbucket.org
User Rukeith
PreferredAuthentications publickey
IdentityFile /Users/rukeith/.ssh/Rukeith-Bitbucket
UseKeychain yes
AddKeysToAgent yes
# ----------------------------
# GitLab.com server
Host gitlab.com
HostName gitlab.com
User Rukeith
PreferredAuthentications publickey
IdentityFile /Users/rukeith/.ssh/Rukeith-Gitlab
UseKeychain yes
AddKeysToAgent yes
# Private GitLab server
Host gitlab.company.com
HostName gitlab.company.com
User Rukeith
PreferredAuthentications publickey
IdentityFile /Users/rukeith/.ssh/Rukeith-Gitlab
UseKeychain yes
AddKeysToAgent yes
【问题讨论】: