gpt4 book ai didi

git - 无法通过 SSH 克隆 Azure DevOps 存储库,需要密码

转载 作者:行者123 更新时间:2023-12-04 10:14:41 24 4
gpt4 key购买 nike

我很难尝试通过 SSH 将 Azure DevOps 私有(private)存储库克隆到运行 Ubuntu (18.04) 的本地计算机。

关注 this Microsoft documentation ,我使用 ssh-keygen 创建了 SSH key 并提供密码,在 下将公钥添加到 Azure DevOps用户设置 > 安全 > SSH 公钥 ,并在终端中运行 git clone git@ssh.dev.azure.com:v3/<organization-name>/<repo-name>使用 中提供的 url克隆库 Azure DevOps 的选项。

它返回了 RSA key 指纹,要求确认并警告我它将主机永久添加到已知主机列表中。出现要求输入密码以访问本地私钥的提示,我正确输入后,终端输出以下内容,要求输入密码:sign_and_send_pubkey: signing failed: agent refused operation
git@ssh.dev.azure.com's password:

我尝试了创建 SSH key 时使用的密码,尝试了我的
Azure DevOps 帐户的密码,甚至我的 Ubuntu 的用户密码,都不起作用。
结果:git@ssh.dev.azure.com: Permission denied (password,publickey).
fatal: Could not read from remote repository.

文档中没有提供更多信息,我找不到任何解决方案,我在这里遗漏了什么吗?任何帮助,将不胜感激。

最佳答案

Unable to clone Azure DevOps repository via SSH, password required



众所周知,如果公钥认证失败,它会要求输入密码。

因此,应该是因为公钥认证失败,所以它要求您输入帐户的密码。请确保:
  • 当您使用命令将公钥复制到 Azure Devops 中时,
    键的末尾会有一个空行,删除它。
  • 确保在您的本地机器中,只有一对 SSH key 。
  • 确保您的私钥具有以下格式:
    -----BEGIN RSA PRIVATE KEY-----

    *
    *
    *

    -----END RSA PRIVATE KEY-----

  • 此外,根据 similar on the github ,我们可以尝试使用以下条目创建配置文件:
    Host vs-ssh.visualstudio.com
    User username
    IdentityFile ~/.ssh/id_rsa
    IdentitiesOnly yes

    Host ssh.dev.azure.com
    User username
    IdentityFile ~/.ssh/id_rsa
    IdentitiesOnly yes

    要创建此配置文件,您可以关注 this document了解更多详情。

    希望这可以帮助。

    关于git - 无法通过 SSH 克隆 Azure DevOps 存储库,需要密码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61130895/

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