SSH Tunneling

Using ssh to create a secure tunnel Tunneling

Using OpenSSH on a Linux/Unix system you can tunnel all of the traffic from your local box to a remote box that you have an account on.

For example return all outbound E-mail traffic back to your server to avoid having to change SMTP servers, use SMTP-AUTH, etc.

To set up an SSH tunnel, one configures an SSH client to forward a specified local port to a port on the remote machine. Once the SSH tunnel has been established, the user can connect to the specified local port to access the network service. The local port need not have the same port number as the remote port.


ssh contains support for Virtual Private Network (VPN) tunnelling using the tun network pseudo-device, allowing two networks to be joined securely. The sshd_configconfiguration option PermitTunnel controls whether the server supports this, and at what level (layer 2 or 3 traffic).