Technical Notes |
|
This technical note briefly describes Secure Shell (SSH) and port forwarding, explains how to configure the F-Secure SSH client for local port forwarding by creating a connection through a secure SSH tunnel; and then provides some sample configuration settings.
Note: Beginning with version 6.0, the F-Secure SSH product line has a new name: Reflection for Secure IT. This technical note does not apply to Reflection for Secure IT clients.
This technical note is organized in to the following sections:
SSH is a computer program based on the Secure Shell protocol. SSH provides strong, encrypted authentication and a secure encrypted tunnel through which users can execute commands and move data. The current version of Secure Shell is ssh-2. (The ssh-1 protocol is deprecated; therefore, it is highly recommended that you use ssh-2.)
For more information about Secure Shell, see "Fortified SSH: A Cost-Effective Way to Safeguard Your Network" on Attachmate.com: http://www.attachmate.com/WhitePapers/Literature_0954.htm.
Port forwarding, or tunneling, allows insecure TCP/IP traffic to be forwarded through a secure SSH connection. Most remote services that use TCP/IP can be secured, including client-server applications, database systems, and services such as HTTP, Telnet, FTP, POP3, and SMTP. The F-Secure SSH Client also provides automatic forwarding for the X11 Windows System commonly used on UNIX machines.
To tunnel a host session through an F-Secure SSH client connection, you must establish the SSH connection, and then configure the application you want to securely connect with so that its communication is redirected through the SSH tunnel.
Figure 1 - Port ForwardingBefore the SSH tunnel is been established, and the application is configured to use the tunnel, ensure that the SSH server is configured to enable tunneling. How you configure the server depends on which server you are using. Follow the steps below to configure the F-Secure SSH Server for Windows or UNIX. For details on configuring other SSH server software, refer to your man pages or the product's documentation.
When you create a local tunnel, you configure the F-Secure SSH client to listen to a specific port on your local computer. When any program on your computer connects to the specified port, the F-Secure SSH client forwards the request and the data over the secure channel to the remote host.
You can create a local tunnel using the F-Secure SSH interface (for the Windows client) or the command line (for the Windows and UNIX clients).
Follow the steps below to create, close, and edit a tunnel using the F-Secure SSH interface.
Follow the steps below to create a local tunnel.
To access Add New Local Tunnel before connecting to a host, click Edit > Settings > Profile > Tunneling > Local > Add.
To access Add New Local Tunnel after connecting, follow these steps.
Note the following:
Important: Localhost is used for the name of the remote machine if the server you are connecting to through the tunnel is running on the same server where the SSH daemon resides, which is often the case.
If the SSH daemon resides on a different host than the host you are connecting to, enter the name of the host you are connecting to in the Destination Host field. In this instance, the connection between the F-Secure SSH client and the SSH daemon is secure, but the connection between the SSH daemon and the target host is not secure.
When the F-Secure SSH client receives a local request on the specified source port, the application is connected to the destination port through the SSH tunnel.
To terminate a tunnel, in the main F-Secure SSH client window, click Edit > Settings > Profile > Tunneling > Local, select the tunnel to delete, and then click Remove.
Follow the steps below to edit tunnel settings.
Use the following commands to establish the SSH connection and create the SSH tunnel from the command line.
Use this command to forward TCP traffic on the workstation through an SSH tunnel to the SSH server.
Syntax:
ssh2 L <local workstation port>:localhost:<SSH server port> <user name>@<host name>Example:
ssh2 L 4000:localhost:4005 RKoa@mySSHserverIn the example above, TCP traffic will be forwarded through port 4000 on the workstation to port 4005 on the SSH server.
After creating the SSH tunnel by following the directions in Step II, you must configure your application to use the SSH tunnel. The configuration will be different for each application. For details, refer to the application documentation.
The following example shows how to configure Reflection for HP or Reflection for UNIX and OpenVMS to redirect a Telnet session over the port you have redirected to connect through SSH.
Follow the steps below to verify that your Telnet session is running through the SSH tunnel.
Note: If the netstat command is not recognized, navigate to the C:\Windows\System32 directory and enter the command again.
If the port forwarding is successful, you should see a response similar to the following:
Active ConnectionsProto Local Address Foreign Address State TCP My_PC:1554 my.server.com:22 ESTABLISHED TCP My_PC:1025 localhost:1564 ESTABLISHED TCP My_PC:1564 localhost:1025 ESTABLISHED |
In the example above, the first TCP row shows the SSH connection from port 1554 (a random port) on the workstation to port 22 (the default SSH port) on the SSH server.
TCP rows two and three show the Telnet connection between port 1025 on the workstation, the port that has been configured to redirect Telnet connections (port 23) through the SSH tunnel (port 22), and a random port (1564) on the SSH server.
Note: If the second or third TCP row shows the actual host name, such as my.server.com:telnet(23), instead of localhost:<port number>, the tunnel has failed and the Telnet connection is not encrypted.
The following sample settings show how to forward HTTP and FTP.
| Field |
Data |
| Source Port |
8080 Note: This number can be any port number over 1024. |
| Destination Host |
localhost |
| Destination Port |
80 |
| Type |
TCP |
| Field |
Data |
| Source Port |
8021 Note: This number can be any port number over 1024. |
| Destination Host |
localhost |
| Destination Port |
21 |
| Type |
FTP |