Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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

I have configured an SSH tunnel to forward my web traffic from hostA to hostC using this command on hostA:

    ssh -D 2222 user@hostC

after configuring my browser to use a proxy on port 2222. This works great. However, I now want to forward the same traffic through an intermediate SSH connection on hostB in order to get to hostC.

I tried this on hostA:

    ssh user@hostB -L 2222:hostB:22

but I get "channel x: open failed" errors. Does anyone know the correct way of doing this?

share|improve this question

migrated from Oct 31 '12 at 22:35

This question came from our site for professional and enthusiast programmers.

On hostA:

ssh -L8080:localhost:22222 user@hostB

On hostB:

ssh -D22222 user@hostC

Then on hostA you can use localhost:8080 as SOCKS5 proxy.

share|improve this answer

You must log in to answer this question.