☰ Categories

Linux: reverse ssh simplified

If you are tired of reading long blog posts of using reverse ssh you came to the right place.

Scenario:
You want to connect from your workstation to a server.
Both are on their own networks and are behind NAT.

Target: Server behind firewall
Jump: Server on the internet that you have control of the firewall
Source: Your Workstation behind firewall

Steps (Target connects to Jump, Source connects to Jump, From Jump you connect to Target):

  1. Target:
    ssh -fN -R 45000:localhost:22 username@Jumpserverip
  2. Source:
    ssh username@jumpserverip
  3. Jump:
    ssh useronTarget@localhost -p 45000