Setup a Linux SSH Tunnel

SSH tunneling comes in very handy when you have to forward local network traffic to a remote host. This is basically a simple VPN and your traffic is encrypted.

For example you have a remote server RemoteServer1 and you want to access an application running on port 7500 of that server from your localhost at port 8110.

Open putty and expand to connection>SSH>Tunnels and enter source and destination settings as follow and apply

Now when the ssh session is open enter the following

ssh -g -N -f -L 8110:RemoteServer1:7500 remoteServer1User@RemoteServer1

-L Specify local port
-F Run ssh in background
-N Not allow access to shell
-g Allow remote host to connect to local forwarded ports

You should be able to access the remote server 1 service running on 7500 on your localhost at port 8110.

About: Muhammad Ali

I am a Java and Tibco expert. I have Master's degree in software engineering of distributed systems from Royal Institute of technology KTH Stockholm Sweden and I am an expert software engineer and integrator with over a decade of industry experience from Europe, Gulf and Asia regions. I am a strong opensource believer and encourage "sharing as caring" principle.