I make use of an .ssh/config file to set my username appropriately based on a given portion of a subdomain, e.g.
Host *widgetshop.com*
User foobar
ControlMaster auto
ControlPath ~/.ssh/socket-%r@%h:%p
Host *
ControlMaster auto
ControlPath ~/.ssh/socket-%r@%h:%p
This works if I write:
ssh foo.widgetshop.com
but does not work if I were to write:
ssh foo
which upon search path resolution becomes the same fqdn.
Anyone have a way to expand shortnames before calling ssh, or an alternative approach?