“验证失败” Egit 和 GitHub 错误

发布于 2024-09-16 17:19:44 字数 295 浏览 7 评论 0原文

我已经在 Eclipse Helios 上安装了 EGit 插件,并且尝试将其与我的 GitHub 帐户一起使用,但是当我尝试配置它时,出现“Auth Failed”错误。

我一直在谷歌上搜索它,但没有运气......这似乎是我的密码有问题,但据我所知 EGit 正在寻找正确的位置(/home/user/.ssh/id_rsa),我通过 sshgit 控制台客户端连接没有问题。

一些博客说这是 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(23

蓦然回首 2024-09-23 17:19:44

我的答案可能已经过时,但希望它对某人有用。

  1. 在 Eclipse 中,转到 Window >
    首选项>一般>网络连接>
    SSH2
    (或者只需在中输入“SSH2”
    首选项窗口过滤器框)。

  2. “密钥管理”中按选项卡
    “生成 RSA 密钥...”按钮。您可以选择添加评论
    (通常是电子邮件地址)和
    您的密钥的密码。密码
    将在身份验证期间使用
    在 GitHub 上。

  3. 复制您生成的公钥(在
    “生成 RSA 密钥...”下方的框
    按钮)并将其添加到您的 GitHub
    帐户。
  4. “保存私钥...”按钮
    将您的 RSA 私钥保存到
    文件。默认情况下密钥存储在
    SSH2 主目录(参见“常规”
    选项卡)。

就是这样!现在您应该能够将代码推送到 GitHub 存储库。

My answer may be outdated but hopefully it can be useful for someone.

  1. In your Eclipse go to Window >
    Preferences > General > Network Connections >
    SSH2
    (or just type "SSH2" in
    preferences window filter box).

  2. 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.

  3. Copy your generated public key (in a
    box just below "Generate RSA Key..."
    button) and add it to your GitHub
    account.
  4. Press "Save Private Key..." button
    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.

七七 2024-09-23 17:19:44

我遇到了完全相同的问题,但我从 Eclipse 错误报告中找到了解决方法!

必须使用 ssh 可执行文件的路径设置名为 GIT_SSH 的环境变量 [1]。

例如在 Ubuntu Linux(10.10 64 位)上:

> export GIT_SSH=/usr/bin/ssh
> eclipse

之后推送到 GitHub 存储库就可以正常工作。我使用 Eclipse Galileo 和 Indigo 对此进行了测试。

这个问题确实很烦人,而且解决方案也不是很好。目前,要使该解决方案至少对 Ubuntu 用户永久有效,必须使 env 变量永久化。可以通过将导出命令添加到 ~/.profile 或 ~/.bashrc [2] 来完成。例如:

> cd ~
> echo "export GIT_SSH=/usr/bin/ssh" >> .profile

然后重新启动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):

> export GIT_SSH=/usr/bin/ssh
> eclipse

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:

> cd ~
> echo "export GIT_SSH=/usr/bin/ssh" >> .profile

And then restart Eclipse to take effect.

Sources:

你的笑 2024-09-23 17:19:44

我通过选择 http 作为协议并提供我的 GitHub 用户名和密码来解决这个问题。

I resolved it by selecting http as the protocol and giving my GitHub username and password.

还不是爱你 2024-09-23 17:19:44

在花了几个小时寻找这个问题的解决方案后,我终于通过进行 Eclipse 论坛

步骤:

先决条件:使用默认配置安装 mysysgit。

1.创建文件 C:/Users/Username/.ssh/config (将“Username”替换为您的 Windows 7 用户名。(例如 C:/Users/John/.ssh/config))并将其放入其中:

Host github.com
HostName github.com
User git
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa

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:

Host github.com
HostName github.com
User git
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa

2.Try setting up the remote repository now in Eclipse.

Cheers. It should work perfectly.

叹沉浮 2024-09-23 17:19:44

您需要安装 msysgit,安装后您需要打开 Git Bash 并在其中输入以下命令:

$ git config --global user.name "Gennadiy Zlobin" (your name)
$ git config --global user.email [email protected] (your email)
$ ssh-keygen -C "[email protected]" -t rsa (your email)

现在您生成的密钥位于 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:

$ git config --global user.name "Gennadiy Zlobin" (your name)
$ git config --global user.email [email protected] (your email)
$ ssh-keygen -C "[email protected]" -t rsa (your email)

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 Home

After 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).

弄潮 2024-09-23 17:19:44

我通过将密钥添加到 ssh 解决了同样的问题;

ssh-add ~/.ssh/id_rsa 

然后输入密码并需要重新启动。

I solved same problem with adding my key to ssh;

ssh-add ~/.ssh/id_rsa 

then entered the passphrase and need restart.

熊抱啵儿 2024-09-23 17:19:44

对于使用 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.

∝单色的世界 2024-09-23 17:19:44

我的第四点:我的 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.

空心空情空意 2024-09-23 17:19:44

对于像我一样已经设置了 ssh-keys 但仍然收到错误的人:

请确保您已设置了推送远程。当我遇到“无法获取远程存储库引用”问题时(“...密码...”和“推送...”对话框中的“身份验证失败”),它对我有用。

