Forwarding a Service via Tunnels

SSH tunneling, or port forwarding, allows you to securely forward a network port from a remote server to another machine. This guide explains how to forward a remote service to a third party.


The model for this type of tunnel can be thought of as a three-part chain:

Tunnel Model
Near <--> Middle <--> Far
  • Near: Your local machine.
  • Middle: An intermediary server that you can connect to.
  • Far: The final destination server with the service you want to access.

In this scenario, you connect from "Near" to "Middle" to access a port on "Far".