File tree Expand file tree Collapse file tree
root/etc/s6-overlay/s6-rc.d/init-openssh-server-config Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -115,6 +115,7 @@ init_diagram: |
115115 "openssh-server:latest" <- Base Images
116116# changelog
117117changelogs :
118+ - {date: "10.02.25:", desc: "Add support for sshd_config.d"}
118119 - {date: "12.01.25:", desc: "Rebase to Alpine 3.21."}
119120 - {date: "24.11.24:", desc: "Move sshd_config to /config/sshd/sshd_config."}
120121 - {date: "31.05.24:", desc: "Rebase to Alpine 3.20."}
Original file line number Diff line number Diff line change @@ -51,6 +51,12 @@ if [[ ! -d /config/ssh_host_keys ]]; then
5151 cp /etc/ssh/ssh_host_* /config/ssh_host_keys
5252fi
5353
54+ # Enable sshd_config.d if mounted
55+ if [[ -d /config/sshd/sshd_config.d ]]; then
56+ sed -i 's/Include \/etc\/ssh\/sshd_config.d\/\*.conf/Include \/config\/sshd\/sshd_config.d\/\*.conf/' /config/sshd/sshd_config
57+ sed -i '/Include \/config\/sshd\/sshd_config.d/s/^#*//' /config/sshd/sshd_config
58+ fi
59+
5460# display SSH host public key(s)
5561echo "SSH host public key(s):"
5662cat /config/ssh_host_keys/ssh_host_*.pub
You can’t perform that action at this time.
0 commit comments