How to Create a Reverse SSH Tunnel

From RidgeRun Developer Connection
Revision as of 16:49, 10 November 2021 by Asolis (talk | contribs) (Introduction)
Jump to: navigation, search

Introduction

Oftentimes, a remote device needs to be accessed through SSH but it's not reachable due to network conditions, security requirements, etc.

SSH Connection Blocked

A reverse SSH tunnel is a solution to that problem. Basically, the hard-to-reach device will create a tunnel to a specific device we have access to. From now on, we will use the following notation:

  • Local Device
The device to which we have easy access (your laptop, for example).
  • Remote Device
The device that is hard to access (usually it's far away from us, or it's someone else's device).

The following diagram represents the local device to the left, the remote device to the right, and the tunnel enabling the connection.


SSH Reverse Tunnel Diagram

Instructions

Now you will find instructions to create a reverse SSH tunnel.