Fix other passwords

This commit is contained in:
Bob Mottram 2017-05-06 16:21:27 +01:00
parent a08f0b52d1
commit 27907b5d45
5 changed files with 8 additions and 6 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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)