I use putty+pageant on Windows to be able to access the svn server by using ssh. I have my private key that works.

I'm now trying to use the same key on a Ubuntu VM.

I used the .p12 key in Firefox and it works well.

The problem is I can't use svn. I tried to follow the istructions that I found in several places on internet but it did not work.

The problem is that I don't know whether I did everything correctly.

I'm using a .p12 file format for the private key.

I renamed the key as identity and I copied it in the .ssh folder for my account. I also changed the /etc/ssh/ssh_config file uncommenting the line:

IdentityFile ~/.ssh/identity

I used the command:

svn co svn+ssh://myusername@path_to_rep

The result is still

svn: Network connection closed unexpectedly

I removed the -q option in the [tunnel] section of the subversion config file and now this is what I can see:

Agent admitted failure to sign using the key.
Agent admitted failure to sign using the key.
Agent admitted failure to sign using the key.
Permission denied (publickey).
svn: Network connection closed unexpectedly

openssh uses a different key format from putty. You would need to use puttygen to convert/export your putty key into a format that openssh can use.

  1. Open PuttyGen
  2. Click Load
  3. Load your private key
  4. Go to Conversions->Export OpenSSH and export your private key
  5. Copy your private key to ~/.ssh/id_dsa (or id_rsa).
  6. Create the RFC 4716 version of the public key using ssh-keygen

    ssh-keygen -e -f ~/.ssh/id_dsa > ~/.ssh/id_dsa_com.pub

  7. Convert the RFC 4716 version of the public key to the OpenSSH format:

    ssh-keygen -i -f ~/.ssh/id_dsa_com.pub > ~/.ssh/id_dsa.pub

  8. Fix the permissions of the private keyfile:

    chmod 600 ~/.ssh/id_dsa

Taken from: https://stackoverflow.com/questions/2224066/how-to-convert-ssh-keypairs-generated-using-puttygenwindows-into-key-pairs-use

  • I tried to save the private key by using puttyGen but the created file is the same as the original one. I tried to save an SSH and a DSA file. In both cases the result is the same. – dammedeagle Jan 22 '13 at 9:41
  • Anyway I followed the procedure and it did not work – dammedeagle Jan 22 '13 at 9:45
  • It worked. I add to run ssh-add – dammedeagle Jan 22 '13 at 10:28
  • you should also change the permission on the file: sudo chmod 600 keyfile – kingston Mar 18 '13 at 10:36
  • @herschel, sudo is not necessary when you already own the file. – ImaginaryRobots Mar 19 '13 at 15:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.