Skip to main content
Commonmark migration
Source Link

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

Quoting man page for ssh_config:

For each parameter, the first obtained value will be used. 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. ...

 

Since the first obtained value for each parameter is used, more host-specific declarations should be given near the beginning of the file, and general defaults at the end.


So with the configuration file below:

  • For all hosts, ServerAliveInterval 1 is always used, 4 and 7 are never used, not even for work.
  • ConnectTimeout is 2 for work, for other hosts it's 3.
  • 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

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

Quoting man page for ssh_config:

For each parameter, the first obtained value will be used. 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. ...

 

Since the first obtained value for each parameter is used, more host-specific declarations should be given near the beginning of the file, and general defaults at the end.


So with the configuration file below:

  • For all hosts, ServerAliveInterval 1 is always used, 4 and 7 are never used, not even for work.
  • ConnectTimeout is 2 for work, for other hosts it's 3.
  • 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

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

Quoting man page for ssh_config:

For each parameter, the first obtained value will be used. 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. ...

Since the first obtained value for each parameter is used, more host-specific declarations should be given near the beginning of the file, and general defaults at the end.


So with the configuration file below:

  • For all hosts, ServerAliveInterval 1 is always used, 4 and 7 are never used, not even for work.
  • ConnectTimeout is 2 for work, for other hosts it's 3.
  • 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
added 247 characters in body
Source Link
Martin Prikryl
  • 22.7k
  • 10
  • 83
  • 164

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

Quoting man page for ssh_config:

For each parameter, the first obtained value will be used. 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. ...

Since the first obtained value for each parameter is used, more host-specific declarations should be given near the beginning of the file, and general defaults at the end.


So with the configuration file below:

  • For all hosts, ServerAliveInterval 1 is always used, 4 and 7 are never used, not even for work.
  • ConnectTimeout is 2 for work, for other hosts it's 3, 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

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

Quoting man page for ssh_config:

Since the first obtained value for each parameter is used, more host-specific declarations should be given near the beginning of the file, and general defaults at the end.


So with the configuration file below:

  • For all hosts, ServerAliveInterval 1 is always used, 4 and 7 are never used, not even for work.
  • ConnectTimeout is 2 for work, for other hosts it's 3, 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

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

Quoting man page for ssh_config:

For each parameter, the first obtained value will be used. 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. ...

Since the first obtained value for each parameter is used, more host-specific declarations should be given near the beginning of the file, and general defaults at the end.


So with the configuration file below:

  • For all hosts, ServerAliveInterval 1 is always used, 4 and 7 are never used, not even for work.
  • ConnectTimeout is 2 for work, for other hosts it's 3.
  • 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
added 9 characters in body
Source Link
Martin Prikryl
  • 22.7k
  • 10
  • 83
  • 164

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

Quoting man page for ssh_config:

Since the first obtained value for each parameter is used, more host-specific declarations should be given near the beginning of the file, and general defaults at the end.


So with the configuration file below:

  • For all hosts, ServerAliveInterval 1 is always used, 4 isand 7 are never used, not even for work.
  • 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

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

Quoting man page for ssh_config:

Since the first obtained value for each parameter is used, more host-specific declarations should be given near the beginning of the file, and general defaults at the end.


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

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

Quoting man page for ssh_config:

Since the first obtained value for each parameter is used, more host-specific declarations should be given near the beginning of the file, and general defaults at the end.


So with the configuration file below:

  • For all hosts, ServerAliveInterval 1 is always used, 4 and 7 are never used, not even for work.
  • ConnectTimeout is 2 for work, for other hosts it's 3, 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
added 253 characters in body
Source Link
Martin Prikryl
  • 22.7k
  • 10
  • 83
  • 164
Loading
Source Link
Martin Prikryl
  • 22.7k
  • 10
  • 83
  • 164
Loading