PuTTY is a GUI Windows client that makes it easy to use the SSH (secure shell) protocol to connect your Windows PC to a Linux server hosting a CVS repository
Installing an SSH client and generating your personal SSH keys must be done before you can be given a user account to connect to the CVS server.
There are a number of free and commercial SSH clients available for Windows. These instructions tell you how to install and configure one of these clients: PuTTY.
PuTTY is commonly selected because it is a self-contained product with native Win32 binaries that includes an easy-to-use GUI interface and offers very robust support for the SSH2 protocol.
If you already use the Cygwin (Unix-for-windows) product, you may wish to use the OpenSSH client that comes with Cygwin instead PuTTY. However, detailed instructions for this option are not included in this document.
- Create a directory called putty on your C or D drive. This will be referred to as d:\putty in the instructions that follow.
- Download the code from http://www.chiark.greenend.org.uk/~sgtatham/putty/ to your new d:\putty folder.
- Now run the putty.exe program. The PuTTY Configuration dialog will be displayed.
- Under the Session category, set these options:
Host Name --> Server you are connecting to Protocol --> SSH
- Select the Terminal option in the left pane and turn on the option Use background colour to erase screen.
- Select the Connection option in the left pane and enter your user name in the Auto-login username box.Remember, Linux is case sensitive, be sure you enter your user name in lowercase since this is the way the CVS Administrator will normally set up your account on the CVS server.
- Next select the SSH option under the Connection category in the left pane. Under Preferred SSH protocol version select 2.
- Select the Auth option and de-select the Attempt keyboard-interactive authentication (SSH2) option.
- Now go back the Session category and type ServerName into the Saved Sessions box as appropriate. Click on the SAVE button to store your CVS session options.
Configure Connection to CVS Server
- Next use the instructions in Configure SSH Keys to create and install your SSH authentication keys.
- Install your SSH public key on the CVS server. Now you can configure PuTTY to use your SSH keys to make the connection to the CVS server.
- Run PuTTY.exe and click on the LOAD button to load your ServerName settings as appropriate.
- Choose the Connection–>SSH–>Auth option in the left pane and enter the name of your private key file into the box shown in the right pane. The name of this file will be something like:
- Click on the Session category in the left pane and use the SAVE button to save your updated ServerName session settings.
- Now click on OPEN to try establishing a connection to the CVS server. The first time you connect, you should get a PuTTY security alert message that gives you the fingerprint of the CVS server.
- If you do see the correct fingerprint, click on YES. PuTTY will store this fingerprint in the Windows registry and you won’t get this prompt on future connections.
- PuTTY will now connect to the CVS server. You should see messages like these:
Using username your-user-name. Authenticating with public key "ServerName Server rsa-key-yyyymmdd" Pass-phrase for key "... rsa-key-yyyymmdd:
- Enter your pass-phrase and you will be logged in to the CVS server. If you cannot log-on to the CVS server, contact the CVS Administrator and ask the admin to check your user account on the CVS server.
Configure SSH Agent for CVS Client/Server Connections
- Now you can configure PuTTY to automatically connect you to the CVS server using your authentication keys instead of prompting you for your SSH pass-phrase each time. By using the SSH agent program called pageant, you will only have to enter your SSH pass-phrase once when you boot your PC. The SSH Agent will then keep your SSH key loaded in memory and automatically provide it each time your CVS client(s) need to connect to the CVS server until the next time you reboot.
- Using Windows Explorer, go to your d:\putty directory. Right-click on the pageant.exe program and create a shortcut.
- Right-click on the your new pageant shortcut.
- Use the RENAME option to change the name of the
shortcut to SSH-Agent.
- Use the PROPERTIES option and click on the SHORTCUT tab. Add the name of your private key file to the pageant run command in the TARGET box so that the run command looks like this:
- Click on the OK button to save your changes.
- Use the RENAME option to change the name of the
- Now double-click on your SSH-Agent shortcut to run the pageant program.
- The pageant program will prompt you for the pass-phrase for your SSH key. Enter your pass phrase and click on OK.
- You should now see the pageant icon in your system tray at the bottom right-hand corner of your screen.
- Right-click on the pageant icon and select the VIEW KEYS option. Pageant will open a window with a list of the SSH keys it has loaded. You should see the fingerprint for your private key listed in this window.
- Close the pageant key list window.
- Now double-click on the putty.exe program again and ask it to connect to the CVS server. This time putty should automatically connect to the CVS server. You should see the following messages:
Using username your-user-name. Authenticating with public key "CVS Server rsa-key-yyyymmdd" from agent Last login: date-and-time from your-workstation-name
By the way, the last login message is also a security aid. If you notice a last login time or workstation that are not yours, please notify the CVS Administrator immediately.
- You may want to copy your SSH-Agent shortcut to your Windows startup folder so that it will automatically run and load your SSH key(s) each time you reboot your PC.
Configure Plink for Background Connections
- The final step in PuTTY configuration is to set up the plink tool so that it can be used for automatic background connections from your PC to the CVS server.
- First make two changes to the environment variables on your
- Add the d:\putty directory to your system PATH environment variable using the System option in the Windows Control Panel.
- Create a new system environment variable called CVS_RSH with a value of d:\putty\plink.
- Reboot your PC to make the new environment settings take effect.
- Now test plink. Open a DOS command shell and enter the command:
plink ServerName echo $HOSTNAME $USER $HOME
You should see a response that looks something like this:
ServerName username /home/username
Note – The ServerName in the plink command is the name of the PuTTY session configuration you saved earlier in this procedure.
Note – If you have trouble connecting with plink try this command instead:
plink -v ServerName echo $HOSTNAME $USER $HOME
The -v option will cause plink to write diagnostic messages as it connects to the CVS server. These messages can help you pin down the problem with your connection.
Congratulations, you have now completed all the SSH setup
needed connect to the CVS server.
This page is based on an internal page written by Bruce Files at MPCT (later Aleri) in Chicago. It has been modified to make it a generic guide suitable for publication on the internet.