diff --git a/src/freedombone-image b/src/freedombone-image index d5ce9c15..4b3b011b 100755 --- a/src/freedombone-image +++ b/src/freedombone-image @@ -465,7 +465,7 @@ fi if [ ! $PASSWORD ]; then # generate a random password - PASSWORD="$(openssl rand -base64 30 | cut -c1-${MINIMUM_PASSWORD_LENGTH})" + PASSWORD=$(openssl rand -base64 32 | tr -dc A-Za-z0-9 | head -c ${MINIMUM_PASSWORD_LENGTH}) fi # Move any existing images into a build subdirectory diff --git a/src/freedombone-image-customise b/src/freedombone-image-customise index 3bfa005d..2868080a 100755 --- a/src/freedombone-image-customise +++ b/src/freedombone-image-customise @@ -358,8 +358,8 @@ EOF echo " dialog --backtitle \"${ENTROPY_MESSAGE1}\" --title \"${ENTROPY_MESSAGE2}\" --msgbox \"${ENTROPY_MESSAGE3}\" 8 50" >> $rootdir/root/.bashrc echo ' exit' >> $rootdir/root/.bashrc echo ' fi' >> $rootdir/root/.bashrc - echo -n ' NEW_USER_PASSWORD="$(openssl rand -base64 30 | cut -c1-' >> $rootdir/root/.bashrc - echo "${DEFAULT_PASSWORD_LENGTH})\"" >> $rootdir/root/.bashrc + echo -n ' NEW_USER_PASSWORD=$(openssl rand -base64 32 | tr -dc A-Za-z0-9 | head -c ' >> $rootdir/root/.bashrc + echo "${DEFAULT_PASSWORD_LENGTH})" >> $rootdir/root/.bashrc echo ' fi' >> $rootdir/root/.bashrc echo ' echo "${NEW_USER_PASSWORD}" > ~/login.txt' >> $rootdir/root/.bashrc diff --git a/src/freedombone-image-mesh b/src/freedombone-image-mesh index fc875161..07b49800 100755 --- a/src/freedombone-image-mesh +++ b/src/freedombone-image-mesh @@ -356,7 +356,8 @@ function create_tomb { echo "WARNING: ${tomb_name} tomb did not install properly" >> /var/log/${PROJECT_NAME}.log tomb >> /var/log/${PROJECT_NAME}.log fi - TOMB_TEMP_PASSWORD="$(openssl rand -base64 32 | cut -c1-30)" + TOMB_TEMP_PASSWORD=$(openssl rand -base64 64 | tr -dc A-Za-z0-9 | head -c 30) + tomb forge /mnt/ramdisk/${tomb_name}.tomb.key --tomb-pwd "${TOMB_TEMP_PASSWORD}" --unsafe tomb lock /tmp/${tomb_name}.tomb -k /mnt/ramdisk/${tomb_name}.tomb.key --tomb-pwd "${TOMB_TEMP_PASSWORD}" --unsafe tomb open /tmp/${tomb_name}.tomb -k /mnt/ramdisk/${tomb_name}.tomb.key --tomb-pwd "${TOMB_TEMP_PASSWORD}" --unsafe diff --git a/src/freedombone-mirrors b/src/freedombone-mirrors index f45f8f96..bd754c6c 100755 --- a/src/freedombone-mirrors +++ b/src/freedombone-mirrors @@ -97,7 +97,7 @@ function create_mirrors_user { fi if [ $create_password ]; then - MY_MIRRORS_PASSWORD="$(openssl rand -base64 20 | cut -c1-18)" + MY_MIRRORS_PASSWORD=$(openssl rand -base64 64 | tr -dc A-Za-z0-9 | head -c 18) fi chmod 600 /etc/shadow diff --git a/src/freedombone-pass b/src/freedombone-pass index 2b7e2668..298e3495 100755 --- a/src/freedombone-pass +++ b/src/freedombone-pass @@ -255,7 +255,8 @@ if [ ${#MASTER_PASSWORD} -eq 0 ]; then mkdir -p /root/.passwords/root fi if [ ! -f /root/.passwords/root/master ]; then - echo "$(openssl rand -base64 32 | cut -c1-30)" > /root/.passwords/root/master + newpass=$(openssl rand -base64 64 | tr -dc A-Za-z0-9 | head -c 30) + echo "$newpass" > /root/.passwords/root/master chmod 700 /root/.passwords/root/master fi MASTER_PASSWORD=$(cat /root/.passwords/root/master)