【问题标题】:git auth fails after eclipse update 2021-03eclipse 更新 2021-03 后 git auth 失败
【发布时间】:2021-03-22 23:46:12
【问题描述】:

在最近的 Eclipse 更新 2021-03 之后,所有 bitbucket.org 存储库都无法再拉/推:

Pulling 1 repository
   git@bitbucket.org:Acountxxx/Repoxxx.git: Cannot log in at bitbucket.org:22
   git@bitbucket.org:Acountxxx/Repoxxx.git: Cannot log in at bitbucket.org:22

我尝试在新的工作空间中克隆存储库,同样使用 ssh:

URI:ssh://bitbucket.org/REPOxxxx.git
主办方:bitbucket.org
存储库路径:REPOxxxxx.git 协议:ssh
端口:空白
用户:空白
密码:空白

遇到同样的异常:

ssh://bitbucket.org:Acountxxx/Repoxxx.git: Cannot log in at bitbucket.org:22

CMD git pullgit push 仍然可以正常工作。

有没有人遇到同样的问题并找到了解决方案?

环境:
视窗 10
git 版本 2.30.1.windows.1
日食 2021-03
EGit:5.11.0.202103091610-r

EDIT:也很有趣,其他存储库,例如从 github 仍然可以正常工作。对于 bitbucket 上的私有和公共存储库,此行为是相同的。

【问题讨论】:

  • 哪个 EGit/JGit 版本?您的私钥是否在 General > Network Connections > SSH2 的首选项中配置?还是设置了环境变量GIT_SSH?新的工作空间有用吗?
  • 添加了更多信息。 GIT_SSH 未设置,但在存储库工作时也未设置预更新。新的工作空间也不起作用。
  • 感谢您接受我的回答,但您详细的自我回答可能对其他人更有帮助,因此应显示在顶部。

标签: git eclipse ssh bitbucket egit


【解决方案1】:

根据howlger关于Known_problems的信息->Bug 572056 - Cannot work with Bitbucket after Eclipse update我做了以下解决方法。

打开 CMD 并运行:

ssh-keygen -t ed25519

这创建了一个新密钥:C:/Users/USER/.ssh/id_ed25519

登录到 bitbucket 并将公钥文件 (C:/Users/USER/.ssh/id_ed25519.pub) 的内容添加为新密钥:
https://bitbucket.org/account/settings/ssh-keys/

在 Eclipse 首选项中配置此键:

然后再次拉和推。一项小研究表明,ed25519 比默认的 RSA 算法更安全、更快,因此实际上是一个非常好的解决方案。

【讨论】:

    【解决方案2】:

    您可能面临以下 EGit/JGit 5.11 的已知问题,有两种解决方法(请参阅New and Noteworthy of EGit 5.11):

    Bug 572056:使用 RSA 密钥连接到 bitbucket.org: JGit 中使用的 SSH 库已从 Apache MINA sshd 2.4.0 更改 到 2.6.0。 sshd 2.6.0 默认为 RSA 做公钥认证 仅使用 rsa-sha2-512 签名算法的密钥。服务器 不了解该机制,但只了解较旧的 ssh-rsa 然后签名算法将拒绝登录。

    • 已知受影响的 git 服务器:bitbucket.org、AWS Code Commit
    • 解决方法:
      • 使用 ed25519 键。
      • 通过环境变量GIT_SSH使用外部SSH。

    【讨论】:

      猜你喜欢
      • 2021-07-23
      • 2022-01-17
      • 1970-01-01
      • 2014-12-26
      • 2021-10-13
      • 2021-07-03
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多