I will try to cover the steps involved in setting up Windows with a Subversion client that will access over ssh.
Tools needed:
- Tortoise
- PuTTY
- PuTTYgen
- Pageant
- WinSCP
I will assume that you have some knowledge of logging in to the remote Linux machine and that you have Subversion and ssh already working.
The following steps need to be done from the command prompt on the Linux machine that is running your Subversion repository. You need to be logged in as the user you want to access the repository with. For this tutorial, I’ll use the username huckleberry. You should not be logged in as root.
- Execute the command ’ssh-keygen -f akey’
- When prompted, type the passphrase that you want to use to log in. (This can be left blank, but I don’t recommend it)
- Type ‘mkdir .ssh’ (If you get an error that the directory already exists, just go to the next step)
- Type ‘cat akey.pub >> .ssh/authorized_keys’
- Type ‘chmod 600 .ssh/authorized_keys’
These next steps need to be done on the Windows machine that you are setting up access for:
- Open PuTTY
- Enter the hostname or IP address of your Subversion server, verify the connection type is set to SSH, and enter a name to call your new session in the ‘Saved Sessions’ textbox. I’ll call mine mysvn.
- Click the Save button
- You should now be able to use the open button to open a session to your Subversion server.
- Next you need to copy the private key to your machine. I use WinSCP to secure copy the file ‘akey’ to my desktop.
- Start PuTTYgen and choose Conversions from the menu bar, then Import key.
- Type the passphrase you assigned the key when you created it on the Linux box.
- Click the ‘Save private key’ button
- Choose an appropriate location to store your key and save it naming it something like akey.ppk
- Start Pageant, it will bring up a little computer with a hat icon in your status bar, next to your system clock
- Right click the icon and choose Add key
- Find your newly saved key (akey.ppk) and choose Open
- Type your passphrase
- Assuming you have installed Tortoise, bring up something like your Documents directory
- Right click in the file pane (not sure if that’s what it’s really called, but folders are in the left pane and files are in the right one) and choose TortoiseSVN/Repo-browser
- For the URL you will use svn+ssh://huckleberry@mysvn/var/svn/myProject (replace /var/svn/myProject with the path to the repository you want to access)
- You should be able to browse the files in your repository
That’s it! You should now be able to checkout, commit, etc. using a URL path like the one above. When you reboot, or shutdown Pageant you will need to start it again and add your key back.
I recommend that you go back to your shell and delete the private key that you generated.