3 ms·
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 exter
by mmh0000 4y ago
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…