Written by , Updated on January 30, 2021

PuTTy is a user-friendly SSH client for the Windows system. Most of the Linux system users are aware and use to connect remote system running SSH server.

It also provides you option to create SSH tunnel to provide access to resource within the trusted internal network. With the help of SSH tunnel you can access resources available on other ports, which is not directly accessible from your system. Once you forwarded your localhost port to the port listening on remote network, you can directly access the the remote service by accessing configured port with localhost.

The Tunnel provides you port forwarding from both sides. The first option shows you option to forward your local port to remote network to access there resources. You can also reverse the process and access resources of your local system from remote machine.

Local Port Forwarding with PuTTY

You can configure local SSH tunneling using the following steps:

  1. Start the PuTTY application on your desktop. In the Session windows, enter the hostname or IP address and port number of the destination SSH server. Make sure the connection type is set to SSH.

    How to Set Up SSH Tunnel with PuTTY General Articles linux port Security SSH tunnel

    Add hostname of the SSH server you want to access remotely.

  2. In the left sidebar under the Category options. Navigate to the Connection >> SSH >> Tunnels.

    How to Set Up SSH Tunnel with PuTTY General Articles linux port Security SSH tunnel

  3. Select Local to define the type of SSH port forward.
  4. In the Source port field, enter the port number to use on your local system. (For example Source port: 5050)
  5. Next, In the Destination field, enter the destination address followed by the port number. (For example Destination: 127.0.0.1:5432).
  6. Verify the details you added and press Add button. You can add multiple entries here.
  7. All done. Connect the SSH session to make the tunnel. The tunnel will work until the SSH session is active

Remote Port Forwarding with PuTTY

The Remote forwarding allows a remote system to access resources from your local machine. Remote forwarding represents an inversion of the local forwarding process as described above.

  1. Start the PuTTY application on your desktop. In the Session windows, enter the hostname or IP address and port number of the destination SSH server. Make sure the connection type is set to SSH.

    Add hostname of the SSH server you want to access remotely.

    How to Set Up SSH Tunnel with PuTTY General Articles linux port Security SSH tunnel

  2. In the left sidebar under the Category options. Navigate to the Connection >> SSH >> Tunnels.

    How to Set Up SSH Tunnel with PuTTY General Articles linux port Security SSH tunnel

  3. Select Remote to define the type of SSH port forward.
  4. In the Source port field, enter the port number to use on your local system. (For example Source port: 8080)
  5. Next, In the Destination field, enter the destination address followed by the port number. (For example Destination: 192.168.0.101:65001).
  6. Verify the details you added and press Add button. You can add multiple entries here.
  7. All done. Connect the SSH session to make the tunnel. The tunnel will work until the SSH session is active

Conclusion

This tutorial helped you to setup local and remote SSH tunnel via the Putty application on Windows server. Which allows to your access services running on remote system or network via SSH network, where you don’t have directly access via port.