Eclipse更新2021-03后gitauth失败
在最近的 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
在CMDgit pull或git push仍然做工精细。
有没有人遇到同样的问题并找到解决方案?
环境:
Windows 10
git 版本 2.30.1.windows.1
Eclipse 2021-03
EGit:5.11.0.202103091610-r
编辑:同样有趣的是,来自 github 的其他存储库仍然可以正常工作。此行为对于 bitbucket 上的私有和公共存储库是相同的。
回答
根据howlger关于Known_problems -> Bug 572056 - Eclipse 更新后无法使用Bitbucket 的信息,我做了以下解决方法解决了这个问题。
打开 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 算法更安全、更快,因此实际上是一个非常好的解决方案。