Disable corkscrew for local addresses

I have a corkscrew question that I use to get SSH to work through an HTTP proxy. SSH works great with external hosts, but not for local hosts. How can I disable SSH to connect to local servers through an HTTP proxy? I think this is the problem why I get:

root@V01-XXXX:~# ssh root@172.XX.XX.8
Proxy could not open connnection to 172.XX.XX.8:  Forbidden
ssh_exchange_identification: Connection closed by remote host

My / etc / ssh / ssh _config file contains:

Host *
ProxyCommand /usr/bin/corkscrew proxy.ezorg.nl 8080 %h %p

Thanks in advance!

+3
source share
4 answers

First of all, you might consider putting the configuration in ~/.ssh/configinstead of / etc / ssh / ssh_config.

To just use a corkscrew for some specific hosts, do not use an asterisk, but list specific hosts, for example:

Host external.com example.com
ProxyCommand /usr/bin/corkscrew proxy.ezorg.nl 8080 %h %p

, -, .

Host * !192.168.0.? !*.local 
ProxyCommand /usr/bin/corkscrew proxy.ezorg.nl 8080 %h %p

, 192.168.0.0/24 .local

+6

ssh_config, . - :

Host *.local host1 host2 host3
    ProxyCommand none
+2

Thank you all for your help. On wheezy he did not allow localhost(I can not find why), but worked fine with:

Host 127.0.0.1
ProxyCommand none

Host *
ProxyCommand /usr/bin/corkscrew <proxy> <proxyport> %h %p 
+1
source

Extending @Michael Slade's answer, the .ssh/configfollowing works in yours :

Host localhost
ProxyCommand none

Host *
ProxyCommand corkscrew proxy.com ....

Only the first occurrence of the parameter is read ssh.

0
source

All Articles