Friday, June 28, 2019

linux - simplify ssh hostnames with wildcard

I got many servers with names ending in 001, 002, 003 and I want to rename them into something simpler; something like this:


Host server*
User user
HostName server-xxx-yyy-zzz-*
Host client*
User user
HostName client-xxx-yyy-zzz-*

And then ssh server001 is executed like ssh server-xxx-yyy-zzz-001


Is there any way to do this with only ssh-config? can I do some maneuver in /etc/hosts? or I have to create a script to generate the config for each host?

No comments:

Post a Comment

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...