I’m trying to create an SSH alias in my .ssh/config file that will match any host which ends .vpn and expand the hostname to [name].vpn.domainname.com
I’m able to match any .vpn domain by specifiing the host as Host *.vpn but I’m having trouble extending the domain.
Ideally I want something like:
Host *.vpn
HostName $HOST.domainname.com
I’ve had a look around but I can’t find any examples of SSH aliases like this.
http://collectiveidea.com/blog/archives/2011/02/04/how-to-ssh-aliases/
http://osxdaily.com/2011/04/05/setup-ssh-config-fie/
Is this sort of alias possible with an SSH alias? If so how can it be done? If not, any other ideas how I could achieve this result?
I really want to stop having to type out the full domains, and it would be nice not to have to add 50 or so aliases for each of the machines on the vpn.
From the
ssh_config(5)man page: