~~NOTOC~~ ====== HOW TO wincvs over ssh with passwordless public key authentication ====== One of the best ways to share files between machines running different operating systems is to use CVS. CVS allows you to create a repository on a server machine that you can access over ssh from any remote host. This howto explains how to access a CVS repository from windows in a secure and convenient manner using ssh. I will explain how to install wincvs and putty, then what needs to be done to make them work together. ===== Installing Wincvs ===== The wincvs tool freely available from [[http://www.wincvs.org/|here]] the installation is straight forward. You will also need to install python on your system in order to use wincvs. ===== Installing and setting up putty ===== We are going to install the whole putty package. * Download it from [[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html|here]]. * Extract the putty.zip in C: * Create a putty private key : If you already have a public/private key pair, you can convert your openssh private key to putty private key using the **PUTTYGEN** utility. In this tutorial, we will place the private key in **C:\putty\rsa-private.ppk** * Create an ssh.bat: We need to create an ssh like executable that wincvs can use to access the CVS repository using the :ext: method. For this purpose. create a new file 'C:\WINDOWS\ssh.bat' and put the following in it : @echo off set CMD_LINE_ARGS= :setArgs if ""%1""=="""" goto doneSetArgs set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1 shift goto setArgs :doneSetArgs C:\putty\plink.exe -ssh -i C:\putty\rsa-private.ppk %CMD_LINE_ARGS% * Launch the putty ssh agent **PAGEANT.ext** and add the private key to it. ==== Setting up environment variables ==== Go to Start, right click on 'My Computer', then click properties. On the 'Advanced' tab select 'Environment variables'. Click on 'New', then add the following two environment variables ^Variable^Value^ |CVS_RSH|'C:\WINDOWS\ssh.bat'| |CVSROOT|:ext:username@server:/path/to/cvsroot| {{tag>services security}} ===== Usage ===== You can now perform CVS operations on the repository without any additional configurations. WinCVS will figure out how to communicate with the CVS repository using the environment variables that we setup. The ssh agent will allow WinCVS to use the ssh.bat script without prompting the user for the private key's pass-phrase. ~~DISCUSSION~~