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 have set up a Squid HTTP Proxy (in centOS) and intended to use it also for ssh connections.

Managed to configure putty (in a windows client) to use this proxy while connecting by ssh. Confirmed in the "target host" that the ssh connection was coming from Proxy server ip instead of the windows client IP.


  • targethost: 22 for ssh

  • proxyserv: 3128 for proxy (along with proxy credentials)

I'm now having problems connecting to the "target host" using Ubuntu and the same proxy server.

I have tried the following:

me@mycomp:~$ connect-proxy -H test@proxyserv:3128 targethost 22
Enter proxy authentication password for test@proxyserv: 
SSH-2.0-OpenSSH_6.2p2 Ubuntu-6

It hangs in last line, expecting some input. All attempts resulted in a "Protocol mismatch." error.

Putty successfully connects to the http proxy and sends credentials, showing me ssh login right away. - How to do (with commands in Ubuntu) the same putty does? - Is there any other way than connect-proxy command to do this?

Edit: Also tried the following with same result ("Protocol mismatch")

me@mycomp:~$ connect-proxy -H test@proxyserv:3128 targethost 22 ssh -l myshel_login

Thanks in advance

Edit: Solution details (thanks to NickW pointing the right way)

installed corkscrew and added to ssh_config

Host targethost   
    ProxyCommand corkscrew proxyserv 3128 %h %p /etc/ssh/proxypass

created proxypass file


Restarted ssh and used a simple ssh command

ssh mylogin@targethost

(ssh password was asked as usual)

share|improve this question
maybe this will help?… – user16081-JoeT Oct 22 '13 at 17:27
Thanks, I have Checked. In that case, the goal is to access HTTP. As I have a proxy I don't need tunneling, just browser definitions for that.I do need to access SSH (over the proxy), but looks like it expects a HTTP request. Putty successfully "informs" squid we want SSH, and I get shell access over the proxy, but I can't do this with commands. [Edited question] – Raul Cardoso Oct 23 '13 at 8:36
up vote 1 down vote accepted

You may want to add corkscrew to your Ubuntu box, and add this line:

ProxyCommand /usr/local/bin/corkscrew 80 %h %p

to your .ssh/config file.

share|improve this answer
Thanks NickW. Not so straightforward for other employees to configure as a command, but does the trick perfectly. Edited question with details on my implementation hoping it helps someone. Cheers! – Raul Cardoso Oct 23 '13 at 9:48
Glad to have been of assistance! – NickW Oct 23 '13 at 10:09

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.