Skip to content

Commit 3131c22

Browse files
authored
Merge pull request #106 from tg123/confgd
2 parents 86cd37a + d9b4e93 commit 3131c22

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

readme-vars.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ init_diagram: |
115115
"openssh-server:latest" <- Base Images
116116
# changelog
117117
changelogs:
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."}

root/etc/s6-overlay/s6-rc.d/init-openssh-server-config/run

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ if [[ ! -d /config/ssh_host_keys ]]; then
5151
cp /etc/ssh/ssh_host_* /config/ssh_host_keys
5252
fi
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)
5561
echo "SSH host public key(s):"
5662
cat /config/ssh_host_keys/ssh_host_*.pub

0 commit comments

Comments
 (0)