Skip to content

Commit

Permalink
Configure OpenSSH log level via Environment in Docker (#19274)
Browse files Browse the repository at this point in the history
Introduce a new environment variable: SSH_LOG_LEVEL
  • Loading branch information
Gusted authored Mar 31, 2022
1 parent c831681 commit ba5f2ac
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions docker/root/etc/s6/openssh/setup
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docker/root/etc/templates/sshd_config
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit ba5f2ac

Please sign in to comment.