From 1f6034a15bcc9278828180eac3a2be14f3e6440f Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Mon, 24 Nov 2025 11:19:40 +0100 Subject: [PATCH] Update install.func --- misc/install.func | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/misc/install.func b/misc/install.func index e97a49bcf..8548d34fc 100644 --- a/misc/install.func +++ b/misc/install.func @@ -268,19 +268,39 @@ motd_ssh() { customize() { if [[ -z "${PASSWORD:-}" ]]; then msg_info "Configuring autologin for root" + + # Enable root account (remove password lock) passwd -d root >/dev/null 2>&1 || true + + # Create getty override for container-getty@1.service GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf" mkdir -p "$(dirname "$GETTY_OVERRIDE")" - cat <"$GETTY_OVERRIDE" + cat <<'EOF' >"$GETTY_OVERRIDE" [Service] ExecStart= -ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM +ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 linux EOF - $STD systemctl daemon-reload || true - msg_ok "Customized Container" + + # Create getty override for console-getty.service + CONSOLE_OVERRIDE="/etc/systemd/system/console-getty.service.d/override.conf" + mkdir -p "$(dirname "$CONSOLE_OVERRIDE")" + cat <<'EOF' >"$CONSOLE_OVERRIDE" +[Service] +ExecStart= +ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud console 115200,38400,9600 linux +EOF + + # Reload systemd daemon + $STD systemctl daemon-reload + + msg_ok "Autologin configured" fi + + msg_ok "Customized Container" + echo "bash -c \"\$(curl -fsSL https://github.com/community-scripts/ProxmoxVED/raw/main/ct/${app}.sh)\"" >/usr/bin/update chmod +x /usr/bin/update + if [[ -n "${SSH_AUTHORIZED_KEY}" ]]; then mkdir -p /root/.ssh echo "${SSH_AUTHORIZED_KEY}" >/root/.ssh/authorized_keys