假设您已经:

  1. 使用 Github 设置您的 SSH 密钥(窗口 > 首选项 > 常规 > 网络连接 > SSH2)

  2. 设置本地存储库(您可以按照此指南进行操作)

  3. 创建了一个 Github 存储库(相同指南

...操作方法如下:

  • 转到 Git 存储库视图(窗口 > 显示视图 > 其他 > Git 存储库)
  • 展开您的存储库并右键单击远程 --> “创建远程”
  • “远程名称”:来源,“配置推送”:选中 --> 单击“确定”
  • 单击“更改...”按钮
  • 粘贴您的 git URI 并选择协议ssh - -> 单击“完成”
  • 现在,单击“保存并推送”,现在您应该会收到密码提示 --> 在此处输入公钥密码(前提是您确实(并且应该)为您的公钥设置了密码)--> 点击“确定”
  • 现在您应该会看到一个确认窗口,显示“已推送到 YourRepository - origin” --> 点击“确定”
  • 推送到上游,但这次使用“配置的远程存储库”作为您的目标 Git 存储库
  • 去给自己喝杯咖啡吧!

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:

  1. Setup your SSH keys with Github (Window > Preferences > General > Network Connections > SSH2)

  2. Setup your local repository (you can follow this guide for that)

  3. Created a Github repository (same guide)

... here's how you do it:

  • Go to the Git Repositories view (Window > Show View > Other > Git Repositories)
  • Expand your Repository and right click Remotes --> "Create Remote"
  • "Remote Name": origin, "Configure push": checked --> click "OK"
  • Click the "Change..." button
  • Paste your git URI and select protocol ssh --> click "Finish"
  • Now, click "Save and Push" and NOW you should get a password prompt --> enter the public key passphrase here (provided that you DID (and you should) setup a passphrase to your public key) --> click "OK"
  • Now you should get a confirmation window saying "Pushed to YourRepository - origin" --> click "OK"
  • Push to upstream, but this time use "Configured remote repository" as your Destination Git repository
  • Go get yourself a well earned cup of coffee!
哆兒滾 2024-09-23 17:19:44

我使用夜间构建更新了插件: 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)

耀眼的星火 2024-09-23 17:19:44

您是否尝试过在 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

幸福%小乖 2024-09-23 17:19:44

在 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.

空袭的梦i 2024-09-23 17:19:44

我通过选择 https 作为协议,然后添加我的 github 用户名和密码来解决这个问题

I resolved it by selecting https as the protocol and then adding my github username and password

穿透光 2024-09-23 17:19:44

在您拥有存储库的 GIT 视图中,您将看到如下结构:

  • 分支、
  • 标签、
  • 引用
  • 遥控器
  • 等...

单击遥控器,右键单击存储库的 url,然后选择“更改凭据”。

In your GIT view where you have your repositories you will see a structure such as:

  • branches
  • tags
  • references
  • remotes
  • etc...

Click on remotes, right-click on the url of the repository there and select 'Change Credentials'.

不弃不离 2024-09-23 17:19:44

我在 Eclipse 论坛 上找到了一篇帖子这为我解决了这个问题。

I found a post on the Eclipse forums that solved this problem for me.

彼岸花ソ最美的依靠 2024-09-23 17:19:44

我遇到了同样的问题,似乎是配置问题。 github mac osx 应用程序创建了一个名为 github_rsa 的 ssh 私钥

在 Eclipse 中转到 Window > >首选项>网络连接> SSH2

在常规选项卡中,您应该看到 SSH2 home /Users/<您的用户名>/.ssh 您可能会看到 id_dsa、id_rsa 定义为私钥。

单击“添加私钥”并选择位于 /Users/<您的用户名>/.ssh 的 github_rsa

I 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

浅忆流年 2024-09-23 17:19:44

如果您有 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.

满地尘埃落定 2024-09-23 17:19:44

我想公开一次我也修复了谷歌代码并得到了同样的错误。
视频开始,但在保存并发布时出现错误。
我看到有几个与此相关的问题。有些是 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.

许仙没带伞 2024-09-23 17:19:44

我发现,如果我在 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.

独留℉清风醉 2024-09-23 17:19:44

对于现有的 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.

忘你却要生生世世 2024-09-23 17:19:44

我遇到了同样的问题。

我认为这与我的凭据和身份验证有关。

最后我意识到我配置的 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.

习ぎ惯性依靠 2024-09-23 17:19:44

我可以使用控制台来推/拉存储库,但在 Eclipse 中不行。
就我而言,Eclipse 似乎无法读取我的 SSH 私钥,我的密钥开头为:

-----BEGIN OPENSSH PRIVATE KEY-----

我注意到我同事的密钥开头为:

-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED

我认为目前 Eclipse 无法采用这种新类型的密钥(OPENSSH 私钥)。

我通过以下方式解决了它:
使用命令重新生成 ssh 密钥:

ssh-keygen -m PEM -t rsa -b 2048

这将使用旧的方式生成密钥:
所以它将从标题开始:

-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED

查看更多信息:

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:

-----BEGIN OPENSSH PRIVATE KEY-----

And I noticed my colleague's key started with:

-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED

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:

ssh-keygen -m PEM -t rsa -b 2048

This will use the old way to generate the key:
so it will starts with the headers:

-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED

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)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文