【发布时间】:2017-03-09 21:15:49
【问题描述】:
我最近创建了第二个访问 Visual Studio Team Services 的密钥,
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
所以我现在有两个键:
id_github
id_vsts
这两个键似乎都已被 ssh:ssh-add -l 列出。
接下来,我将id_vsts.pub 添加到我的 VSTS 帐户安全性中。密钥已正确添加,因为请求 SSH 终端访问的身份验证正确:
Authentication for user with identifier "" was successful against account "my_account".
Shell is not supported.
但是,当我git clone ssh://[user]@[host]:22/[repo] 时,它失败了!
Your Git command did not succeed.
Details:
Public key authentication failed.
在一个意外的转折中,如果我使用id_github 的公钥,克隆成功。怎么回事?
【问题讨论】:
-
你做了哪些详细步骤?您是否将公钥添加到 VSTS(配置文件>安全>SSH 公钥)visualstudio.com/en-us/docs/git/…
-
用更详细的步骤更新问题,让我知道这是否有助于@starain-MSFT
-
您是否强制 SSH 客户端使用给定的私钥? cyberciti.biz/faq/…
-
不,我不强迫客户。我使用的命令是
git clone ssh://[user]@[host]:22/[repo]。使用“复制到剪贴板”图标复制 url。我的印象是所有私钥都用于尝试进行身份验证。 -
如果你强制客户端使用那个私钥会产生什么结果。 SSH -我?
标签: git ssh azure-devops azure-pipelines