Re: How do I use ProxyCommand to connect to remote host using shared session enabled by ControMaster?
Asif Iqbal <[email protected]> Tue, 8 Feb 2011 15:18:57 -0500
| Newsgroups | gmane.network.openssh.general |
|---|---|
| Message-ID | <[email protected]> |
On Tue, Feb 8, 2011 at 10:16 AM, Asif Iqbal <[email protected]> wrote: > On Tue, Feb 8, 2011 at 10:08 AM, Asif Iqbal <[email protected]> wrote: >> On Tue, Feb 8, 2011 at 5:24 AM, Igor Bukanov <[email protected]> wrote: >>> On 8 February 2011 04:20, Asif Iqbal <[email protected]> wrote: >>>> Is it possible to make it work as default for all hosts except the jum= phost? >>>> >>>> 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 > =A0hostname jumphost.example.net > =A0ForwardX11 yes > =A0ControlMaster auto > =A0ControlPath ~/.ssh/%r@%h:%p > =A0ProxyCommand none > host from=3D"!*.ad.work.com" > =A0ProxyCommand ssh -T -a jumphost nc %h %p host from=3D"!.*.ad.work.com" won't work. so I still need to find out if it is possible? That is, can I modify the .ssh/config in such that if I am coming from corporate network don't use the proxy command ? I use the same laptop from work and home. So I will have the same .ssh/config file. When I am connecting from home the proxy command works fine. But I like to disable the proxy command when I am connecting from work, because I do have direct access to the remotehosts. No need to jump through jumphost. > > 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? > --=20 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?