From 0955ec4b7fc6ea33c6e79cc0dfdc14f5b67e24b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B9=9D=E6=9D=A1=E6=B6=BC=E6=9E=9C?= Date: Tue, 29 Jul 2025 01:44:52 +0800 Subject: [PATCH] fix: SSH authorized keys not added in Alpine install script (#6316) --- misc/alpine-install.func | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/misc/alpine-install.func b/misc/alpine-install.func index b7381947a..405fc2149 100644 --- a/misc/alpine-install.func +++ b/misc/alpine-install.func @@ -152,4 +152,11 @@ EOF echo "bash -c \"\$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/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 + chmod 700 /root/.ssh + chmod 600 /root/.ssh/authorized_keys + fi }