From: David Galloway Date: Mon, 22 Sep 2025 20:49:10 +0000 (-0400) Subject: tools: cobbler-access password gen update X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=1113bd4b45677ac0140a69cf789ec26c462297b0;p=ceph-cm-ansible.git tools: cobbler-access password gen update - Work on Mac - Make a letter/number the first character Signed-off-by: David Galloway --- diff --git a/tools/cobbler-access.sh b/tools/cobbler-access.sh index da48ebe..d01e043 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: "