Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 stackoverflow.com Oct 31 '12 at 22:35

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

1 Answer 1

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

Your Answer

 
discard

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