My requirements are as follows
- All of our cloud machines need the same config (User, Port, IdentityFile)
- I need these settings to be applied to them based on domain (*.xyz.com)
- I also need these settings to be applied when i setup short hosts (See below)
My current SSH config is a
Host shortname1? Hostname %h.prod.xyz.comHost test-myname Hostname combo.test-myname.xyz.comHost *.xyz.com Hostname %hHostname *.xyz.com User myuser Port 12345 IdentityFile ~/.ssh/id_rsa
The exact use cases are ssh shortname1a; ssh shortname1b; ssh test-myname; ssh combo.test-myname.xyz.com
Host *.xyz.com
was a recent addition after debugging for the last use case, and this somehow seems to break the first 2.
Is this the right way or is there a neater way?