by kyrra · 12y ago · 0 comments
Host hosta hostb hostc
User usera
Host *
User userb
Since my local system username was different than many of the remote systems I could wildcard to a different default username then had a list of servers that would use my other username.The bad thing is, as the blog post shows, "Host" above is really just an alias. So if I have an entry like:
Host hosta.mycompany.com
User usera
and then try to do "ssh hosta", even if hosta resolves to hosta.mycompany.com, it won't match the config entry, as config entry data is all used prior to DNS lookup.EDIT: thanks for all the suggestions below.
Host hosta hostb hostc
HostName %h.mycompany.com
User usera
I believe this isn't a super-new feature -- every ssh version I've run into client-side in the last couple years has supported it. Host hosta* hostb* hostc*
User usera
Assuming you don't have two different machines named hosta with different domain names, it should do what you want. Host hosta.mycompany.com
User usera
and then type "ssh hosta<tab>" :)