Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EGit - SSH Fails at Passphrase (when connecting to GitHub)

Tags:

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.

like image 458
Yohan Liyanage Avatar asked Jun 11 '11 12:06

Yohan Liyanage


People also ask

How to generate RSA key for ssh login in Git?

Click on button “Generate RSA Key” and after that provide secret Passphrase (dont forget this passphrase), now save the “private key”, if possible in “.ssh” folder which is located at “C:UsersUseName.ssh”. For SSH login, let’s take example of “Unfuddle”, where we need to connect to Git using SSH protocol.

How to SSH into eclipse from Git?

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

How to connect to GitHub using SSH2?

In your Eclipse go to Window > Preferences > General > Network Connections > SSH2 (or just type "SSH2" in preferences window filter box). 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.

How to configure ssh-agent to forget your SSH key?

Tip: If you want ssh-agent to forget your key after some time, you can configure it to do so by running ssh-add -t <seconds>. Now, when you first run Git Bash, you are prompted for your passphrase:


2 Answers

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.

like image 198
Yohan Liyanage Avatar answered Nov 15 '22 06:11

Yohan Liyanage


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

like image 21
adietisheim Avatar answered Nov 15 '22 06:11

adietisheim