summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Kettlewell <rjk@greenend.org.uk>2014-02-09 16:09:52 +0000
committerColin Watson <cjwatson@debian.org>2016-03-10 13:00:39 +0000
commitce1a5718a57d2d1c0d9e59cfac81c2f6401780a0 (patch)
treea563cf57f92376e39e21739da88bb597fac25866
parent50201dd1c0a38e8a26d614b1679981610a8effc5 (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.c14
-rw-r--r--ssh_config.521
-rw-r--r--sshd_config.53
3 files changed, 34 insertions, 4 deletions
diff --git a/readconf.c b/readconf.c
index 559e4c7d0..fde6b418a 100644
--- a/readconf.c
+++ b/readconf.c
@@ -161,6 +161,7 @@ typedef enum {
161 oStreamLocalBindMask, oStreamLocalBindUnlink, oRevokedHostKeys, 161 oStreamLocalBindMask, oStreamLocalBindUnlink, oRevokedHostKeys,
162 oFingerprintHash, oUpdateHostkeys, oHostbasedKeyTypes, 162 oFingerprintHash, oUpdateHostkeys, oHostbasedKeyTypes,
163 oPubkeyAcceptedKeyTypes, 163 oPubkeyAcceptedKeyTypes,
164 oProtocolKeepAlives, oSetupTimeOut,
164 oIgnoredUnknownOption, oDeprecated, oUnsupported 165 oIgnoredUnknownOption, oDeprecated, oUnsupported
165} OpCodes; 166} OpCodes;
166 167
@@ -293,6 +294,8 @@ static struct {
293 { "hostbasedkeytypes", oHostbasedKeyTypes }, 294 { "hostbasedkeytypes", oHostbasedKeyTypes },
294 { "pubkeyacceptedkeytypes", oPubkeyAcceptedKeyTypes }, 295 { "pubkeyacceptedkeytypes", oPubkeyAcceptedKeyTypes },
295 { "ignoreunknown", oIgnoreUnknown }, 296 { "ignoreunknown", oIgnoreUnknown },
297 { "protocolkeepalives", oProtocolKeepAlives },
298 { "setuptimeout", oSetupTimeOut },
296 299
297 { NULL, oBadOption } 300 { NULL, oBadOption }
298}; 301};
@@ -1350,6 +1353,8 @@ parse_keytypes:
1350 goto parse_flag; 1353 goto parse_flag;
1351 1354
1352 case oServerAliveInterval: 1355 case oServerAliveInterval:
1356 case oProtocolKeepAlives: /* Debian-specific compatibility alias */
1357 case oSetupTimeOut: /* Debian-specific compatibility alias */
1353 intptr = &options->server_alive_interval; 1358 intptr = &options->server_alive_interval;
1354 goto parse_time; 1359 goto parse_time;
1355 1360
@@ -1906,8 +1911,13 @@ fill_default_options(Options * options)
1906 options->rekey_interval = 0; 1911 options->rekey_interval = 0;
1907 if (options->verify_host_key_dns == -1) 1912 if (options->verify_host_key_dns == -1)
1908 options->verify_host_key_dns = 0; 1913 options->verify_host_key_dns = 0;
1909 if (options->server_alive_interval == -1) 1914 if (options->server_alive_interval == -1) {
1910 options->server_alive_interval = 0; 1915 /* in batch mode, default is 5mins */
1916 if (options->batch_mode == 1)
1917 options->server_alive_interval = 300;
1918 else
1919 options->server_alive_interval = 0;
1920 }
1911 if (options->server_alive_count_max == -1) 1921 if (options->server_alive_count_max == -1)
1912 options->server_alive_count_max = 3; 1922 options->server_alive_count_max = 3;
1913 if (options->control_master == -1) 1923 if (options->control_master == -1)
diff --git a/ssh_config.5 b/ssh_config.5
index 9060d5be2..bbf638b53 100644
--- a/ssh_config.5
+++ b/ssh_config.5
@@ -268,8 +268,12 @@ The default is
268If set to 268If set to
269.Dq yes , 269.Dq yes ,
270passphrase/password querying will be disabled. 270passphrase/password querying will be disabled.
271In addition, the
272.Cm ServerAliveInterval
273option will be set to 300 seconds by default.
271This option is useful in scripts and other batch jobs where no user 274This option is useful in scripts and other batch jobs where no user
272is present to supply the password. 275is present to supply the password,
276and where it is desirable to detect a broken network swiftly.
273The argument must be 277The argument must be
274.Dq yes 278.Dq yes
275or 279or
@@ -1551,7 +1555,14 @@ from the server,
1551will send a message through the encrypted 1555will send a message through the encrypted
1552channel to request a response from the server. 1556channel to request a response from the server.
1553The default 1557The default
1554is 0, indicating that these messages will not be sent to the server. 1558is 0, indicating that these messages will not be sent to the server,
1559or 300 if the
1560.Cm BatchMode
1561option is set.
1562.Cm ProtocolKeepAlives
1563and
1564.Cm SetupTimeOut
1565are Debian-specific compatibility aliases for this option.
1555.It Cm StreamLocalBindMask 1566.It Cm StreamLocalBindMask
1556Sets the octal file creation mode mask 1567Sets the octal file creation mode mask
1557.Pq umask 1568.Pq umask
@@ -1617,6 +1628,12 @@ Specifies whether the system should send TCP keepalive messages to the
1617other side. 1628other side.
1618If they are sent, death of the connection or crash of one 1629If they are sent, death of the connection or crash of one
1619of the machines will be properly noticed. 1630of the machines will be properly noticed.
1631This option only uses TCP keepalives (as opposed to using ssh level
1632keepalives), so takes a long time to notice when the connection dies.
1633As such, you probably want
1634the
1635.Cm ServerAliveInterval
1636option as well.
1620However, this means that 1637However, this means that
1621connections will die if the route is down temporarily, and some people 1638connections will die if the route is down temporarily, and some people
1622find it annoying. 1639find it annoying.
diff --git a/sshd_config.5 b/sshd_config.5
index c6d6858f9..bc79a6636 100644
--- a/sshd_config.5
+++ b/sshd_config.5
@@ -1518,6 +1518,9 @@ This avoids infinitely hanging sessions.
1518.Pp 1518.Pp
1519To disable TCP keepalive messages, the value should be set to 1519To disable TCP keepalive messages, the value should be set to
1520.Dq no . 1520.Dq no .
1521.Pp
1522This option was formerly called
1523.Cm KeepAlive .
1521.It Cm TrustedUserCAKeys 1524.It Cm TrustedUserCAKeys
1522Specifies a file containing public keys of certificate authorities that are 1525Specifies a file containing public keys of certificate authorities that are
1523trusted to sign user certificates for authentication, or 1526trusted to sign user certificates for authentication, or