From 9256880c9f692e011b5ae056a2a6304dd1639ba1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5vard=20Gj=C3=B8by=20Thom?= <34199185+havardthom@users.noreply.github.com> Date: Mon, 16 Dec 2024 23:43:32 +0100 Subject: [PATCH] Fix SSH root access in install.func (#858) --- misc/install.func | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/misc/install.func b/misc/install.func index d701fdfb3..24f752a48 100644 --- a/misc/install.func +++ b/misc/install.func @@ -231,6 +231,11 @@ motd_ssh() { # Disable default MOTD scripts chmod -x /etc/update-motd.d/* + + if [[ "${SSH_ROOT}" == "yes" ]]; then + sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config + systemctl restart sshd + fi } # This function customizes the container by modifying the getty service and enabling auto-login for the root user