What command should be used to connect via SSH through squid proxy?

Posted by Raul Cardoso on Server Fault See other posts from Server Fault or by Raul Cardoso
Published on 2013-10-22T17:10:12Z Indexed on 2013/10/23 10:00 UTC
Read the original article Hit count: 372

Filed under:
|
|
|
|

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)

© Server Fault or respective owner

Related posts about ubuntu

Related posts about ssh