]> source.dussan.org Git - gitea.git/commitdiff
Fix bug due to missing MaxStartups and MaxSessions (#16046)
authorzeripath <art27@cantab.net>
Tue, 1 Jun 2021 19:55:17 +0000 (20:55 +0100)
committerGitHub <noreply@github.com>
Tue, 1 Jun 2021 19:55:17 +0000 (15:55 -0400)
Unforunately #16009 makes these settings mandatory. This PR uses the same technique
as used for the certificates to make these settings non-mandatory.

Fix #16044

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
docker/root/etc/s6/openssh/setup
docker/root/etc/templates/sshd_config

index 5601994d6683b4988835d10a955b834bc0ddc84f..89c03092be172dcef8c892dad1489d1e115f597f 100755 (executable)
@@ -47,6 +47,8 @@ if [ -d /etc/ssh ]; then
     SSH_RSA_CERT="${SSH_RSA_CERT:+"HostCertificate "}${SSH_RSA_CERT}" \
     SSH_ECDSA_CERT="${SSH_ECDSA_CERT:+"HostCertificate "}${SSH_ECDSA_CERT}" \
     SSH_DSA_CERT="${SSH_DSA_CERT:+"HostCertificate "}${SSH_DSA_CERT}" \
+    SSH_MAX_STARTUPS="${SSH_MAX_STARTUPS:+"MaxStartups "}${SSH_MAX_STARTUPS}" \
+    SSH_MAX_SESSIONS="${SSH_MAX_SESSIONS:+"MaxSessions "}${SSH_MAX_SESSIONS}" \
     envsubst < /etc/templates/sshd_config > /etc/ssh/sshd_config
 
     chmod 0644 /etc/ssh/sshd_config
index a0ff0651d950b822ccdea787cb0d44c77482ad0c..8d336f3a8eda5ca4c76f31cac23f3be2ad8c448b 100644 (file)
@@ -5,8 +5,8 @@ AddressFamily any
 ListenAddress 0.0.0.0
 ListenAddress ::
 
-MaxStartups ${SSH_MAX_STARTUPS}
-MaxSessions ${SSH_MAX_SESSIONS}
+${SSH_MAX_STARTUPS}
+${SSH_MAX_SESSIONS}
 
 LogLevel INFO