a question to SSH-tunneling. I am trying to proxy Firefox over a Pi, that is in a network behind a NAT. This Pi builds a reverse SSH tunnel to one of my servers, which works pretty well.
When proxying, I usually run 'ssh -N -D54321 -f user@host' and tell my Firefox to forward everything to port 54321, but this time I am overasked.

Is it possible to effectively chain SSH-tunnels, including a reverse SSH-tunnel? And if yes, what is the easiest and most effective way to do so? In short terms - how do I tunnel an application from my computer over a server to a reverse tunneld pi? Thanks in advance!

(I'm using proxychains as a proxifier if this is relevant)

1 Answer 1


One very easy way to do it is to use a recent version of OpenSSH which supports the -J flag (or the ProxyJump configuration):

ssh -N -D54321 -f -J user@onehost,user@anotherhost,user@yetanotherhost user@finalhost
  • Thanks, that's it! In my case tho command I execute is: ssh -N -D54321 -f -J user@server user@localhost -p19998 - so without comma.
    – t3ngu
    Jul 6, 2017 at 15:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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