【问题标题】:Cannot establish ssh connection to Bitbucket repository on Windows无法在 Windows 上建立与 Bitbucket 存储库的 ssh 连接
【发布时间】:2020-07-16 23:05:51
【问题描述】:

我在 Windows 10 上生成 ssh 密钥对,将私钥添加到 ssh-add 客户端将公钥添加到 Bitbucket。

我运行ssh -T git@bitbucket.org 来检查一切是否正常并有下一个输出

logged in as myusername
You can use git or hg to connect to Bitbucket. Shell access is disabled

我尝试使用 ssh git clone git@bitbucket.org:myusername/test.git 克隆存储库并遇到身份验证问题

Cloning into 'test'...
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

任何想法可能是什么问题?只有一个想法,在生成 ssh 密钥对时,我将其保存到 .ssh 文件夹,但写入了不同的文件名。 ssh-add -l 表示密钥已加载

2048 SHA256:xxxxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxxxxxx C:\......\.ssh\id_bitbucket_rsa (RSA)

【问题讨论】:

    标签: git ssh bitbucket


    【解决方案1】:

    this answer 的帮助下,我发现如果我们使用自定义 ssh 密钥对名称,我们需要将其添加到 git 的 ssh 配置中。

    我添加后

    AddKeysToAgent yes
    IdentityFile ~/.ssh/id_rsa
    IdentityFile ~/.ssh/id_bitbucket_rsa 
    

    c:\Program Files\Git\etc\ssh\ 我可以克隆那个存储库。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-10-28
      • 2019-05-12
      • 2016-10-13
      • 2021-03-13
      • 2015-04-20
      • 2020-10-12
      • 1970-01-01
      相关资源
      最近更新 更多