From a72a425b0d314415bbb5c2bbbed77966770c7631 Mon Sep 17 00:00:00 2001 From: Boshi Lian Date: Wed, 5 Feb 2025 00:11:43 -0800 Subject: [PATCH] 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