Re: How do I use ProxyCommand to connect to remote host using shared session enabled by ControMaster?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Feb 8, 2011 at 10:08 AM, Asif Iqbal <vadud3@xxxxxxxxx> wrote:
> On Tue, Feb 8, 2011 at 5:24 AM, Igor Bukanov <igor@xxxxxxxx> wrote:
>> On 8 February 2011 04:20, Asif Iqbal <vadud3@xxxxxxxxx> wrote:
>>> Is it possible to make it work as default for all hosts except the jumphost?
>>>
>>> I tried to replace the remotehost with `*' and then tried to fresh
>>> start, like below
>>
>> I suppose you cannot do that since host * provides defaults for all
>> hosts irrespective of the order. You can try to add an empty
>> ProxyCommand to jumphost.
>>
>
> Hopefully I am not pushing it :-) , but is it possible to factor in
> the IP network I am connecting from in my config file?
>
> So if I am connecting from 192.168.1.0/24 block, usually when I am
> home, *only* then login to remotehost using the proxy command.
>
> But if I am connecting from 10.13.137.0/22 block, usually when at
> work, do not use proxy command.

I think I got it

$ cat ~/.ssh/config

host jumphost
 hostname jumphost.example.net
 ForwardX11 yes
 ControlMaster auto
 ControlPath ~/.ssh/%r@%h:%p
 ProxyCommand none
host from="!*.ad.work.com"
 ProxyCommand ssh -T -a jumphost nc %h %p

So it skips the proxy command now when connecting from work. I will
test some more from home.

Thanks again!

>
>
>
>
>
> --
> Asif Iqbal
> PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
> A: Because it messes up the order in which people normally read text.
> Q: Why is top-posting such a bad thing?
>



-- 
Asif Iqbal
PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?


[Index of Archives]     [Open SSH Unix Development]     [Fedora Users]     [Fedora Desktop]     [Yosemite Backpacking]     [KDE Users]     [Gnome Users]

  Powered by Linux