“Auth Failed” error with EGit and GitHub

2020-01-25 03:14发布

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.

23条回答
疯言疯语
2楼-- · 2020-01-25 04:14

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.

查看更多
\"骚年 ilove
3楼-- · 2020-01-25 04:16

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!
查看更多
再贱就再见
4楼-- · 2020-01-25 04:17

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.

查看更多
在下西门庆
5楼-- · 2020-01-25 04:21

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.

查看更多
一纸荒年 Trace。
6楼-- · 2020-01-25 04:21

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

查看更多
登录 后发表回答