1

I have a ~/.ssh/config file that looks like this:

Host server*
    HostName %h.farm.example.com

When I ssh server01, it connects to server01.farm.example.com correctly.

But when I ssh server01.farm.example.com, it attempts to connect to server01.farm.example.com.farm.example.com.

The second form is used by certain of our deployment scripts, so I don't really have any options.

How do I get server* to not match on fully-qualified names?

1 Answers1

4

Include a Host entry which matches the fully-qualified name, setting the hostname to %h. If you put it before the existing rule, it will take precedence.

Host server*.farm.example.com
    HostName %h

Host server*
    HostName %h.farm.example.com