Egit Refuses to accept id_rsa

前端 未结 5 2627
后悔当初
后悔当初 2021-02-20 18:39

I\'m a first time git user trying to setup egit in Eclipse so I can continue to easily code through Eclipse. Problem is, every time I try to clone a repo through egit, it gives

相关标签:
5条回答
  • 2021-02-20 19:02

    if you get a prompt for the passphrase but eclipse doesn't accept the passphrase, try the following:

    set the GIT_SSH environment variable to your ssh client e.g. by adding

    export GIT_SSH=/usr/bin/ssh
    

    to your .bash_rc

    on Mac OSX, open terminal and type:

    cd
    mkdir .MacOSX
    cd .MacOSX
    echo "" > environment.plist
    open environment.plist
    

    add a KEY=GIT_SSH with VALUE=/usr/bin/ssh and save the file.

    After relogin to your account, it should work.

    0 讨论(0)
  • 2021-02-20 19:06

    It looks like your /Users/elifinkelshteyn/.ssh/id_rsa file requires a password, and I'm not sure that the ssh implementation in Eclipse knows how to prompt you for one. It's tickling the back of my brain that there's probably an ssh-auth package you need to install for the mac so that it can prompt, and if you can find out more about that, it's probably ideal. However, a workaround in the short term is to generate a new rsa key that doesn't use a password, upload that to github, and set eclipse to use it.

    0 讨论(0)
  • 2021-02-20 19:17

    A considerable amount of time has passed since the OP and I still had the same problem. For those who still has this problem, this might help:

    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)
  • 2021-02-20 19:18

    Just to confirm: this is a current bug (issue 353561).
    And passphrase might still be a problem depending on the encryption you used when creating your key (bug 326526).

    However, passphrase are supposed to be supported (as the Egit user guide mentions).

    0 讨论(0)
  • 2021-02-20 19:18

    As VonC says, it's a bug that the SSH implementation that EGit uses can't handle anything but 3DES encrypted private keys. If you're like me, you have AES encrypted keys, so it just fails to decrypt them. There is a comment in that bug report, here's a link directly to the comment https://bugs.eclipse.org/bugs/show_bug.cgi?id=326526#c9

    That comment provided a working workaround: recent versions of EGit honour the GIT_SSH environment variable, setting that to /usr/bin/ssh or even plink.exe if you're on windows should solve the issue.

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