Skip to content

Commit 2aed45f

Browse files
authored
fix: actually add the given root SSH key to the container (#1502)
1 parent 7614034 commit 2aed45f

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

misc/build.func

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -827,6 +827,7 @@ build_container() {
827827
export PASSWORD="$PW"
828828
export VERBOSE="$VERB"
829829
export SSH_ROOT="${SSH}"
830+
export SSH_AUTHORIZED_KEY
830831
export CTID="$CT_ID"
831832
export CTTYPE="$CT_TYPE"
832833
export PCT_OSTYPE="$var_os"

misc/install.func

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,4 +255,11 @@ EOF
255255
fi
256256
echo "bash -c \"\$(wget -qLO - https://github.com/community-scripts/ProxmoxVE/raw/main/ct/${app}.sh)\"" >/usr/bin/update
257257
chmod +x /usr/bin/update
258+
259+
if [[ -n "${SSH_AUTHORIZED_KEY}" ]]; then
260+
mkdir -p /root/.ssh
261+
echo "${SSH_AUTHORIZED_KEY}" > /root/.ssh/authorized_keys
262+
chmod 700 /root/.ssh
263+
chmod 600 /root/.ssh/authorized_keys
264+
fi
258265
}

0 commit comments

Comments
 (0)