From a72a425b0d314415bbb5c2bbbed77966770c7631 Mon Sep 17 00:00:00 2001 From: Boshi Lian Date: Wed, 5 Feb 2025 00:11:43 -0800 Subject: [PATCH 1/5] add support to sshd_config.d MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [linuxserverurl]: https://linuxserver.io [![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png)][linuxserverurl] ------------------------------ - [ ] I have read the [contributing](https://github.com/linuxserver/docker-openssh-server/blob/master/.github/CONTRIBUTING.md) guideline and understand that I have made the correct modifications ------------------------------ ## Description: ## Benefits of this PR and context: ## How Has This Been Tested? ## Source / References: --- root/etc/s6-overlay/s6-rc.d/init-openssh-server-config/run | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/root/etc/s6-overlay/s6-rc.d/init-openssh-server-config/run b/root/etc/s6-overlay/s6-rc.d/init-openssh-server-config/run index f7d375e..ed17f11 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-openssh-server-config/run +++ b/root/etc/s6-overlay/s6-rc.d/init-openssh-server-config/run @@ -33,7 +33,6 @@ echo "${USER_NAME}:${USER_PASSWORD}" | chpasswd # Migration if [[ -f /config/ssh_host_keys/sshd_config ]]; then mv /config/ssh_host_keys/sshd_config /config/sshd/sshd_config - sed -i 's/Include \/etc\/ssh\/sshd_config.d\/\*.conf/#Include \/etc\/ssh\/sshd_config.d\/\*.conf/' /config/sshd/sshd_config echo "This file has been moved to /config/sshd/sshd_config" > /config/ssh_host_keys/sshd_config_README chmod 600 /config/ssh_host_keys/ssh_host_*_key chmod 644 /config/ssh_host_keys/ssh_host_*_key.pub @@ -41,10 +40,11 @@ fi if [[ ! -f /config/sshd/sshd_config ]]; then sed -i '/#PidFile/c\PidFile \/config\/sshd.pid' /etc/ssh/sshd_config - sed -i 's/Include \/etc\/ssh\/sshd_config.d\/\*.conf/#Include \/etc\/ssh\/sshd_config.d\/\*.conf/' /etc/ssh/sshd_config cp -a /etc/ssh/sshd_config /config/sshd/sshd_config fi +sed -i 's/Include \/etc\/ssh\/sshd_config.d\/\*.conf/Include \/config\/sshd\/sshd_config.d\/\*.conf/' /config/sshd/sshd_config + if [[ ! -d /config/ssh_host_keys ]]; then mkdir -p /config/ssh_host_keys ssh-keygen -A From d4afda1b7b5be5bcd02916bac1da986d47fba475 Mon Sep 17 00:00:00 2001 From: Boshi Lian Date: Mon, 10 Feb 2025 02:44:43 -0800 Subject: [PATCH 2/5] add changelog entry for sshd_config.d support --- readme-vars.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/readme-vars.yml b/readme-vars.yml index ff375b2..7435245 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -115,6 +115,7 @@ init_diagram: | "openssh-server:latest" <- Base Images # changelog changelogs: + - {date: "10.02.25:", desc: "Add support for sshd_config.d"} - {date: "12.01.25:", desc: "Rebase to Alpine 3.21."} - {date: "24.11.24:", desc: "Move sshd_config to /config/sshd/sshd_config."} - {date: "31.05.24:", desc: "Rebase to Alpine 3.20."} From d9b4e938c576907b6303d014a1ffd61f58b9fbe8 Mon Sep 17 00:00:00 2001 From: Boshi Lian Date: Wed, 12 Feb 2025 02:37:20 -0800 Subject: [PATCH 3/5] enable support for sshd_config.d by updating configuration paths and uncommenting includes --- .../s6-overlay/s6-rc.d/init-openssh-server-config/run | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/root/etc/s6-overlay/s6-rc.d/init-openssh-server-config/run b/root/etc/s6-overlay/s6-rc.d/init-openssh-server-config/run index ed17f11..1f24239 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-openssh-server-config/run +++ b/root/etc/s6-overlay/s6-rc.d/init-openssh-server-config/run @@ -33,6 +33,7 @@ echo "${USER_NAME}:${USER_PASSWORD}" | chpasswd # Migration if [[ -f /config/ssh_host_keys/sshd_config ]]; then mv /config/ssh_host_keys/sshd_config /config/sshd/sshd_config + sed -i 's/Include \/etc\/ssh\/sshd_config.d\/\*.conf/#Include \/etc\/ssh\/sshd_config.d\/\*.conf/' /config/sshd/sshd_config echo "This file has been moved to /config/sshd/sshd_config" > /config/ssh_host_keys/sshd_config_README chmod 600 /config/ssh_host_keys/ssh_host_*_key chmod 644 /config/ssh_host_keys/ssh_host_*_key.pub @@ -40,17 +41,22 @@ fi if [[ ! -f /config/sshd/sshd_config ]]; then sed -i '/#PidFile/c\PidFile \/config\/sshd.pid' /etc/ssh/sshd_config + sed -i 's/Include \/etc\/ssh\/sshd_config.d\/\*.conf/#Include \/etc\/ssh\/sshd_config.d\/\*.conf/' /etc/ssh/sshd_config cp -a /etc/ssh/sshd_config /config/sshd/sshd_config fi -sed -i 's/Include \/etc\/ssh\/sshd_config.d\/\*.conf/Include \/config\/sshd\/sshd_config.d\/\*.conf/' /config/sshd/sshd_config - if [[ ! -d /config/ssh_host_keys ]]; then mkdir -p /config/ssh_host_keys ssh-keygen -A cp /etc/ssh/ssh_host_* /config/ssh_host_keys fi +# Enable sshd_config.d if mounted +if [[ -d /config/sshd/sshd_config.d ]]; then + sed -i 's/Include \/etc\/ssh\/sshd_config.d\/\*.conf/Include \/config\/sshd\/sshd_config.d\/\*.conf/' /config/sshd/sshd_config + sed -i '/Include \/config\/sshd\/sshd_config.d/s/^#*//' /config/sshd/sshd_config +fi + # display SSH host public key(s) echo "SSH host public key(s):" cat /config/ssh_host_keys/ssh_host_*.pub From 8e009911302a27f72488cc6e7467ee6aa7895657 Mon Sep 17 00:00:00 2001 From: LinuxServer-CI Date: Wed, 12 Feb 2025 21:03:03 +0000 Subject: [PATCH 4/5] Bot Updating Templated Files --- Jenkinsfile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 9a193f6..8d9722d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -72,7 +72,9 @@ pipeline { fi done fi - docker system prune -f --volumes || : ''' + docker system prune -f --volumes || : + docker image prune -af || : + ''' script{ env.EXIT_STATUS = '' env.LS_RELEASE = sh( @@ -754,7 +756,8 @@ pipeline { if [[ -n "${containers}" ]]; then docker stop ${containers} fi - docker system prune -af --volumes || : + docker system prune -f --volumes || : + docker image prune -af || : ''' } } @@ -1180,6 +1183,7 @@ EOF done fi docker system prune -f --volumes || : + docker image prune -af || : ''' cleanWs() } From 3cc42e2e2b357be00c741ef085cdcb87843a045e Mon Sep 17 00:00:00 2001 From: LinuxServer-CI Date: Wed, 12 Feb 2025 21:07:08 +0000 Subject: [PATCH 5/5] Bot Updating Templated Files --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 5881099..97273e4 100644 --- a/README.md +++ b/README.md @@ -340,6 +340,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64 ## Versions +* **10.02.25:** - Add support for sshd_config.d * **12.01.25:** - Rebase to Alpine 3.21. * **24.11.24:** - Move sshd_config to /config/sshd/sshd_config. * **31.05.24:** - Rebase to Alpine 3.20.