23

I am using Eclipse Indigo RC4 with EGit (bundled). I have a project which I have committed to my local repository, and now I want to push from that to a remote repository I have in GitHub.

Pushing / Pulling from the command line tools works fine (I have configured RSA key based SSH authentication).

But when I try to push from EGit (via SSH pointed to GitHub), I get a prompt to enter my pass phrase. But when I enter the correct pass phrase, it prompts again for the same (note: username appears as git because that's the default when using GitHub. I guess that wouldn't be a issue).

Under Eclipse preferences, I have double checked to ensure that it is configured to use the RSA tokens I have generated.

Yohan Liyanage
  • 6,840
  • 3
  • 46
  • 63

3 Answers3

22

Got it sorted out by following this link http://www.eclipse.org/forums/index.php/t/197428/.

I created an environment variable GIT_SSH which points to /usr/bin/ssh (which was the SSH implementation I was using in command line) and started Eclipse. When this environment variable was present, Eclipse connected using my shell's SSH tool and there was no prompt for pass phrase and it worked fine.

Brad Cupit
  • 6,530
  • 8
  • 55
  • 60
Yohan Liyanage
  • 6,840
  • 3
  • 46
  • 63
  • 1
    I am having issues doing this, where do I place the environmental variable, the exact line I need please? – Seth Hikari Jun 14 '11 at 21:17
  • 2
    @Seth That depends on your operating system Seth. In my case, I am using Ubuntu, so I modified the `/etc/environment` (you need super-user privileges for that) file and added the line `GIT_SSH="/usr/bin/ssh"` as the last line into it, and restart the machine. If you are using Windows, check out this link http://support.microsoft.com/kb/310519. In any case, a quick Google on "How to set environment variable in _Your-OS-Name_" will get you going. Hope this helps. Good Luck ! – Yohan Liyanage Jun 15 '11 at 08:58
  • same problem, same solution! Tks a lot! – Topera Jul 03 '11 at 01:20
  • 4
    FYI but not to be a stickler, you generally shouldn't edit /etc/environment and should instead edit the .profile in your home directory. Adding the line export GIT_SSH=`which ssh` will typically work across most platforms. – Nick Campion Sep 08 '11 at 23:19
  • Thanks Nick. Yeah you are right. I am used to editing /etc/environment because changes I do there are available across all accounts. But then again I have only one account in my machine, and I could have just used the .profile instead :) – Yohan Liyanage Oct 10 '11 at 16:00
13

Even simpler is to update the JSch bundle to 0.1.44 from eclipse orbit repository (p2 software site): http://download.eclipse.org/tools/orbit/downloads/drops/R20110523182458/repository/

The underlying problem is actually that JSch < 0.1.44 does not support the newer encryption scheme AES-128:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=326526

adietisheim
  • 3,434
  • 1
  • 19
  • 14
2

On Eclipse Juno, Jsch is already > 1.44 and yet the problem still happens (for me). I also tried setting GIT_SSH and this didn't work either. My previous keys had been generated by ssh-keygen, I can only guess that this doesn't generate a suitable key.

What I did that worked was this:

  • Use Eclipse to generate a new DSA key - creating a 1024 bit key Eclipse->Preferences->General->Network Connections->SSH2->Key Management

    [It might work with RSA I didn't try]

  • Copy the generated public key to the remote repo

  • Click the [Save Private Key] button without entering a passphrase

  • RESTART ECLIPSE

Eclipse/EGit will now synch with the remote Git Repo, without requiring a passphrase - phew!

Tim T
  • 361
  • 3
  • 7