Is production: true
#migrated

Title: How to do port forwarding through ssh

Created: 19 Mar 2023 Modified: 19 Mar 2023

Description:



[Legacy Link]

Port forwarding in SSH is a very useful tools and can help on a lot use case.

This how to will cover the local port forwarding techniques.

Before start

We have to under some command option of SSH first.

Type the script to see the man page of SSH

man SSH
Options Simple Description
f allow the ssh to be run in back
L Local port forwarding, redirect local portA1 on LocalServer to the port portB1 on Server Be.g.-L portA1:Server B:portB1 ==> local host-L *:portA1:Server B:portB1 ==> Any request ip-L 127.0.0.1:portA1:Server B:portB1 ==> fixed input ip
N No command will be executed after connect built
p dedicated ssh port for jumping server

Instructions

  1. Setup SSH

    ssh -p1234 -LfN <local server>:<local port>:<dedicated server>:<dedicated port> user@<jumpping server>