Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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.

Used:

  • 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

login:password

Restarted ssh and used a simple ssh command

ssh mylogin@targethost

(ssh password was asked as usual)

share|improve this question

1 Answer 1

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 proxy.work.com 80 %h %p

to your .ssh/config file.

share|improve this answer

Your Answer

 
discard

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.
{"cc_re__cc_re__cc_by_sa_3_0": ["                  <li><a href=\"//area51.stackexchange.com\" title=\"proposing new sites in the Stack Exchange network\">Area 51</a></li>\r\n                        <li><a href=\"//careers.stackoverflow.com\">Stack Overflow Careers</a></li>\r\n                    \r\n                </ol>\r\n            </td>\r\n    </tr>\r\n</table>\r\n                </div>\r\n            </div>\r\n\r\n            <div id=\"copyright\">\r\n                site design / logo &#169; 2015 stack exchange inc; user contributions licensed under <a href=\"http://creativecommons.org/licenses/by-sa/3.0/\" rel=\"license\">cc by-sa 3.0</a> \r\n                with <a href=\"http://blog.stackoverflow.com/2009/06/attribution-required/\" rel=\"license\">attribution required</a>\r\n            </div>\r\n            <div id=\"svnrev\">\r\n                rev 2015.5.28.2613\r\n            </div>\r\n            \r\n        </div>\r\n    </div>\r\n    <noscript>\r\n        <div id=\"noscript-warning\">Server Fault works best with JavaScript enabled<img src=\"http://pixel.quantserve.com/pixel/p-c1rF4kxgLUzNc.gif\" alt=\"\" class=\"dno\"></div>\r\n    </noscr"], "copyright__copyright__copyright": ["n@targethost\n\n(ssh password was asked as usual)\n\nshare|improve this question\n\n1 Answer 1\n\nup vote 1 down vote accepted\n\nYou may want to add corkscrew to your Ubuntu box, and add this line:\n\nProxyCommand /usr/local/bin/corkscrew proxy.work.com 80 %h %p\n\nto your .ssh/config file.\n\nshare|improve this answer\n\nYour Answer\n\n\u00a0\ndiscard\n\nBy posting your answer, you agree to the privacy policy and terms of service.\n\nNot the answer you're looking for? Browse other questions tagged or ask your own question."]}