“Auth Failed” error with EGit and GitHub

后端 未结 23 2435
灰色年华
灰色年华 2020-11-28 01:26

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 b

相关标签:
23条回答
  • 2020-11-28 02:15

    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.

    0 讨论(0)
  • 2020-11-28 02:17

    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 gennad.zlobin@gmail.com (your email)
    $ ssh-keygen -C "gennad.zlobin@gmail.com" -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).

    0 讨论(0)
  • 2020-11-28 02:18

    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.

    0 讨论(0)
  • 2020-11-28 02:19

    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.

    0 讨论(0)
  • 2020-11-28 02:20

    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.

    0 讨论(0)
  • 2020-11-28 02:21

    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.

    0 讨论(0)
提交回复
热议问题