A 1-post collection

SSH Tunneling - Connecting to a forbidden port

Refer to:

You are blocked from making connection to a port, say, 6666. Luckily, you still can connect to a remote server via port 22 (ssh).

We can do SSH tunneling to get through the firewall via port 22 (which is not blocked here) and use a pivotal server to connect to the port 6666 relaying all the data back to us behind the firewall.

ssh -L <local_port>:<target_host>:<target_port> <pivotal_host>  

In this case, it might be:

ssh -L [email protected]  

Then, you can ssh, via the, to the using

ssh [email protected] [-p 22]  

Note : use localhost here because ssh has bound the port 22 on this machine.


อ่านต่อ »