gpt4 book ai didi

git - `ssh -T` 到 VSTS(Azure Devops) 验证成功,但 `git clone` 失败

转载 作者:太空狗 更新时间:2023-10-29 13:06:59 24 4
gpt4 key购买 nike

我最近创建了第二个 key 来访问 Visual Studio Team Services,

ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

所以我现在有两个键:

id_github
id_vsts

这两个 key 似乎都已被 ssh 获取:ssh-add -l 列出了它们。

接下来,我将 id_vsts.pub 添加到我的 VSTS 帐户安全性中。 key 已正确添加,因为请求 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 的公钥,克隆成功。怎么回事?

最佳答案

在我的例子中,将 IdentitiesOnly yes 添加到 VSO 主机的 ~/.ssh/config 文件中就可以了。

关于git - `ssh -T` 到 VSTS(Azure Devops) 验证成功,但 `git clone` 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42705553/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com