“Auth Failed” error with EGit and GitHub

后端 未结 23 2428
灰色年华
灰色年华 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:03

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

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

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

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

    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:

    • [1] The solution is from this bug report
    • [2] Ubuntu Community Documentation for persistent environment variables:
    0 讨论(0)
  • 2020-11-28 02:04

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

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

    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!
    0 讨论(0)
  • 2020-11-28 02:06

    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)

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