Port forwarding with SSH

To forward port with SSH:

Local port forwarding

ssh -f -N -g -L <local port>:<remote host>:<remote port> host

In this all traffic which will come to local port will be redirected to remote port on remote host.

Remote port forwarding

ssh -f -N -g -R

In this the traffic which will come to Remote port on remote host will be redirected to local port.

Neelesh Gurjar has written 122 articles

Leave a Reply