【问题标题】:Cannot use different ssh key to access Git service无法使用不同的 ssh 密钥访问 Git 服务
【发布时间】: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

【问题讨论】:

    标签: git ssh


    【解决方案1】:

    我发现解决方案是自己使用ssh-add -K key。 一个小问题。

    【讨论】:

      猜你喜欢
      • 2019-12-07
      • 2014-12-06
      • 2013-05-16
      • 2021-05-13
      • 1970-01-01
      • 1970-01-01
      • 2016-07-05
      • 1970-01-01
      • 2023-01-05
      相关资源
      最近更新 更多