I have a system with both a public (e.g server1.foo.bar) and privately-resolvable (e.g. server1.internal.foo.bar) DNS name. SSH connections are only possible via the private IP, but I always think of these hosts in terms of their public name.
I would like to:
- connect to the right IP regardless of whether I remember to use the
- save keystrokes
I'm aware of the substitution tokens such as
%h that can be used to modify the hostname given at the commandline, e.g.
The behavior I'm looking for would be something like:
%m gets substituted with just the portion of the given hostname up to the first dot. I've read
man 5 ssh_config as well as https://man.openbsd.org/ssh_config and couldn't find the answer, if one even exists. I'm using macOS 10.15.4:
$ ssh -V
OpenSSH_8.1p1, LibreSSL 2.7.3