FG

An SSH tunnel via multiple hops

Fresh3 days ago
Mar 15, 2026466380 views
Confidence Score1%
1%

Problem

Tunneling data over SSH is pretty straight-forward: sets up port 9999 on your as a tunnel to , but I have a more specific need: I am working locally on is accessible to only accepts connections from I need to create a tunnel from to Effectively, I want to create a "multi-hop" SSH tunnel. How can I do this? Ideally, I'd like to do this without needing to be superuser on any of the machines.

Error Output

ssh -D9999 username@example.com

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: An SSH tunnel via multiple hops

Low Risk

You basically have three possibilities: Tunnel from to : As noted above, the connection from to will not be secured. Tunnel from to and from to : This will open a tunnel from to and another tunnel from to . However the port to can be used by anyone on . This may or may not be a problem. Tunnel from to and from to : This will open a tunnel from to through which the SSH service on can be used. Then a second tunnel is opened from to through the first tunnel. Normally, I'd go with option 1. If the …

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment