From a0c265c6ca1eb4f6cb4264c2f56db8fe078c6dae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20=C5=A0trauch?= Date: Tue, 7 Oct 2025 23:33:26 +0200 Subject: [PATCH] Fix SSH password access --- entrypoint.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/entrypoint.sh b/entrypoint.sh index 9fe214c..2e2a6fb 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -22,6 +22,23 @@ if [ ! -f /etc/ssh/ssh_host_rsa_key ]; then ssh-keygen -A fi +if [ -f /etc/ssh/sshd_config -a `cat /etc/ssh/sshd_config | wc -l` = 1 ]; then + echo "sshd_config is not complete, regenerating..." + rm -f /etc/ssh/sshd_config +fi + +if [ ! -f /etc/ssh/sshd_config ]; then + echo "Include /etc/ssh/sshd_config.d/*.conf" > /etc/ssh/sshd_config + echo "PermitRootLogin yes" >> /etc/ssh/sshd_config + echo "AuthorizedKeysFile .ssh/authorized_keys" >> /etc/ssh/sshd_config + echo "PasswordAuthentication yes" >> /etc/ssh/sshd_config + echo "AllowTcpForwarding no" >> /etc/ssh/sshd_config + echo "GatewayPorts no" >> /etc/ssh/sshd_config + echo "X11Forwarding no" >> /etc/ssh/sshd_config + echo "Subsystem sftp internal-sftp" >> /etc/ssh/sshd_config + ssh-keygen -A +fi + # Array to store child PIDs declare -a CHILD_PIDS=()