aboutsummaryrefslogtreecommitdiff
path: root/docker
diff options
context:
space:
mode:
authorGusted2022-03-31 05:15:36 +0200
committerGitHub2022-03-31 11:15:36 +0800
commitba5f2acb9ccb40281ca8ab7eaf9dea6a77eb220d (patch)
tree42343d31c735a2a396ccca3872e3908d2e0df1a7 /docker
parentc83168104b8bcb09e3e6e1490bd586a9e1a55bc3 (diff)
Configure OpenSSH log level via Environment in Docker (#19274)
Introduce a new environment variable: SSH_LOG_LEVEL
Diffstat (limited to 'docker')
-rwxr-xr-xdocker/root/etc/s6/openssh/setup1
-rw-r--r--docker/root/etc/templates/sshd_config2
2 files changed, 2 insertions, 1 deletions
diff --git a/docker/root/etc/s6/openssh/setup b/docker/root/etc/s6/openssh/setup
index 89c03092b..f7843050c 100755
--- a/docker/root/etc/s6/openssh/setup
+++ b/docker/root/etc/s6/openssh/setup
@@ -49,6 +49,7 @@ if [ -d /etc/ssh ]; then
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}" \
+ SSH_LOG_LEVEL=${SSH_LOG_LEVEL:-"INFO"} \
envsubst < /etc/templates/sshd_config > /etc/ssh/sshd_config
chmod 0644 /etc/ssh/sshd_config
diff --git a/docker/root/etc/templates/sshd_config b/docker/root/etc/templates/sshd_config
index 8d336f3a8..6f1a36304 100644
--- a/docker/root/etc/templates/sshd_config
+++ b/docker/root/etc/templates/sshd_config
@@ -8,7 +8,7 @@ ListenAddress ::
${SSH_MAX_STARTUPS}
${SSH_MAX_SESSIONS}
-LogLevel INFO
+LogLevel ${SSH_LOG_LEVEL}
HostKey /data/ssh/ssh_host_ed25519_key
${SSH_ED25519_CERT}