Setting up SSH and Subversion

From WikiTissue

Jump to: navigation, search

This guide describes how to setup SSH and Subversion on a Windows Platform.

Contents

[edit] Installing PuTTY

Download link PuTTY Either get the windows installer or download a zip file containing all the binaries. Install PuTTY onto your system, if you get the zip file create a folder

c:\\program files\\putty

and unpack the zip-file into this folder.

At this point you might want to add folder location to your path variable

  • click on start button
  • right click on ``my computer
  • select properties from the popup menu
  • Click on the ``Advanced tab page
  • Press the ``Environment Variables button
  • Locate the Path variable in the list box and press the edit button
  • Add the putty location to the variable value and press OK button

In the PuTTY folder you will find the file

pageant.exe

Make sure that windows runs this file on start up. For instance by adding a short cut to

start-all programs-Startup

[edit] Setting up SSH

Run the file

c:\\program files\\putty\\puttygen.exe

Make sure that

  • Type of key is SSH2 RSA
  • We recommend that you enter a passphrase

Save public key and private key, a good location is where windows store your documents and settings. In my case

C:\Documents and Settings\kenny\

Choice a meaningful name for the public key in my case I choice

laptop_key

and the private key I decided to call

id_rsa.ppk

Next open up the public key in your favorite text editor, it will most likely look something like

---- BEGIN SSH2 PUBLIC KEY ----
Comment: "rsa-key-20060504"
AAAAB3NzaC1yc2EAAAABJQAAAIBuiy8idOf1iwxv2OMnvO5sbelnAQy07SezMWni
fcx2bSjAx/m1M4wsyJpFMF8TZsGl9D5Yn4NUSaIbCl26sZObBmddxppANDeWdx+z
YGPdB3whUY55llK/Z/ulmMXNdNaeoyhuNakN0woPkvWKxmytSTiE+2ws04OuVtv6
BzvxMQ==
---- END SSH2 PUBLIC KEY ----

CAREFUL

  • Remove the two first lines
  • Remove the last line
  • Make sure that the remaining text is listed on a single line
  • add ssh-rsa at the front of the line
  • you might also want to add a trailing description

In the case above the result would look like (due to text length I cheated and snipped out some of the text)

ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIBui...snip...OuVtv6BzvxMQ==  laptop rsa-key-20060504

Next you should copy this file onto your account on the image.diku.dk server, in my case I open a command prompt at the folder location where I stored my public key and wrote

C:\Documents and Settings\kenny>pscp laptop_key kenny@image.diku.dk:

Next one have to login on the image.diku.dk server. To setup SSH on the server one should write

ssh-keygen -t rsa

Now one would write

cat laptop_key > .ssh/autorised_keys2
rm laptop_key

Finally one should logout from the image.diku.dk server and test if the public key authentication works by login onto the server again. This time no password is needed in order to login.

If you used a pass phrase then you'll be asked to enter this when you login in. This is very tedious, to get around it one should

  • double-click on the pageant icon in your system tray on system startup
  • select ones private key
  • Enter the pass-phrase

Now one do not have to enter pass phrase again, try it by login on to the server, this time one should get a prompt on the server without having to do any typing.

[edit] Setting up PuTTY Session

This is really easy create a session for image.diku.dk, remember to

  • set auto-login username equal to the username on image.diku.dk
  • set private key
  • allow agent forwarding

Once the session is saved try double click on it, then one should get a command prompt on the image.diku.dk server without having to type anything.


[edit] Setting up TortoiseSVN

First one needs to

  • right-click in your file explorer
  • from the popup menu choice settings
  • Select the Network item from the tree-view
  • Set SSH Client equal to the full path of TortoisePlink.exe

Second when one checkout it is important to tell SVN that one uses SSH. In my case I set the URL of the repository equal to

svn+ssh://kenny@image.diku.dk/home/opentissue/svn/OpenTissue/branches/kenny

That is it, happy coding

Personal tools