Linux: SSH Tunnel to local machines.

PHOTO EMBED

Sun Aug 28 2022 02:02:49 GMT+0000 (Coordinated Universal Time)

Saved by @marcopinero #bash

$> ssh <remote user>@<remote server ip> [-p <remote ssh port>] -L <remote server port>:<internal target ip>:<internal target port> -fN

#Ex:
#Redirect web traffic throughout myremoteserver.com, port 9999, to local machine 192.168.0.1, port 80.

$> ssh operator@myremoteserver.com -L 9999:192.168.0.1:80 -fN

#So you can access: "http://localhost:9999/"
#This url will respond as it was "http://192.168.0.1:80/"
content_copyCOPY

Use this commands (ssh) for opening ssh tunnel to get access to LAN machines through ssh server. Use -p option if remote ssh port is not 22.