Blog / Home
About
Media Gallery

Welcome
to
Thronic.com

ժʝ_

SSH Tunneling


Examples of using OpenSSH for both CLI access, SFTP AND Tunneling.
Avoid exposing vulnerable ports, and use encrypted tunneling instead.

GNU/LINUX Scenario:
Tunnel from localhost:7777 that goes through my SSHD server to remotehost:21 (FTP):
ssh -L 7777:remotehost:21 [email protected]

GNU/LINUX Scenario:
Tunnel from remotehost:7777 that goes to my local webserver:80 (WWW):
ssh -R 7777:localhost:80 [email protected]

WINDOWS Scenario:
Tunnel from localhost:7777 that goes through my SSHD server to remotehost:3389 (RDP):
PuTTY > Connection > SSH > Tunnels > (Add source and destination:port)

From Command Line:
putty.exe -ssh <same command(s) as in GNU/Linux> -l user -pw password

Remote tunneling may require GatewayPorts yes in /etc/sshd_config. Add -fNT as a parameter if you only want to do background port forwarding without opening a shell.


Original Post: Jan 26th, '22 17:30 CET.
Updated: Jan 26th, '22 17:33 CET.

Windows GNU/Linux
π