Sometimes, the access to the lab/office computer is necessary. However, the university/company/organisation blocks my direct connection by its firewall, which is not good 🙁
Nevertheless, we can SSH to some computers in DMZ and then tunnelling to the lab/office computer for some specific applications.
Here, we leverage the forward function of SSH as following:
ssh -L port:host:hostport user@hostname
For example, we connect to a RDP server via SSH tunnel.
First, start the tunnel by
ssh -L 3389:126.96.36.199:3389 email@example.com
Above code starts a tunnel to 188.8.131.52:3389 where 184.108.40.206 is the RDP server ip address and 3389 is the RDP port.
Secondly, connect to 127.0.0.1:3389 via any RDP client.