Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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 know how to use http_proxy to redirect http request, but how to redirect the data with a socket5 proxy such as a SSH tunnel?

share|improve this question
What do you mean? Do you want to redirect the output of a command through the network? Or to redirect an HTTP request through an SSH tunnel? Or something else? Please clarify. – Gilles Apr 2 '12 at 22:45

For bash network request to redirect through socket5 proxy, you have to export http_proxy variable:

$ export http_proxy=socks5://username:passwd@socks5_proxy_ip:port

share|improve this answer
This is unrelated to bash, it is up the the started application if to use or not the value of that variable. – enzotib Apr 2 '12 at 6:57
I encourted the Unsupported scheme socks5'` error. – steveyang Apr 3 '12 at 5:57

Look at the tsocks application, it is able to transparently redirect every network request of a controlled application through a given socks proxy.

share|improve this answer

The only way I could make it work reliably (on MacOS, but I expect bash behaves the same in unix/linux) was using proxychains.

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.