by mpapi · 12y ago · 0 comments
Host bos-??
HostName %h.mydomain.com
IdentityFile ~/.ssh/my-boston-key
Host nyc-??
HostName %h.mydomain2.com
IdentityFile ~/.ssh/my-nyc-key
and log in with e.g. "ssh bos-14". Host *.amazonaws.com
User ec2-user
IdentityFile ...
And then it is just ssh ec2-X-X-X-X.compute-1.amazonaws.comThanks though, I didn't know about the ?? syntax.
The patterns are similar to shell globs: * matches zero or more characters, ? matches exactly one.