“验证失败” Egit 和 GitHub 错误
我已经在 Eclipse Helios 上安装了 EGit 插件,并且尝试将其与我的 GitHub 帐户一起使用,但是当我尝试配置它时,出现“Auth Failed”错误。
我一直在谷歌上搜索它,但没有运气......这似乎是我的密码有问题,但据我所知 EGit 正在寻找正确的位置(/home/user/.ssh/id_rsa
),我通过 ssh
或 git
控制台客户端连接没有问题。
一些博客说这是 URI 和 Egit 解析器的问题,但我仍然没有找到解决方案。
I've installed EGit plugin at Eclipse Helios and I'm trying to use it with my GitHub account, but when I try to configure it I get an "Auth Failed" error.
I'd been googling it but no luck... it seems to be a problem with my passphrase but AFAIK EGit is looking at the right place (/home/user/.ssh/id_rsa
) and I've no problem in connect by ssh
or git
console client.
Some blogs says that is a problem with the URI and the Egit's parser but I still haven't found a solution.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(23)
我的答案可能已经过时,但希望它对某人有用。
在 Eclipse 中,转到 Window >
首选项>一般>网络连接>
SSH2(或者只需在中输入“SSH2”
首选项窗口过滤器框)。
在“密钥管理”中按选项卡
“生成 RSA 密钥...”按钮。您可以选择添加评论
(通常是电子邮件地址)和
您的密钥的密码。密码
将在身份验证期间使用
在 GitHub 上。
“生成 RSA 密钥...”下方的框
按钮)并将其添加到您的 GitHub
帐户。
将您的 RSA 私钥保存到
文件。默认情况下密钥存储在
SSH2 主目录(参见“常规”
选项卡)。
就是这样!现在您应该能够将代码推送到 GitHub 存储库。
My answer may be outdated but hopefully it can be useful for someone.
In your Eclipse go to Window >
Preferences > General > Network Connections >
SSH2 (or just type "SSH2" in
preferences window filter box).
In "Key Management" tab press
"Generate RSA Key..." button. Optionally you can add comment
(usually e-mail address) and
passphrase to your key. Passphrase
will be used during authentication
on GitHub.
box just below "Generate RSA Key..."
button) and add it to your GitHub
account.
to save your private RSA key into
file. By default keys are stored in
SSH2 home directory (see "General"
tab).
That's it! Now you should be able to push your code to GitHub repo.
我遇到了完全相同的问题,但我从 Eclipse 错误报告中找到了解决方法!
必须使用 ssh 可执行文件的路径设置名为 GIT_SSH 的环境变量 [1]。
例如在 Ubuntu Linux(10.10 64 位)上:
之后推送到 GitHub 存储库就可以正常工作。我使用 Eclipse Galileo 和 Indigo 对此进行了测试。
这个问题确实很烦人,而且解决方案也不是很好。目前,要使该解决方案至少对 Ubuntu 用户永久有效,必须使 env 变量永久化。可以通过将导出命令添加到 ~/.profile 或 ~/.bashrc [2] 来完成。例如:
然后重新启动Eclipse即可生效。
资料来源:
I had exactly same problem but I found the cure from a Eclipse bug report!
An environment variable named GIT_SSH must be set with a path to a ssh executable [1].
For example on Ubuntu Linux (10.10 64bit):
After that pushes to GitHub repository work like they should. I tested this with Eclipse Galileo and Indigo.
The problem is really annoying and the solution is far from nice. For now, making the solution permanent for, at least Ubuntu users, one must make the env variable permanent. It can be done by adding the export command to ~/.profile or ~/.bashrc [2]. For example:
And then restart Eclipse to take effect.
Sources:
我通过选择
http
作为协议并提供我的 GitHub 用户名和密码来解决这个问题。I resolved it by selecting
http
as the protocol and giving my GitHub username and password.在花了几个小时寻找这个问题的解决方案后,我终于通过进行 Eclipse 论坛。
步骤:
先决条件:使用默认配置安装 mysysgit。
1.创建文件 C:/Users/Username/.ssh/config (将“Username”替换为您的 Windows 7 用户名。(例如 C:/Users/John/.ssh/config))并将其放入其中:
2现在尝试在 Eclipse 中设置远程存储库。
干杯。它应该可以完美工作。
After spending hours looking for the solution to this problem, I finally struck gold by making the changes mentioned on an Eclipse Forum.
Steps:
Prerequisites: mysysgit is installed with default configuration.
1.Create the file C:/Users/Username/.ssh/config (Replace "Username" with your Windows 7 user name. (e.g. C:/Users/John/.ssh/config)) and put this in it:
2.Try setting up the remote repository now in Eclipse.
Cheers. It should work perfectly.
您需要安装 msysgit,安装后您需要打开 Git Bash 并在其中输入以下命令:
现在您生成的密钥位于
C:\Users\username\.ssh
中(在 Windows 7 中)。接下来,将公钥内容加载到 Github 上的项目
在 Eclipse 中打开
Window->Preferences->General->Network->SSH2
并将~/.ssh
设置为 SSH Home之后进入
密钥管理选项卡
并加载现有密钥 - 在~/.ssh
中设置您的私钥。之后你可以将你的项目推送到Github(但我设置的是ssh协议,而不是git+ssh)。
You need to install msysgit, after installing you need to open Git Bash and enter there these commands:
Now your generated keys are in
C:\Users\username\.ssh
(in Windows 7).Next you load the content of your public key to your project on Github
In Eclipse open
Window->Preferences->General->Network->SSH2
and set your~/.ssh
as SSH HomeAfter that go to
Key Management tab
and Load existing Key - set here your private key in~/.ssh
.After that you can push your project to Github (but I set ssh protocol, not git+ssh).
我通过将密钥添加到 ssh 解决了同样的问题;
然后输入密码并需要重新启动。
I solved same problem with adding my key to ssh;
then entered the passphrase and need restart.
对于使用 SSH 的 *nix 用户:
确保本地计算机上帐户的用户名与服务器上帐户的用户名没有不同。显然,eGit 似乎无法处理这个问题。例如,如果您本地计算机上的用户名是“john”,而您在服务器上使用的帐户名为“git”,则 egit 根本无法连接(无论如何对我来说)。我发现的唯一解决方法是确保本地计算机和服务器中具有相同的用户名。
For *nix users who are using SSH:
Make sure the username for your account on your local machine does not differ from the username for the account on the server. Apparently, eGit does not seem to be able to handle this. For example, if your username on your local machine is 'john', and the account you are using on the server is named 'git', egit simply fails to connect (for me anyways). The only work around I have found is to make sure you have identical usernames in both the local machine and the server.
在下面的链接中,我发布了对我有用的内容...
http://www.eclipse.org/forums/index.php?t=msg&goto=648905&S=9bcfa96ab726d744d41a19c7fb02d723#msg_648905
At the link below I posted what worked for me...
http://www.eclipse.org/forums/index.php?t=msg&goto=648905&S=9bcfa96ab726d744d41a19c7fb02d723#msg_648905
我的第四点:我的 SSH 密钥是在 Cygwin 中设置的,位于 C:\cygwin\home\.ssh,因此我将 SSH 指向此文件夹,而不是默认的 (Win7) C:\Users\。 \ssh,按照以下说明: http://wiki.eclipse.org/EGit/User_Guide /Remote#Eclipse_SSH_Configuration
并使用了 ssh 协议,并且工作正常。不过,尝试使用 git 协议仍然给出“git 协议不支持用户”。
My fourpenneth: my SSH keys were set up in Cygwin, at C:\cygwin\home\<user>.ssh, so I pointed SSH to this folder instead of the default (Win7) C:\Users\<user>\ssh, as per these instructions: http://wiki.eclipse.org/EGit/User_Guide/Remote#Eclipse_SSH_Configuration
and used the ssh protocol, and it works fine. Trying to use the git protocol still gives "User not supported on the git protocol", though.
对于像我一样已经设置了 ssh-keys 但仍然收到错误的人:
请确保您已设置了推送远程。当我遇到“无法获取远程存储库引用”问题时(“...密码...”和“推送...”对话框中的“身份验证失败”),它对我有用。
假设您已经:
使用 Github 设置您的 SSH 密钥(窗口 > 首选项 > 常规 > 网络连接 > SSH2)
设置本地存储库(您可以按照此指南进行操作)
创建了一个 Github 存储库(相同指南)
...操作方法如下:
For you who, like me, already did setup you ssh-keys but still get the errors:
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:
我使用夜间构建更新了插件: http://www.eclipse.org/egit/download/
通过更新,它对我有用。 (Eclipse Helios、Mac OS X)
I updated the plugin with the nightly builds: http://www.eclipse.org/egit/download/
With an update, it worked for me. (Eclipse Helios, Mac OS X)
您是否尝试过在 git+ssh 上使用 ssh 协议?
我遇到了同样的问题,并且解决了它,尽管官方文档告诉我们使用 git+ssh
Have you tried to use the ssh protocol instead on git+ssh ?
I've got the same problem, and that solved it, even though official documentation tells to use git+ssh
在 Windows 上,将
GIT_SSH
设置为 msys git 附带的 openssh 不起作用(Eclipse 在提交期间挂起)。将其设置为 TortoisePlink 解决了问题(我想原来的 plink 也可以工作)。额外的好处是现在 Eclipse 使用存储在 pageant 中的密钥。On Windows, setting
GIT_SSH
to openssh that comes with msys git didn't work (Eclipse hung during commit). Setting it to TortoisePlink solved the problem (I guess original plink would work as well). The added bonus is now Eclipse uses keys stored in pageant.我通过选择 https 作为协议,然后添加我的 github 用户名和密码来解决这个问题
I resolved it by selecting https as the protocol and then adding my github username and password
在您拥有存储库的 GIT 视图中,您将看到如下结构:
单击遥控器,右键单击存储库的 url,然后选择“更改凭据”。
In your GIT view where you have your repositories you will see a structure such as:
Click on remotes, right-click on the url of the repository there and select 'Change Credentials'.
我在 Eclipse 论坛 上找到了一篇帖子这为我解决了这个问题。
I found a post on the Eclipse forums that solved this problem for me.
我遇到了同样的问题,似乎是配置问题。 github mac osx 应用程序创建了一个名为 github_rsa 的 ssh 私钥
在 Eclipse 中转到
Window > >首选项>网络连接> SSH2
在常规选项卡中,您应该看到 SSH2 home
/Users/<您的用户名>/.ssh
您可能会看到 id_dsa、id_rsa 定义为私钥。单击“添加私钥”并选择位于
/Users/<您的用户名>/.ssh
的 github_rsaI was having the same issue which it seems was down to config issue. The github mac osx app had created a ssh private key called github_rsa
In your Eclipse go to
Window > Preferences > Network Connections > SSH2
In the general tab you should see SSH2 home
/Users/<you username>/.ssh
you'll probably see id_dsa,id_rsa defined as private keys.Click 'Add private key' and select github_rsa located
/Users/<you username>/.ssh
如果您有 PEM 文件:在 Eclipse 中转到Window >首选项>网络连接> SSH2,然后将 PEM 文件的路径添加到“私钥”,这应该可以解决问题。
IF YOU HAVE PEM FILE: In Eclipse go to Window > Preferences > Network Connections > SSH2, and then add path to your PEM file to "Private keys" and that should solve the problem.
我想公开一次我也修复了谷歌代码并得到了同样的错误。
从此视频开始,但在保存并发布时出现错误。
我看到有几个与此相关的问题。有些是 Windows 用户,他们是最幸运的,因为通常没有权限问题,有些是 Linux 用户。
我有一台用于移动开发的Mac,经常遇到这个问题。这个问题的根源是“平台独立”解决方案,它对 Mac 不够关心,并且无法访问存储证书、.pem 文件等的钥匙串。
我想要的只是不进行任何环境设置,也不进行命令行,只是简单的基于 GUI 的点击,就像普通用户一样。
一半是用 Eclipse Git 插件完成的,第二部分(推送到 Github)是用 Mac Github 完成的,
很好很简单: )
如果我开始学习这个本机应用程序,所有事情都可以完成,我只需要他的推送功能。
希望它能对 mac 用户有所帮助。
I wanted to make public once me too a google code fix and got the same error.
Started with This video, but at Save and publish got an error.
I have seen there are several question regarding to this. Some are Windows users, those are the most lucky, because usually no problems with permissions and some are Linux users.
I have a mac for mobile development use and very often meet this problems. The source for this problems is the "platform independent" solutions, which doesn't care enough for mac and they don't have access to keychain, where are stored the certificates, .pem files and so on.
All I wanted is to not make any environment settings, nor command line, just simple GUI based clicks, like a regular user.
Half part was done with Eclipse Git plugin, second part (push to Github) was done with Mac Github
Nice and easy :)
All can be done with with that native appp if I would start to learn it, I just need the push functionality from him.
Hoping it will help a mac user once.
我发现,如果我在 github 中设置两步身份验证,Eclipse 将无法连接到 Github - 这是有道理的,因为 github 中的两步身份验证要求您输入 SMS 中的号码(Eclipse 不会)没有这个信息)。
如果这是您的情况,您可以考虑在 github 中停用两步身份验证,看看是否有帮助。
I discovered that if I set up the two-step authentication in github, Eclipse isn't able to connect to Github - which makes sense because the two-step authentication in github requires you to input a number from an SMS (and Eclipse wouldn't have this information).
If this is your scenario, you might consider de-activating your two-step authentication in github, and see if that helps.
对于现有的 ssh 密钥,我认为这是 Eclipse Juno 3.8 中的一个错误。
我做了什么:
1)通过以下方式加载现有密钥:
窗口>首选项> “搜索 ssh”>密钥管理选项卡>加载现有密钥>选择您已有的私钥
2) 单击保存私钥按钮保存该密钥。让我们将其命名为 id_dsa_github
3) 现在检查推和拉是否正常工作。应该是的。
4) 现在,在常规选项卡中,删除私钥 id_dsa_github 并通过单击添加私钥按钮添加您以前的私钥
。现在您可以开始了。我猜,完成从 EGit 到注册的所有操作至少需要一次。
For existing ssh keys, I think that it's a bug in Eclipse Juno 3.8.
What I did:
1) Load the existing key by going to:
Window > Preferences > "Search ssh" > Key Management Tab > Load Existing Key > Select the private key which you already have
2) Save that key by clicking the button Save Private Key. Let's name it id_dsa_github
3) Now check if push and pull are working or not. It should be.
4) Now in the general tab, remove the private key id_dsa_github and add your previous private key by clicking the button Add private key
Now you are good to go. It's taking at least one time to do all the things from EGit to register, I guess.
我遇到了同样的问题。
我认为这与我的凭据和身份验证有关。
最后我意识到我配置的 URI 不是 HTTP 变体。
我试图使用 HTTP 配置推送到 Git 的 SSH URI。
中检查您的 URL
在Git Perspective > 遥控器>产地>配置获取>变化>确保协议为 HTTPS,URL 为 https 版本。
I run into the same issue.
I thought it's something to do with my credentials and authentication.
Then finally I realised it's the URI I configured is not HTTP variant.
I was trying to push to SSH URI of my Git with HTTP configuration.
Check your URL in
Git Perspective > Remotes > Origin > Configure Fetch > Change > Make sure the prtocal is HTTPS and the URL is https version.
我可以使用控制台来推/拉存储库,但在 Eclipse 中不行。
就我而言,Eclipse 似乎无法读取我的 SSH 私钥,我的密钥开头为:
我注意到我同事的密钥开头为:
我认为目前 Eclipse 无法采用这种新类型的密钥(OPENSSH 私钥)。
我通过以下方式解决了它:
使用命令重新生成 ssh 密钥:
这将使用旧的方式生成密钥:
所以它将从标题开始:
查看更多信息:
https://github.com/duplicati /duplicati/issues/3360
然后您可以使用以下命令在 eclilpse 中再次加载密钥
首选项->网络连接-> SSH2,点击“添加私钥”
(仍然选择您的私钥,即使您已经在私钥列表中看到了该名称,因为 eclipse 必须重新加载它)
I could use console to push/pull the repositories, but no in eclipse.
In my case, eclipse seems can't read my SSH private key, my key started with:
And I noticed my colleague's key started with:
I think currently eclipse can't take this new kind of key (OPENSSH PRIVATE KEY).
I solved it by:
Regenerate your ssh key by using command:
This will use the old way to generate the key:
so it will starts with the headers:
see more information on:
https://github.com/duplicati/duplicati/issues/3360
Then you can load the key again in eclilpse by using
Preferences -> Network connections -> SSH2, click "Add Private Key"
(still select your private key, even you already see the name in the list of private keys, because eclipse has to reload it)