Tunnelling via SSH

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: username@example.com
Above code starts a tunnel to where is the RDP server ip address and 3389 is the RDP port.

Secondly, connect to via any RDP client.