Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit » Unable to use key file SSH
Unable to use key file SSH [message #902768] Mon, 20 August 2012 07:25 Go to next message
sofiane merah is currently offline sofiane merah
Messages: 2
Registered: August 2012
Junior Member
I setup public key access to my server via ssh. I have a .ssh folder on my local windows computer. I configured ssh to add the private key using the ssh-add <directory> command. I am able to successfully connect to my server using windowspowershell. The chmod and Chown of the .ssh directory and authorized file are configured correctly on my server. sshd_config is configured correctly and points to the correct key.

The connection works perfectly with shell so there is no problem on my server. But with Eclipse, and its plugin in particular, Egit, I keep getting a Unable to use key file <directory of the key file I loaded into eclipse the same one used by ssh error every time I try to push my revision commits to my git repository on the server. I went to Pref > General > Network > SSH2 and added the right private key, the ssh2 home directory is set correctly too, in fact the public an private key were both generated using the key management tab and loaded into my server.

My windows permissions on that folder and those keys is set to allow all users to do everything just for good measure.

Now one clue is, the known hosts tab has a host fingerprint that does not match the fingerprint of my key. My key is something like f1:19: etc and the hosts fingerprint is different. I hope I can fix this soon. Any suggestions would be great.

ssh-add -l = two private keys that I am using. So its not this.
Another clue is, after going into my putty program and changes the private key that it ses suddenly is i try to connect to ssh with a key acces in eclipse the error it throws shows reflects the same key that I just changed in putty!! Somehow eclipse seems to be using putty for public key access. How do I stop this?!
Re: Unable to use key file SSH [message #902770 is a reply to message #902768] Mon, 20 August 2012 07:44 Go to previous messageGo to next message
sofiane merah is currently offline sofiane merah
Messages: 2
Registered: August 2012
Junior Member
SOLVED IT

Okay here's the solution. For whatever reason Egit uses putty to connect to ssh using the configuration putty is set to use to access a server with a public key. The way you fix this is to make sure putty is able to connect to the server using a public key. If it can't then try this:

Download puttygen
Generate a rsa key using either ssh shell or the key management tab on eclipse. Do not generate a key using puttygen. For whatever reason it never worked for me.
Load the private key you generated (not generated with puttygen) into puttygen and then save as a putty private key (.ppk)
Go to eclipses key management tab and set it to recognize the new .ppk private key file
Finally go to putty, and create your servers profile by assigning the address and then go to auth and load the .ppk file. DISABLE pageant.
Save and attempt to connect to server using the key and if successful then congratulations Egit and Eclipse will now be able to make connections using keys.
Re: Unable to use key file SSH [message #988671 is a reply to message #902770] Fri, 30 November 2012 18:57 Go to previous message
Tom Semple is currently offline Tom Semple
Messages: 1
Registered: November 2012
Junior Member
I tried this but it did not work.

puttygen appeared to create a private .ppk file successfully from the one CLI git is using.

But Eclipse would not load the .ppk (it did load the original key file used by CLI git).

And when I attempted to use the .ppk with PuTTY, it complained that it was not a private key.


Previous Topic:Build cloned files ? Build button grayed out...
Next Topic:Existing project with multiple git repos
Goto Forum:
  


Current Time: Thu Aug 28 11:20:03 EDT 2014

Powered by FUDForum. Page generated in 1.10071 seconds