From 11fe2a21014367453010b6b081486c8045bdf79a Mon Sep 17 00:00:00 2001 From: Robert Gingras Date: Fri, 31 Oct 2025 19:03:38 +0000 Subject: [PATCH] refactor: replace random root password generation with disabling root password for containers --- .../var-lib-vz-snippets/create-container-new.sh | 3 +-- .../intern-phxdc-pve1/var-lib-vz-snippets/create-container.sh | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/container-creation/intern-phxdc-pve1/var-lib-vz-snippets/create-container-new.sh b/container-creation/intern-phxdc-pve1/var-lib-vz-snippets/create-container-new.sh index d37c5ad9..0b6d5a1b 100755 --- a/container-creation/intern-phxdc-pve1/var-lib-vz-snippets/create-container-new.sh +++ b/container-creation/intern-phxdc-pve1/var-lib-vz-snippets/create-container-new.sh @@ -239,8 +239,7 @@ if [ -f "/var/lib/vz/snippets/container-public-keys/$PUB_FILE" ]; then fi fi -ROOT_PSWD=$(tr -dc 'A-Za-z0-9' /dev/null 2>&1 +run_pct_exec $CONTAINER_ID bash -c 'passwd -d root; passwd -l root' > /dev/null 2>&1 CONTAINER_IP="" attempts=0 diff --git a/container-creation/intern-phxdc-pve1/var-lib-vz-snippets/create-container.sh b/container-creation/intern-phxdc-pve1/var-lib-vz-snippets/create-container.sh index 6697ee91..89eefbca 100755 --- a/container-creation/intern-phxdc-pve1/var-lib-vz-snippets/create-container.sh +++ b/container-creation/intern-phxdc-pve1/var-lib-vz-snippets/create-container.sh @@ -136,8 +136,7 @@ if [ -f "/var/lib/vz/snippets/container-public-keys/$PUB_FILE" ]; then fi # Generate a random root password for the container -ROOT_PSWD=$(tr -dc 'A-Za-z0-9' /dev/null 2>&1 +pct exec $CONTAINER_ID -- bash -c 'passwd -d root; passwd -l root' > /dev/null 2>&1 CONTAINER_IP="" attempts=0