News for hackers. Stuff that matters.
Re:Using SSH_config Match to connect to a host using multipl... by mmh0000 on Wednesday August 17, 2022 @11:54AM (#32497993)
I love Match. I use it to automatically select my bastion/jump host when not on my home network and not on my local VPN:

  $ cat ~/.ssh/config
  # Define external nodes here
  …SNIP…
  # If connecting to a *.xn0.org host and router.xn0.org = 10.0.0.1, must be home/vpn.
  Match host *.xn0.org exec "getent ahosts router.xn0.org | grep -q ^10.0.0.1"
      ProxyJump  none
  # If connecting to a *.xn0.org host and the macaddr of 10.0.0.1 is NOT f0:9f:XX:XX:XX:XX, then use jump.xn0.org:
  Match host *.xn0.org exec "! arp -ne 10.0.0.1 | grep -Fq f0:9f:XX:XX:XX:XX"
      ProxyJump  jump.xn0.org
  # Define internal nodes here
  …SNIP…

There are no comments on this comment yet.