diff options
author | Richard Kettlewell <rjk@greenend.org.uk> | 2014-02-09 16:09:52 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2015-12-03 17:05:05 +0000 |
commit | 43c55250c94601ae868e2caca8f008c1b0da1247 (patch) | |
tree | 78bf7c92bfe2a79556df2c3a6ad0c3239f56fbe6 | |
parent | 250d744e08a4f88cd547023cb2f036b2cdfd569b (diff) |
Various keepalive extensions
Add compatibility aliases for ProtocolKeepAlives and SetupTimeOut, supported
in previous versions of Debian's OpenSSH package but since superseded by
ServerAliveInterval. (We're probably stuck with this bit for
compatibility.)
In batch mode, default ServerAliveInterval to five minutes.
Adjust documentation to match and to give some more advice on use of
keepalives.
Author: Ian Jackson <ian@chiark.greenend.org.uk>
Author: Matthew Vernon <matthew@debian.org>
Author: Colin Watson <cjwatson@debian.org>
Last-Update: 2015-11-29
Patch-Name: keepalive-extensions.patch
-rw-r--r-- | readconf.c | 14 | ||||
-rw-r--r-- | ssh_config.5 | 21 | ||||
-rw-r--r-- | sshd_config.5 | 3 |
3 files changed, 34 insertions, 4 deletions
diff --git a/readconf.c b/readconf.c index 522ad373c..46c343f30 100644 --- a/readconf.c +++ b/readconf.c | |||
@@ -160,6 +160,7 @@ typedef enum { | |||
160 | oStreamLocalBindMask, oStreamLocalBindUnlink, oRevokedHostKeys, | 160 | oStreamLocalBindMask, oStreamLocalBindUnlink, oRevokedHostKeys, |
161 | oFingerprintHash, oUpdateHostkeys, oHostbasedKeyTypes, | 161 | oFingerprintHash, oUpdateHostkeys, oHostbasedKeyTypes, |
162 | oPubkeyAcceptedKeyTypes, | 162 | oPubkeyAcceptedKeyTypes, |
163 | oProtocolKeepAlives, oSetupTimeOut, | ||
163 | oIgnoredUnknownOption, oDeprecated, oUnsupported | 164 | oIgnoredUnknownOption, oDeprecated, oUnsupported |
164 | } OpCodes; | 165 | } OpCodes; |
165 | 166 | ||
@@ -290,6 +291,8 @@ static struct { | |||
290 | { "hostbasedkeytypes", oHostbasedKeyTypes }, | 291 | { "hostbasedkeytypes", oHostbasedKeyTypes }, |
291 | { "pubkeyacceptedkeytypes", oPubkeyAcceptedKeyTypes }, | 292 | { "pubkeyacceptedkeytypes", oPubkeyAcceptedKeyTypes }, |
292 | { "ignoreunknown", oIgnoreUnknown }, | 293 | { "ignoreunknown", oIgnoreUnknown }, |
294 | { "protocolkeepalives", oProtocolKeepAlives }, | ||
295 | { "setuptimeout", oSetupTimeOut }, | ||
293 | 296 | ||
294 | { NULL, oBadOption } | 297 | { NULL, oBadOption } |
295 | }; | 298 | }; |
@@ -1304,6 +1307,8 @@ parse_keytypes: | |||
1304 | goto parse_flag; | 1307 | goto parse_flag; |
1305 | 1308 | ||
1306 | case oServerAliveInterval: | 1309 | case oServerAliveInterval: |
1310 | case oProtocolKeepAlives: /* Debian-specific compatibility alias */ | ||
1311 | case oSetupTimeOut: /* Debian-specific compatibility alias */ | ||
1307 | intptr = &options->server_alive_interval; | 1312 | intptr = &options->server_alive_interval; |
1308 | goto parse_time; | 1313 | goto parse_time; |
1309 | 1314 | ||
@@ -1856,8 +1861,13 @@ fill_default_options(Options * options) | |||
1856 | options->rekey_interval = 0; | 1861 | options->rekey_interval = 0; |
1857 | if (options->verify_host_key_dns == -1) | 1862 | if (options->verify_host_key_dns == -1) |
1858 | options->verify_host_key_dns = 0; | 1863 | options->verify_host_key_dns = 0; |
1859 | if (options->server_alive_interval == -1) | 1864 | if (options->server_alive_interval == -1) { |
1860 | options->server_alive_interval = 0; | 1865 | /* in batch mode, default is 5mins */ |
1866 | if (options->batch_mode == 1) | ||
1867 | options->server_alive_interval = 300; | ||
1868 | else | ||
1869 | options->server_alive_interval = 0; | ||
1870 | } | ||
1861 | if (options->server_alive_count_max == -1) | 1871 | if (options->server_alive_count_max == -1) |
1862 | options->server_alive_count_max = 3; | 1872 | options->server_alive_count_max = 3; |
1863 | if (options->control_master == -1) | 1873 | if (options->control_master == -1) |
diff --git a/ssh_config.5 b/ssh_config.5 index cac8cdaa7..78e918a0e 100644 --- a/ssh_config.5 +++ b/ssh_config.5 | |||
@@ -233,8 +233,12 @@ Valid arguments are | |||
233 | If set to | 233 | If set to |
234 | .Dq yes , | 234 | .Dq yes , |
235 | passphrase/password querying will be disabled. | 235 | passphrase/password querying will be disabled. |
236 | In addition, the | ||
237 | .Cm ServerAliveInterval | ||
238 | option will be set to 300 seconds by default. | ||
236 | This option is useful in scripts and other batch jobs where no user | 239 | This option is useful in scripts and other batch jobs where no user |
237 | is present to supply the password. | 240 | is present to supply the password, |
241 | and where it is desirable to detect a broken network swiftly. | ||
238 | The argument must be | 242 | The argument must be |
239 | .Dq yes | 243 | .Dq yes |
240 | or | 244 | or |
@@ -1476,8 +1480,15 @@ from the server, | |||
1476 | will send a message through the encrypted | 1480 | will send a message through the encrypted |
1477 | channel to request a response from the server. | 1481 | channel to request a response from the server. |
1478 | The default | 1482 | The default |
1479 | is 0, indicating that these messages will not be sent to the server. | 1483 | is 0, indicating that these messages will not be sent to the server, |
1484 | or 300 if the | ||
1485 | .Cm BatchMode | ||
1486 | option is set. | ||
1480 | This option applies to protocol version 2 only. | 1487 | This option applies to protocol version 2 only. |
1488 | .Cm ProtocolKeepAlives | ||
1489 | and | ||
1490 | .Cm SetupTimeOut | ||
1491 | are Debian-specific compatibility aliases for this option. | ||
1481 | .It Cm StreamLocalBindMask | 1492 | .It Cm StreamLocalBindMask |
1482 | Sets the octal file creation mode mask | 1493 | Sets the octal file creation mode mask |
1483 | .Pq umask | 1494 | .Pq umask |
@@ -1543,6 +1554,12 @@ Specifies whether the system should send TCP keepalive messages to the | |||
1543 | other side. | 1554 | other side. |
1544 | If they are sent, death of the connection or crash of one | 1555 | If they are sent, death of the connection or crash of one |
1545 | of the machines will be properly noticed. | 1556 | of the machines will be properly noticed. |
1557 | This option only uses TCP keepalives (as opposed to using ssh level | ||
1558 | keepalives), so takes a long time to notice when the connection dies. | ||
1559 | As such, you probably want | ||
1560 | the | ||
1561 | .Cm ServerAliveInterval | ||
1562 | option as well. | ||
1546 | However, this means that | 1563 | However, this means that |
1547 | connections will die if the route is down temporarily, and some people | 1564 | connections will die if the route is down temporarily, and some people |
1548 | find it annoying. | 1565 | find it annoying. |
diff --git a/sshd_config.5 b/sshd_config.5 index 5491c89cf..c8ee35dfc 100644 --- a/sshd_config.5 +++ b/sshd_config.5 | |||
@@ -1510,6 +1510,9 @@ This avoids infinitely hanging sessions. | |||
1510 | .Pp | 1510 | .Pp |
1511 | To disable TCP keepalive messages, the value should be set to | 1511 | To disable TCP keepalive messages, the value should be set to |
1512 | .Dq no . | 1512 | .Dq no . |
1513 | .Pp | ||
1514 | This option was formerly called | ||
1515 | .Cm KeepAlive . | ||
1513 | .It Cm TrustedUserCAKeys | 1516 | .It Cm TrustedUserCAKeys |
1514 | Specifies a file containing public keys of certificate authorities that are | 1517 | Specifies a file containing public keys of certificate authorities that are |
1515 | trusted to sign user certificates for authentication, or | 1518 | trusted to sign user certificates for authentication, or |