You are not logged in.

#1 2007-09-27 19:37:23

big_gie
Member
Registered: 2005-01-19
Posts: 637

ssh_config question

Hi,

I need to pass through a proxy server to connect by ssh. For this, I have have the file:
~/.ssh/config

Host *
    ProxyCommand corkscrew PROXYIP 8080 %h %p

But with this, I cannot connect to localhost because it will try to pass into the proxy.

I'm then looking for a way to say "use proxy for all host EXCEPT for localhost". Is it possible?!?

Thanx!

Offline

#2 2007-09-27 19:49:10

tam1138
Member
Registered: 2007-09-10
Posts: 238

Re: ssh_config question

From the ssh_config manpage:

       A pattern-list is a comma-separated list of patterns.  Patterns  within
       pattern-lists may be negated by preceding them with an exclamation mark
       (`!'.)  For example, to allow a key to be used from anywhere within  an
       organisation  except  from the ``dialup'' pool, the following entry (in
       authorized_keys) could be used:

       Dl from="!*.dialup.example.com,*.example.com"

Offline

#3 2007-09-27 20:15:40

big_gie
Member
Registered: 2005-01-19
Posts: 637

Re: ssh_config question

Thanx tam1138.
Unfortunately, I've tried this but doesn't work... I have tried "Host !localhost,*", "Host !localhost *", "Host * !localhost", "Host !myhostname *" but they all ignore the localhost part. As is it wasn't there.

Offline

#4 2007-09-27 20:36:11

tam1138
Member
Registered: 2007-09-10
Posts: 238

Re: ssh_config question

Did you try "Host !localhost" ?  I don't see it on the list there, and I think it's what you want.  By using some combination of "!localhost" and "*", you're saying "not localhost" and "everything", in which case localhost gets matched by the latter.

Offline

#5 2007-09-27 20:48:26

big_gie
Member
Registered: 2005-01-19
Posts: 637

Re: ssh_config question

I just tried it. The proxy setting is then never set. I can connect to localhost, but not to external servers...
Thanx again for your suggestion.

Offline

#6 2007-09-27 22:26:22

tam1138
Member
Registered: 2007-09-10
Posts: 238

Re: ssh_config question

Huh.  That seems broken to me.  (Though I can corroborate your findings. smile )

This configuration worked:

Host localhost
    ProxyCommand none

Host *
    ProxyCommand corkscrew PROXYIP 8080 %h %p

Offline

#7 2007-09-27 23:06:11

big_gie
Member
Registered: 2005-01-19
Posts: 637

Re: ssh_config question

YESS!!!!!!!!!!! It works!
Finally! haha thanx a million times smile

Offline

Board footer

Powered by FluxBB