Server Fault is a question and answer site for system and network administrators. 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

I am using the ssh to try to connect to a server behind on remote network. That server is behind a socks5 proxy on the same network. The port of the proxy server is 1080 and the ssh port is 22. However this fails. The debug says that connection is refused on port 22.

I thought it was necessary to install corkscrew so it installed it with homebrew and used this link as a reference:

debug1: Reading configuration data /Users/jason/.ssh/config debug1: Applying options for XXX.XX.XX debug1: Reading configuration data /etc/ssh_config debug1: Executing proxy command: exec /usr/local/bin/corkscrew proxy.server 1080 XX.XXX.XX.XX 22 debug1: identity file /Users/jason/.ssh/identity type -1 debug1: permanently_drop_suid: 501 debug1: identity file /Users/jason/.ssh/id_rsa type 1 debug1: identity file /Users/jason/.ssh/id_dsa type 2

share|improve this question

migrated from Oct 29 '10 at 7:25

This question came from our site for computer enthusiasts and power users.

I am not sure if this would be better on server fault, or maybe even the ubuntu stack exchange. – jimiyash Oct 29 '10 at 1:10
Wait, are you trying to connect to a SOCKS proxy, or are you trying to create a SOCKS proxy? – Ignacio Vazquez-Abrams Oct 29 '10 at 1:16
On the remote server network there is a socks5 proxy server and I am trying to connect to a server behind that socks5 proxy server. I am not trying to create one. – jimiyash Oct 29 '10 at 1:24
Corkscrew is for HTTP proxies, not SOCKS proxies. – Ignacio Vazquez-Abrams Oct 29 '10 at 2:41
@Ignacio - ok. could you give me a little more complete answer on how to use ssh connect? – jimiyash Oct 29 '10 at 2:46
 ssh -o ProxyCommand='nc -x %h %p'

where is the socks5 proxy. Credit: Jethro Carr

share|improve this answer

-D creates a SOCKS proxy. If you want to connect via a SOCKS proxy instead then you'll have to use connect as a proxy command.

share|improve this answer
Thank you. I updated the question to make it a little clearer. – jimiyash Oct 29 '10 at 2:34

you'll need a connect module for ssh which is able to connect through SOCKS.

We use it in our Lab all the time, here's our documentation on how to get it:

In Ubuntu (and I believe so in Debian too) it's available as package, just install with

apt-get install connect-proxy

it will get installed as /usr/bin/connect-proxy

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.