Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

this is my setup right now: A. My NAS with static IP, reachable via SSH from the Internet (OS X) B. a VPS (Ubuntu Server) C. a dedicated server (Gentoo)

My question: Due to bad peering i want to tunnel all my SSH traffic from A to C through B (rsync, flexget,... running on A)

I know how to rsync using a tunnel but i can't really figure out how to make it happen so it's pushing all the traffic through the tunnel.



share|improve this question

Another way is to use netcat as an ssh proxy command. Append this to the file ~/.ssh/config on Host sourcehost:

Host targethost
    ProxyCommand ssh -q viahost nc -q0 C 22

Then ssh targethost on Host sourcehost should tunnel via Host viahost. Rsync etc. should also work. Consider to use ControlMaster like this:

ControlMaster auto
ControlPath $HOME/.ssh/tmp/%h_%p_%r
share|improve this answer

Tunelling ssh connection is quite easy. Step by step well written tutorial is here. You need to setup tunnel on the middle machine.

Then when you connect from A to B on specific port you will automatically connect to C.

If you want to pass all traffic - like https via tunnel you will need to install squid proxy and redirect traffic from 443 port through yout tunnel.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.