1

Say you have a host configuration as following:

Host work-server-1
  Hostname a.b.c.d
  ConnectTimeout 5

I have two questions:

  1. Will SSH apply the ConnectTimeout 5 configuration setting when you log into the server via ssh [email protected] instead of pritzel@work-server-1?
  2. As a related question, assume that there is a DNS entry secret-server.work.com which resolves to a.b.c.d. Will now ConnectTimeout 5 be used when you login with ssh [email protected]? Note that secret-server.work.com is not mentioned in the configuration above.

1 Answer 1

1

Will SSH apply the ConnectTimeout 5 configuration setting when you log into the server via ssh [email protected] instead of pritzel@work-server-1?

No.

Only the Host directive is considered when deciding what directives are applied. It's as simple as that.

Quoting man page for ssh_config:

The configuration files contain sections separated by Host specifications, and that section is only applied for hosts that match one of the patterns given in the specification. The matched host name is usually the one given on the command line (see the CanonicalizeHostname option for exceptions).

1
  • I appreciate your sense for details Martin.
    – Pritzl
    Commented Jul 6, 2019 at 6:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .