Skip to content
TopicTracker
From HackerNewsView original
TranslationTranslation

A Practical Guide to SSH Tunnels: Local and Remote Port Forwarding

This tutorial explains how SSH tunnels work for local and remote port forwarding, covering practical use cases like accessing private networks, bypassing firewalls, and securing services. It includes command examples and step-by-step setup instructions for both types of forwarding.

Background

SSH (Secure Shell) is a standard protocol used to securely connect to remote servers over an unencrypted network. This tutorial covers SSH tunneling (port forwarding), a technique that routes network traffic through an encrypted SSH connection. It is commonly used to access services behind firewalls, bypass network restrictions, or encrypt otherwise unencrypted traffic (e.g., connecting to a database on a private network from a local machine). The guide explains two directions: local forwarding (tunneling traffic from your machine to a remote server) and remote forwarding (exposing a service on your local machine to a remote network). Understanding SSH tunnels is a core skill for developers, sysadmins, and DevOps engineers who work with remote infrastructure.