Egit 拒绝接受 id_rsa
我是第一次尝试在 Eclipse 中设置 egit 的 git 用户,这样我就可以继续通过 Eclipse 轻松编码。问题是,每次我尝试通过 egit 克隆存储库时,都会出现错误“无法列出可用分支。原因:ssh://[电子邮件受保护]:22 密码/Users/elifinkelshteyn/.ssh/id_rsa。”这真的很奇怪,因为我可以使用相同的 id_rsa 通过终端进行克隆,而且我已经在 Eclipse ssh 属性中验证了它正在尝试使用正确的密钥。什么给?
I'm a first time git user trying to setup egit in Eclipse so I can continue to easily code through Eclipse. Problem is, every time I try to clone a repo through egit, it gives me the error "Cannot list available branches. Reason: ssh://[email protected]:22 Passphrase for /Users/elifinkelshteyn/.ssh/id_rsa." This is really strange as I can clone through terminal using that same id_rsa just fine, and I've verified in Eclipse ssh properties that it is trying to use the correct key. What gives?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
如果提示输入密码,但 Eclipse 不接受密码,请尝试以下操作:
将 GIT_SSH 环境变量设置为 ssh 客户端,例如,通过添加
到
Mac OSX 上的 .bash_rc,打开终端并键入:
添加 KEY= GIT_SSH 与 VALUE=/usr/bin/ssh
并保存文件。
重新登录您的帐户后,它应该可以工作。
if you get a prompt for the passphrase but eclipse doesn't accept the passphrase, try the following:
set the GIT_SSH environment variable to your ssh client e.g. by adding
to your .bash_rc
on Mac OSX, open terminal and type:
add a KEY=GIT_SSH with VALUE=/usr/bin/ssh
and save the file.
After relogin to your account, it should work.
只是为了确认:这是一个当前错误(问题 353561)。< br>
并且密码可能仍然是一个问题,具体取决于创建密钥时使用的加密(bug 326526)。
但是,应该支持密码(正如 Egit 用户指南提到的)。
Just to confirm: this is a current bug (issue 353561).
And passphrase might still be a problem depending on the encryption you used when creating your key (bug 326526).
However, passphrase are supposed to be supported (as the Egit user guide mentions).
正如 VonC 所说,这是一个错误,EGit 使用的 SSH 实现只能处理 3DES 加密私钥之外的任何内容。
如果您像我一样,您有 AES 加密密钥,因此它无法解密它们。
该错误报告中有一条评论,这里有一个直接指向该评论的链接 https ://bugs.eclipse.org/bugs/show_bug.cgi?id=326526#c9
该评论提供了一个可行的解决方法:最新版本的 EGit 支持 GIT_SSH 环境变量,将其设置为 /usr/bin/ssh 甚至 plink.exe(如果您使用的是 Windows)应该可以解决问题。
As VonC says, it's a bug that the SSH implementation that EGit uses can't handle anything but 3DES encrypted private keys.
If you're like me, you have AES encrypted keys, so it just fails to decrypt them.
There is a comment in that bug report, here's a link directly to the comment https://bugs.eclipse.org/bugs/show_bug.cgi?id=326526#c9
That comment provided a working workaround: recent versions of EGit honour the GIT_SSH environment variable, setting that to /usr/bin/ssh or even plink.exe if you're on windows should solve the issue.
自OP以来已经过去了相当长的一段时间,我仍然遇到同样的问题。对于仍然遇到此问题的人,这可能会有所帮助:
确保您设置了推送遥控器。当我遇到“无法获取远程存储库引用”问题时(“...密码...”和“推送...”对话框中的“身份验证失败”),它对我有用。
假设您已经:
使用 Github 设置您的 SSH 密钥(窗口 > 首选项 > 常规 > 网络连接 > SSH2)
设置您的本地存储库(您可以按照本指南)
创建了一个 Github 存储库(相同指南)
。 .. 操作方法如下:
A considerable amount of time has passed since the OP and I still had the same problem. For those who still has this problem, this might help:
Make sure you did setup a push remote. It worked for me when I got both the Cannot get remote repository refs-problems ("... Passphrase for..." and "Auth fail" in the "Push..." dialog).
Provided that you already:
Setup your SSH keys with Github (Window > Preferences > General > Network Connections > SSH2)
Setup your local repository (you can follow this guide for that)
Created a Github repository (same guide)
... here's how you do it:
看起来您的 /Users/elifinkelshteyn/.ssh/id_rsa 文件需要密码,并且我不确定 Eclipse 中的 ssh 实现是否知道如何提示您输入密码。让我感到很兴奋的是,你可能需要为 mac 安装一个 ssh-auth 软件包,这样它才能进行提示,如果你能找到更多相关信息,那可能是理想的选择。然而,短期内的解决方法是生成一个不使用密码的新 rsa 密钥,将其上传到 github,然后设置 eclipse 使用它。
It looks like your /Users/elifinkelshteyn/.ssh/id_rsa file requires a password, and I'm not sure that the ssh implementation in Eclipse knows how to prompt you for one. It's tickling the back of my brain that there's probably an ssh-auth package you need to install for the mac so that it can prompt, and if you can find out more about that, it's probably ideal. However, a workaround in the short term is to generate a new rsa key that doesn't use a password, upload that to github, and set eclipse to use it.