开发者

Problem with gitosis and EGit

I have gitosis installed on a personal server and I've set it up so that my ubuntu machine I'm on now can access the repository from the command line just fine with

git clone gitosis@myservername:/myreponame.git

It asks me for my passphrase for my rsa key and then goes through and works as expected.

However, I'm trying to use EGit with eclipse (again, under Ubuntu) and I am unable to pull from the repository. I set it up to pull that exact repository, gitosis@myservername:/myreponame.git and it proceeds to find myservername and my personal public key (it gives the file path to it too, so I know its the same one) and asks for my passphrase. However, it never accepts my passphrase (note: I'm pretty sure its rejecting the passphrase and not the key itself as it rejects it immediately and does not say not authorised, as well as the fact the same key works from CLI). I get the impression the reason it doesn't work is because it's trying to unl开发者_如何学Cock the public key with the passphrase as the user gitosis and that not being my username on the local machine, despite the fact that unlocking a public key file as a particular user makes no sense.

I know I'm typing the passphrase correctly because it works from CLI and I even went and changed the passphrase successfully just to make 300% sure.

Can anyone shed any light on this issue?


Holy guacamole - I solved it myself. Sharing my solutions as it seems many people have had the issue.

Doing research I came across someone with a very similar issue - the hint was in working out that this obviously has nothing to do with gitosis, but that Eclipse is refusing to accept my passphrase.

According to this bug report, the ssh implementation that EGit uses by default can't handle ssh keys encrypted with anything but 3DES, but it doesn't check the encryption and so just fails as if the wrong passphrase was typed.

The following comment on the bug report worked for me: https://bugs.eclipse.org/bugs/show_bug.cgi?id=326526#c9

It says to just set a GIT_SSH environment variable, which EGit now honours, to one which can handle the key encryption your using, in my case I just set it to /usr/bin/ssh with

export GIT_SSH=/usr/bin/ssh

And then open eclipse.

You might want to also add this somewhere that will run every time you log in. For me on Ubuntu 11.04, I added the export line to my ~/.gnomerc file (which didn't exist already) and it now is set every time I log in.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