Confessions and Confusions of a Freelance Fullstacker.

Ashok Mannolu Arunachalam, How toSSHLinux

How to ssh tunnel to a remote server in linux

In our project, we regularly deploy our app to one of our clients servers via their VPN.

After successful deployment, we need to verify the app of course. Usually you can type the IP address with the app's port on the browser.

Recently, one of our clients have turned off the direct browser access and permitted only via SSH tunneling.

Tunnel localhost to remote server

Using the below command, we can tunnel our local request to remote server including the port forward.

$ ssh -N [email protected] -L 8080:localhost:8080
NNo shell after this
LForward port

Now the 8080 port of the server is tunneled to through our localhost:8080.

Use -f flag to keep the session running in the background.