Technical Notes |
|
This technical note briefly describes Secure Shell (SSH) and port forwarding, explains how to configure the Reflection for Secure IT server and client for local and remote port forwarding by creating a connection through a secure SSH tunnel; and then provides some sample configuration settings.
Note: In earlier versions, the Reflection for Secure IT product was called F-Secure SSH. This technical note does not apply to the F-Secure SSH client. For information about local port forwarding and F-Secure SSH, see Technical Note 1841.
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 Reflection for Secure IT and Reflection clients also provide dynamic forwarding for the X11 Windows System commonly used on UNIX machines.
To tunnel TCP traffic with SSH, you must configure local and/or remote port forwarding, 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.
Note: If you plan to tunnel FTP, please note that in versions prior to Reflection for Secure IT 6.1 and Reflection 13.0.4 or 14.0, Reflection encrypts only the FTP command channel (port 21); the data channel (port 20) is not encrypted. To secure data and command, upgrade to a higher version.
If you must use an earlier version, we suggest using SFTP. If SFTP is not available, tunnel FTP only if the data being transferred is not sensitive. For further information about SFTP, see Technical Note 1918.
Before the SSH tunnel has 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 Reflection for Secure IT Server for Windows or UNIX. For details on configuring other SSH server software, refer to your man pages or the product's documentation.
By default, the UNIX SSH server is enabled for TCP port forwarding; see sshd2_config man pages, keywords AllowTCPForwarding, AllowTCPForwardingForGroups, AllowTCPForwardingForUsers.
If forwarding is disabled, follow these steps.
You can use the ssh client to configure both local and remote port forwarding.
To redirect unsecured tcp traffic through a secure ssh tunnel configure the Reflection client with a local listening port on the client's host, a destination host and port and configure your tcp client application (Step II) to connect to the local listening port. Reflection will encrypt tcp traffic received on the local listening port and forward that traffic securely to the destination host.
Remote port forwarding reverses the direction that insecure tcp traffic is forwarding. The tcp client is remote in relationship to the ssh client and the tcp application server is local in relationship to the ssh client. To redirect insecure tcp traffic through a secure ssh tunnel, configure the Reflection client with a listening port on the remote server, a local machine and port and configure your tcp application to connect to the listening port on the remote server. Reflection will encrypt the tcp traffic received on the remote server listening port and forward that traffic securely to the local machine.
The remote forward has been configured to secure printing data being sent to a PC printer using lpr/lpd. Lpd is running on the ssh client machine or local machine and lpr is running on the remote host that is also running the ssh server.
The local port forwarding illustrates the forwarding of FTP client traffic from the ssh client machine to the FTP server on the ssh server machine.
Host host1RemoteForward 2515 localhost:515LocalForward 2100 localhost:21. FTP=1 RDP=0You can create a local tunnel using the Reflection for Secure IT 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 Reflection SSH interface.
Follow the steps below to create a local tunnel.
Note the following:
Important: Localhost is used for the name of the remote machine if the tcp application 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 on which the tcp application is running, enter the name of the host you are connecting to in the Destination Host field. In this instance, the connection between the Reflection SSH client and the SSH daemon is secure, but the connection between the SSH daemon and the target host is not secure.
Beginning in version 6.1, the Local Port Forwarding dialog box enables you to configure several settings including Tunnel Remote Desktop, Forward type, and Application to Launch. For information about these settings, click the Help button on the Local Port Forwarding dialog box.
This tunnel configuration is automatically saved to the user's config file (under SSH config scheme) and will be used again when you connect to the same host (using the same host name).
When the Reflection SSH client receives a local request on the specified source port, the application is connected to the destination port through the SSH tunnel.
To close a tunnel, terminate the host session.
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.
| Field |
Data |
| Local forward |
8080 Note: This number can be any port number over 1024. |
| To remote |
localhost |
| Port |
80 |