Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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
share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

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: http://stackoverflow.com/questions/2224066/how-to-convert-ssh-keypairs-generated-using-puttygenwindows-into-key-pairs-use

share|improve this answer
    
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 –  herschel Mar 18 '13 at 10:36
    
@herschel, sudo is not necessary when you already own the file. –  ImaginaryRobots Mar 19 '13 at 15:38
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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