]> git.ekhem.eu.org Git - server.git/commitdiff
[sshd] Limit the number of alive messages.
authorJakub Czajka <jakub@ekhem.eu.org>
Sun, 25 Sep 2022 17:44:41 +0000 (19:44 +0200)
committerJakub Czajka <jakub@ekhem.eu.org>
Wed, 27 Sep 2023 21:57:20 +0000 (23:57 +0200)
`sshd` keeps idle connection alive for `ClientAliveInterval` seconds
and then sends `ClientAliveCountMax` alive messages. If client does
not respond, `sshd` terminates the connection. This commit limits the
number of alive messages to 1.

Note: `ClientAliveCountMax` applies only to SSH protocol 2.

sshd/sshd_config

index 15c76ece679cc35b1eb735aa1718112606cc5fe3..7593a80300533c1f6e45aabba55ae04a3727bf91 100644 (file)
@@ -100,7 +100,7 @@ PrintMotd no
 #PermitUserEnvironment no
 #Compression delayed
 #ClientAliveInterval 0
-#ClientAliveCountMax 3
+ClientAliveCountMax 1
 #UseDNS no
 #PidFile /var/run/sshd.pid
 #MaxStartups 10:30:100