Skip to main content
1 of 5
Martin Prikryl
  • 22.7k
  • 10
  • 83
  • 164

For each directive, the first relevant occurrence in the ssh_config is used.


So with the configuration file below:

  • For all hosts, ServerAliveInterval 1 is always used, 4 is never used.
  • ConnectTimeout is 2 for work, for other hosts it's 3, ConnectTimeout 8 is never used.
  • For all hosts, the ServerAliveCountMax is 5, the work-specific value 6 is never used, not even for work.
ServerAliveInterval 1

Host work
  ConnectTimeout 2

Host *
  ConnectTimeout 3
  ServerAliveInterval 4
  ServerAliveCountMax 5

Host work
  ServerAliveCountMax 6
  ServerAliveInterval 7

ConnectTimeout 8
Martin Prikryl
  • 22.7k
  • 10
  • 83
  • 164