GalGavu
GalGavu

Reputation: 23

svn+ssh connection from old key

I have created lately in Windows ssh key - so I have .ppk file. Converted it also to openssh. In windows I have been using tortoise with pageant to connect to svn+ssh server. Now I want to switch to linux. How can I connect to svn+ssh with this key .ppk or opessh file. I would like to use PagaVCS or RabbitVCS but it keeps asking me for login and password which obviously I don't have because I have only this openssh or .ppk file. Anyone could help??

Upvotes: 1

Views: 1367

Answers (3)

Hrobky
Hrobky

Reputation: 1082

Puttygen exports private keys DES encoded, which causes some software (e.g. OpenSSH on Ubuntu) to silently ignore the key and prompt for password.

To use PuTTY .ppk key in linux OpenSSH, first export the key:

  1. Start puttygen
  2. File -> Loadprivate key
  3. Conversions -> Export OpenSSH key (private.key in this example)

Now, on the linux machine, re-encrypt the key using passphrase change command:

ssh-keygen -pf private.key

Enter the same passphrase 3 times (old, new, new) to actually not change it.

Now you can check the key file that DEK-Info: changed from something like DES-EDE3-CBC,F1785C4B846C781F to AES-128-CBC,916627D6328608175FA4545928372EA3.

The client application should not promt you for password anymore.

Upvotes: 1

RyanfaeScotland
RyanfaeScotland

Reputation: 1213

I am sure the answer for this was online but I can't seem to find it anywhere any more so here it is from beginning to end including the conversion you say you've done:

  1. Open puttygen on Windows.
  2. Load your private key (name.ppk) using the passphrase if needed.
  3. Go to 'Conversions' -> 'Export OpenSSH Key' and save it as (I'll assume you called it 'fileName').
  4. Copy this key into your home directory on Linux.
  5. Open a terminal and move it to the .ssh directory with the command 'mv fileName .ssh/' (~/.ssh is hidden in the gui but it's there).
  6. Navigate to the .ssh dir with 'cd .ssh'
  7. Cat the file into a new file called id_rsa with the command 'cat fileName > id_rsa'.
  8. Change the permissions on id_rsa to 600 with the command 'chmod 600 id_rsa'.
  9. Finally make sure the .ssh directory has its permissions set to 700 'cd ..' to drop to the home directory and 'chmod 700 .ssh' to set permissions.

This should do it.

There must be better info out there but this link has some stuff you might find interesting, particularly the bit about permission http://www.lamolabs.org/blog/6241/one-liner-working-with-ssh-keygen-ssh-key-pair-files/

Upvotes: 0

Jarek Potiuk
Jarek Potiuk

Reputation: 20097

Use puttygen to convert the key to openssh format. It is for example described here: http://leadingedgescripts.co.uk/server-administration/how-to-convert-your-putty-ppk-private-key-to-a-normal-ssh-key-you-can-use-on-an-apple-mac/

Unfortunately no experience with either Rabbit or the other one. In *nix environment I would create $HOME/.ssh/config and write something like that:

Host host
User user
IdentityFile /path/to/your/key

And then use svn+ssh://host/directory (ssh then takes configuration information from the .ssh/config file). Maybe something like can be done with one of the VCS's?

As last (or first in my case) resort I'd use cygwin or mingw and configure ssh access there - and then configure the tools to use ssh coming from these packages.

Upvotes: 4

Related Questions