diff options
author | Richard Kettlewell <rjk@greenend.org.uk> | 2014-02-09 16:09:52 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2016-08-07 12:18:42 +0100 |
commit | 67c34f23edbcd0f39ebc2aadae9d33950bd1f98a (patch) | |
tree | 7a34e8f2b79cda73a178062c183d317f2b611cfe | |
parent | e35c0bb4c3997b8ef885c6afdcc600b403eb878b (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 c0b7822e1..3a6c67ba5 100644 --- a/readconf.c +++ b/readconf.c | |||
@@ -173,6 +173,7 @@ typedef enum { | |||
173 | oStreamLocalBindMask, oStreamLocalBindUnlink, oRevokedHostKeys, | 173 | oStreamLocalBindMask, oStreamLocalBindUnlink, oRevokedHostKeys, |
174 | oFingerprintHash, oUpdateHostkeys, oHostbasedKeyTypes, | 174 | oFingerprintHash, oUpdateHostkeys, oHostbasedKeyTypes, |
175 | oPubkeyAcceptedKeyTypes, oProxyJump, | 175 | oPubkeyAcceptedKeyTypes, oProxyJump, |
176 | oProtocolKeepAlives, oSetupTimeOut, | ||
176 | oIgnoredUnknownOption, oDeprecated, oUnsupported | 177 | oIgnoredUnknownOption, oDeprecated, oUnsupported |
177 | } OpCodes; | 178 | } OpCodes; |
178 | 179 | ||
@@ -308,6 +309,8 @@ static struct { | |||
308 | { "pubkeyacceptedkeytypes", oPubkeyAcceptedKeyTypes }, | 309 | { "pubkeyacceptedkeytypes", oPubkeyAcceptedKeyTypes }, |
309 | { "ignoreunknown", oIgnoreUnknown }, | 310 | { "ignoreunknown", oIgnoreUnknown }, |
310 | { "proxyjump", oProxyJump }, | 311 | { "proxyjump", oProxyJump }, |
312 | { "protocolkeepalives", oProtocolKeepAlives }, | ||
313 | { "setuptimeout", oSetupTimeOut }, | ||
311 | 314 | ||
312 | { NULL, oBadOption } | 315 | { NULL, oBadOption } |
313 | }; | 316 | }; |
@@ -1403,6 +1406,8 @@ parse_keytypes: | |||
1403 | goto parse_flag; | 1406 | goto parse_flag; |
1404 | 1407 | ||
1405 | case oServerAliveInterval: | 1408 | case oServerAliveInterval: |
1409 | case oProtocolKeepAlives: /* Debian-specific compatibility alias */ | ||
1410 | case oSetupTimeOut: /* Debian-specific compatibility alias */ | ||
1406 | intptr = &options->server_alive_interval; | 1411 | intptr = &options->server_alive_interval; |
1407 | goto parse_time; | 1412 | goto parse_time; |
1408 | 1413 | ||
@@ -2048,8 +2053,13 @@ fill_default_options(Options * options) | |||
2048 | options->rekey_interval = 0; | 2053 | options->rekey_interval = 0; |
2049 | if (options->verify_host_key_dns == -1) | 2054 | if (options->verify_host_key_dns == -1) |
2050 | options->verify_host_key_dns = 0; | 2055 | options->verify_host_key_dns = 0; |
2051 | if (options->server_alive_interval == -1) | 2056 | if (options->server_alive_interval == -1) { |
2052 | options->server_alive_interval = 0; | 2057 | /* in batch mode, default is 5mins */ |
2058 | if (options->batch_mode == 1) | ||
2059 | options->server_alive_interval = 300; | ||
2060 | else | ||
2061 | options->server_alive_interval = 0; | ||
2062 | } | ||
2053 | if (options->server_alive_count_max == -1) | 2063 | if (options->server_alive_count_max == -1) |
2054 | options->server_alive_count_max = 3; | 2064 | options->server_alive_count_max = 3; |
2055 | if (options->control_master == -1) | 2065 | if (options->control_master == -1) |
diff --git a/ssh_config.5 b/ssh_config.5 index 707d0e1c3..efc265ab7 100644 --- a/ssh_config.5 +++ b/ssh_config.5 | |||
@@ -268,8 +268,12 @@ The default is | |||
268 | If set to | 268 | If set to |
269 | .Dq yes , | 269 | .Dq yes , |
270 | passphrase/password querying will be disabled. | 270 | passphrase/password querying will be disabled. |
271 | In addition, the | ||
272 | .Cm ServerAliveInterval | ||
273 | option will be set to 300 seconds by default. | ||
271 | This option is useful in scripts and other batch jobs where no user | 274 | This option is useful in scripts and other batch jobs where no user |
272 | is present to supply the password. | 275 | is present to supply the password, |
276 | and where it is desirable to detect a broken network swiftly. | ||
273 | The argument must be | 277 | The argument must be |
274 | .Dq yes | 278 | .Dq yes |
275 | or | 279 | or |
@@ -1624,7 +1628,14 @@ from the server, | |||
1624 | will send a message through the encrypted | 1628 | will send a message through the encrypted |
1625 | channel to request a response from the server. | 1629 | channel to request a response from the server. |
1626 | The default | 1630 | The default |
1627 | is 0, indicating that these messages will not be sent to the server. | 1631 | is 0, indicating that these messages will not be sent to the server, |
1632 | or 300 if the | ||
1633 | .Cm BatchMode | ||
1634 | option is set. | ||
1635 | .Cm ProtocolKeepAlives | ||
1636 | and | ||
1637 | .Cm SetupTimeOut | ||
1638 | are Debian-specific compatibility aliases for this option. | ||
1628 | .It Cm StreamLocalBindMask | 1639 | .It Cm StreamLocalBindMask |
1629 | Sets the octal file creation mode mask | 1640 | Sets the octal file creation mode mask |
1630 | .Pq umask | 1641 | .Pq umask |
@@ -1690,6 +1701,12 @@ Specifies whether the system should send TCP keepalive messages to the | |||
1690 | other side. | 1701 | other side. |
1691 | If they are sent, death of the connection or crash of one | 1702 | If they are sent, death of the connection or crash of one |
1692 | of the machines will be properly noticed. | 1703 | of the machines will be properly noticed. |
1704 | This option only uses TCP keepalives (as opposed to using ssh level | ||
1705 | keepalives), so takes a long time to notice when the connection dies. | ||
1706 | As such, you probably want | ||
1707 | the | ||
1708 | .Cm ServerAliveInterval | ||
1709 | option as well. | ||
1693 | However, this means that | 1710 | However, this means that |
1694 | connections will die if the route is down temporarily, and some people | 1711 | connections will die if the route is down temporarily, and some people |
1695 | find it annoying. | 1712 | find it annoying. |
diff --git a/sshd_config.5 b/sshd_config.5 index 3b4cba9ae..e05cdbef5 100644 --- a/sshd_config.5 +++ b/sshd_config.5 | |||
@@ -1530,6 +1530,9 @@ This avoids infinitely hanging sessions. | |||
1530 | .Pp | 1530 | .Pp |
1531 | To disable TCP keepalive messages, the value should be set to | 1531 | To disable TCP keepalive messages, the value should be set to |
1532 | .Dq no . | 1532 | .Dq no . |
1533 | .Pp | ||
1534 | This option was formerly called | ||
1535 | .Cm KeepAlive . | ||
1533 | .It Cm TrustedUserCAKeys | 1536 | .It Cm TrustedUserCAKeys |
1534 | Specifies a file containing public keys of certificate authorities that are | 1537 | Specifies a file containing public keys of certificate authorities that are |
1535 | trusted to sign user certificates for authentication, or | 1538 | trusted to sign user certificates for authentication, or |