Klemens Nanni <[email protected]> wrote:
> On Tue, Dec 04, 2018 at 10:19:55AM +0100, Solene Rapenne wrote:
> > 
> > ssh(1) doesn't seem to resolve a ProxyJump hostname using /etc/hosts when 
> > the
> > hostname is a fqdn.
> No comment (yet) on whether this should be changed or not, but a general
> advise below.
>  
> > I use that case when I move to my workplace, I would like to uncomment an 
> > entry
> > in /etc/hosts to override the destination of all my proxyjump
> Editing hosts(5) each time you move sounds flawed/tedious.
> 
> How about this:
> 
>       # ~/.ssh/config
>       Match exec ~/.ssh/work/at_office.sh
>               Include work/config
> 
>       # ~/.ssh/work/config
>       Host google.fr
>               Hostname 127.0.0.1
> 
> I used to use the following at_office.sh to set work related settings
> based on the fact whether I could recognise a certain host by its TLS
> certificate reachable only from the office LAN:
> 
>       nc -cdvzw2 hostname service 2>&1 |
>               grep -qxF 'Cert Hash: SHA256:b93f...'
> 
> `Match exec' is quite powerful in terms of dynamic configuration.

indeed, due to this I found about "exec" in order to "fix" my problem, I use
the command "ping -c 1 -w1 %h" very effective, this works because the domains
names can't be resolved from outside.

Reply via email to