Secure X-Sessions from Windows PC's via X-Win32 and PuTTY

Introduction

In this page we will explain how to obtain a secure X-Session to a UNIX workstation from a Windows PC.  This will provide you with the ability to access the UNIX based software from home and other Windows based PC's.  By going through a secure session, all traffic between the two systems will be encrypted, thus guaranteeing privacy.


Software

Two software packages are required to implement the secure X-Session.  These packages are:
  1. X-Win32 - Can be obtained either by purchasing a license from the UVic Computer Store, or online from Starnet.  The description below should work with any version of X-Win32, however the description below applies to the version sold be the UVic Computer Store (version 3.4) so slight modifications might be required for other versions.
  2. PuTTY - Can be obtained either from the PuTTY website or directly from the PuTTY site.  Make sure you obtain version 0.52 or greater, as older versions do not support some of the required features.

Setup Procedure

X-Win32 Set Up

  1. Obtain and install X-Win32 on the Windows PC.
  2. Start-up X-Util (Start --> Programs --> X-Win32 --> X-Util ). Some newer version of X-Win32 have renamed this to X-Config.
  3. In the xhosts list dialog box (accessed from the Options menu), clear all remote hosts and then add localhost to the list.
  4. In the Display dialog box (once again accessed from the Options menu), set the Display setting for X to 127.0.0.1:0.0.
NOTE: Ensure that you close the xhosts list dialog box and the Display dialog box by clicking their OK buttons in order for the changes to take affect.  If you getting a connection rejection to the remote host error message and your DISPLAY Variable is set properly (see below), you might want to verify that the settings in these dialog boxes are still correct.

PuTTY Set Up

  1. Download PuTTY on the Windows PC (what you download is the PuTTY executable, so no installation is required just place the executable where you'd like to access it from).
  2. Configure PuTTY to be an ssh-client by selecting the ssh radio button in the first window that appears when you start it up.
  3. Select the Connection --> SSH Category in the tree on the left of the dialog box, set the preferred SSH protocol version to 2 .
  4. Select the Connection --> SSH --> Tunnels Category in the tree and enable X11 forwarding by checking the check box towards the top of the dialog box.
  5. Go back to the Session Category, highlight Default Settings in the Sessions list box, and click the Save button to the right of the list.
  6. You can improve the visibility of your window if you chose the following colour sttings.
  7. Select the Window --> Colours Category in the tree and use the following values: Default Foreground (187,187,187), Default Bold Foreground (255,255,255), Default Background (0,0,0), Default Bold Background (85,85,85), Cursor Text (0,0,0), Cursor Colour (0,255,0), ANSI Black (0,0,0), ANSI Black Bold (85,85,85).

--------------------------------------------------------------------------------
This page was created by Erik Laxdal and Watheq El-Kharashi.



Starting an X-Session

For the sake of example, let us say that you are wanting to connect to UNIX workstation ugs1.ece.uvic.ca.

X-Win32 Start Up

  1. Start X-Win32 (Start --> Programs --> X-Win32 --> X-Win32 ).  This will start up as a button on your taskbar and no window will open.
  2. Nothing else needs to be done with X-Win32.

PuTTY Start Up

  1. Start PuTTY by double clicking on the PuTTY icon.
  2. In the first dialog box that appears (for PuTTY), type the name of the host that you wish to connect to into the hostname text box. In the case of our example, you would type ugs1.ece.uvic.ca
  3. Click the Open button towards the bottom of the PuTTY dialog box.
  4. When prompted by PuTTY enter your username/password to login to the UNIX workstation.
  5. Verify your X session is going through the secure tunnel.  To do this type echo $DISPLAY at the command prompt in the PuTTY terminal.  The result should be something towards the effect of hostname:n.0 where hostname is the name of the system that you are connected to and n is a number that is greater than or equal to 10. In the case of our example you will probably see ugs1.ece:10.0  If the result does not match this pattern you can fix it by following the instructions in the Setting Your DISPLAY Variable section below.
  6. You are now ready to run any X applications that you wish (xterm, netscape, Synopsys, etc...).  Have fun...
NOTE: If you are getting a message about your terminal type not being recognized during your login process, just follow the instructions below about Setting Your DISPLAY Variable.

Setting Your DISPLAY Variable

If you are having problems with the DISPLAY Variable not being set properly, you can fix it by following the instructions below.
  1. Type setenv DISPLAY hostname:n.0 at the command prompt where hostname is the name of the server you have connected to and n = 10 initially.
  2. Try to start up an x-terminal by typing xterm at the command prompt.
  3. If an x-terminal appears on your screen, you have properly set the display variable, otherwise go back to step, but this time use n = n + 1 (ie. 11, 12, 13, ...).
NOTE: If you end up having to set the DISPLAY variable manually, there may be something in your .cshrc or .login files that is affecting it.  You might consider taking a look at these files to see what is happening and adjust them as required.

This page was created by Erik Laxdal and Watheq El-Kharashi.
 
 

webmaster@ECE.UVic.ca
Created: Jan. 20 2002     Last Modified: Jan. 22 2002