This thread: In your ssh config is it possible to have one host entry for multiple machines on the same domain explained the 'aliases' part of my question, I was wondering if it's possible to set default username AS well as use domain aliases, so I can simply have to write something like:
ssh subdomain
I have the following in my /etc/resolv.conf file:
search my_cool_domain.com
and the following in my ssh_config file:
Host *.my_cool_domain.com
User deploy
So I figured the following will work:
ssh subdomain
will try to connect to subdomain.my_cool_domain.com
with user deploy
but this does not work for some reason.
Although the following:
ssh deploy@subdomain
does work, as well as:
ssh subdomain.my_cool_domain.com
Any idea how can I fix this (If it's even possible) in an elegant way?