Merge "Disable closing idle Ssh connections again" into stable-2.6
This commit is contained in:
commit
af482da7fc
@ -2368,6 +2368,20 @@ unit suffixes to express their setting:
|
||||
+
|
||||
By default, 2 minutes.
|
||||
|
||||
[[sshd.idleTimeout]]sshd.idleTimeout::
|
||||
+
|
||||
Time in seconds after which the server automatically terminates idle
|
||||
connections (or 0 to disable closing of idle connections). Values
|
||||
should use common unit suffixes to express their setting:
|
||||
+
|
||||
* s, sec, second, seconds
|
||||
* m, min, minute, minutes
|
||||
* h, hr, hour, hours
|
||||
* d, day, days
|
||||
|
||||
+
|
||||
By default, 0.
|
||||
|
||||
[[sshd.maxConnectionsPerUser]]sshd.maxConnectionsPerUser::
|
||||
+
|
||||
Maximum number of concurrent SSH sessions that a user account
|
||||
|
@ -152,6 +152,18 @@ public class SshDaemon extends SshServer implements SshInfo, LifecycleListener {
|
||||
String.valueOf(MILLISECONDS.convert(ConfigUtil.getTimeUnit(cfg, "sshd",
|
||||
null, "loginGraceTime", 120, SECONDS), SECONDS)));
|
||||
|
||||
long idleTimeoutSeconds = ConfigUtil.getTimeUnit(cfg, "sshd", null,
|
||||
"idleTimeout", 0, SECONDS);
|
||||
if (idleTimeoutSeconds == 0) {
|
||||
// Since Apache SSHD does not allow to turn off closing idle connections,
|
||||
// we fake it by using the highest timeout allowed by Apache SSHD, which
|
||||
// amounts to ~24 days.
|
||||
idleTimeoutSeconds = MILLISECONDS.toSeconds(Integer.MAX_VALUE);
|
||||
}
|
||||
getProperties().put(
|
||||
IDLE_TIMEOUT,
|
||||
String.valueOf(SECONDS.toMillis(idleTimeoutSeconds)));
|
||||
|
||||
final int maxConnectionsPerUser =
|
||||
cfg.getInt("sshd", "maxConnectionsPerUser", 64);
|
||||
if (0 < maxConnectionsPerUser) {
|
||||
|
Loading…
Reference in New Issue
Block a user