Putty SSH Port Forwarding
SSH tunneling (port forwarding) is a flexible and secure mechanism for accessing network services behind a firewall. It can be used for accessing VNC servers or Windows Remote Desktop Service in CS Department from your home PC.
How It Works
Suppose you want to run a client software (e.g. VNC client) which makes a TCP connection from your PC to a remote server (e.g., a VNC server running on a CS UNIX server). You may use PuTTY to set up a "tunnel" which forwards TCP traffic from your local PC to the remote server. When the client connects to the TCP port on your local PC, SSH relays the traffic to the remote server with encryption. From the viewpoint of the client software, the server software appears to be running on your local PC.
Setup Procedure
- Install and setup your PuTTY client on your PC.
- Enter the name of the machine you wish to connect in the box [Host Name].
You can specific an IP address also. - Select the SSH Protocol.
- Specific the size of the windows by Rows and Columns.
- Specific the size of scrollback if you wish to cut and paste previously entered commands or terminal output.
- Change the font is necessary, default is Courir New, bold, 10-point. Use ClearType if you are using LCD monitor.
- Select Colours Tab to change the default colors.
- Enable compression for slow connections.
- The tunnel details will shown in the box
- Give a name for the setting and Save the session so that you don't have to configure again.
- Double-click the saved session will open a new session using the saved settings.
Example Tunneling Rules
The table below shows some example tunneling rules.
Service | Listening Port | Destination Host | Destination Port | Allow Localhost Connections Only | How to run client |
---|---|---|---|---|---|
VNC
| 5900 + display no | host running your VNC server
| yes
| VNC client connects to localhost:
| |
IMAP
| 143
| study.cs.hku.hk for student
staff.cs.hku.hk for teaching staff | 143
| yes
| enter localhost as IMAP server
for your mail client software |
NNTP
| 119
| news.cs.hku.hk
| 119
| yes
| enter localhost as NNTP server
for your news client software |
CVS
| 2401
| host running the CVS server
| 2401
| yes
| use localhost as server name
|
RDC
| 9001
| host running RDC service
| 3389 | yes
| Run RDC connecting host 127.0.0.1:9001 (Windows XP with SP2) |
RDC
| 9001
| host running RDC service
| no
| Run RDC connecting host 127.0.0.2:9001 (Windows 2000 or Windows XP without SP2) |