From 1113bd4b45677ac0140a69cf789ec26c462297b0 Mon Sep 17 00:00:00 2001 From: David Galloway Date: Mon, 22 Sep 2025 16:49:10 -0400 Subject: [PATCH] tools: cobbler-access password gen update - Work on Mac - Make a letter/number the first character Signed-off-by: David Galloway --- tools/cobbler-access.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/cobbler-access.sh b/tools/cobbler-access.sh index da48ebe5..d01e0439 100755 --- a/tools/cobbler-access.sh +++ b/tools/cobbler-access.sh @@ -4,7 +4,11 @@ tmpfile=$(mktemp) # Basically `mkpasswd` but uses a small subset of special characters -password=$(head /dev/urandom | tr -dc 'A-Za-z0-9!@#$%&' | head -c 12 && echo) +password="$( + { head -c 64 /dev/urandom | LC_ALL=C tr -dc '[:alnum:]' | head -c 1; + head -c 256 /dev/urandom | LC_ALL=C tr -dc '[:alnum:]!@#$%&-' | head -c 11; + } && echo +)" if [ $# -eq 0 ]; then printf "Enter username: " -- 2.47.3