Using putty pagent with egit in Eclipse

I am trying to access a private remote SSH git repository through the Eclipse 'egit' module. I am running Eclipse on Windows. Eclipse does not work automatically with putty pagent for forwarding authorization, and I can not find the documentation about SSH configuration used by egit (for example, to use plink.exe).

I found documentation on the Internet about setting up other Windows git clients to use putty / plink (e.g. for msysgit), but I can not find anything about Eclipse egit and putty (or eclipse).

I am sure that the ssh key works fine, since I use it all the time to log into the server with Putty.

In particular, I use the git repository viewer, click "Clone Remote Repository", fill in the host, repository path, protocol (ssh) and user. I Click Next. I can say that this is due to the fact that I get a pop-up window with a unique banner on the server. Then i get

Transport Error: Cannot list the available branches: Reason: <URI>: Auth fail 

The ssh login is only by sshkey, so why it doesn't work (but at least it shows that I have the basics).

Does anyone have success with egit + pageant? Or do you know if this is simply impossible?

Update

This does not seem to work because Eclipse uses the internal SSH implementation (jsch) for pure Java, and that the Eclipse implementation contains (so far) authorization agent protocol support.

Some fixes to support ssh platform agents through them have been proposed (thanks to @Janning for the link). See This Eclipse Error 179924 . Update No. 24 includes this encouraging note about the proposed fixes:

I confirmed that I can access http://github.com/ and clone some projects using egit with the site.

I'm not quite sure, but it seems that the current hangs are some licensing issues in the pure-java unix domain socket library and an update to the pure-java SSH implementation that Eclipse uses.

A more recent bug ( number 360663 ) indicates that the required jsch version was tied to Eclipse (and as far as I can tell, should be part of the next release - should be the end of June 2012).

+7
source share
4 answers

After reading the answer of morellet.d, I was able to install this for myself very simply.

I added the user environment variable GIT_SSH and set it to "C: \ Program Files (x86) \ PuTTY \ plink.exe". So you just need to install it wherever your plink file is, and it will work.

The instructions worked with PuTTY 0.62, the latest versions of EGit and Eclipse Juno x64.

+7
source

The best solution found allows using the pagent key rather than eclipse (openssh). For me or someone else, try using Eclipse, GitBash, with plink and pagent (with or without keepass) on Windows.

The main reason is because the error message lies. This may be caused by a plink.exe that was not called due to an incorrect parameter and nothing related to the server key. (JGIT developer should fix).

EGIT uses JGit and passes the argument "- p [port] [server]" git -upload-pack '[project]' " plink.exe.

The argument is good for openssh , however it is not compatible with plink.exe , plink.exe requires capital " -P " for the ssh port.


Save this file as "plink.cmd"

 @ECHO OFF SET c="plink.exe" -ssh -agent -l [username] :loop if NOT _%1_ == __ ( IF _%1_ == _-p_ ( SET c=%C% -P ) else ( SET c=%C% %1 ) shift goto loop ) %c% 

On Windows, run SETX GIT_SSH PATH_TO \ plink.cmd to load the environment variable.


Enjoy connecting pagent with your Eclipse and GIT Bash for windows.

+2
source

eGit uses SSH keys that the built-in Eclipse SSH function knows about. Download the keys to the SSH2 preferences page shown at http://wiki.eclipse.org/EGit/User_Guide#Eclipse_SSH_Configuration .

0
source

EGit + pageant works for me (despite the configuration of the Eclipse SSH2 home / private key ...)

I am on Windows 7 with TortoiseGit + msysgit installed.

On the User Settings tab in Team > Git > Configuration I put only my name and email address, and the sign is blank. On the Repository Settings tab, the URL is copied and pasted from the github ssh link, and the puttykey path is correct (for example, C:\Users\you\.ssh\yourkey.ppk ). I use a key without a passphrase.

I also added the following Windows system variable: GIT_SSH = C:\\Program Files\\TortoiseGit\\bin\\TortoisePlink.exe

As soon as the start page starts with the added key, it should work ...

0
source

All Articles