Change default password to random

There is no reason at all that the default should be 1234567. In fact, that shouldn't even be an option. This sets the default to a random 16 character pw, or you can manually set one that is 8 characters or more.
This commit is contained in:
nickchomey
2022-05-10 09:17:22 -06:00
committed by GitHub
parent 00c70bfe18
commit 548d83810a

View File

@@ -712,19 +712,10 @@ else
fi
echo -e "\nPlease choose to use default admin password \e[31m1234567\e[39m, randomly generate one \e[31m(recommended)\e[39m or specify the admin password?"
printf "%s" "Choose [d]fault, [r]andom or [s]et password: [d/r/s] "
printf "%s" "Choose [r]andom or [s]et password: [r/s] "
read -r Tmp_Input
if [[ $Tmp_Input =~ ^(d|D| ) ]] || [[ -z $Tmp_Input ]]; then
Admin_Pass="1234567"
echo -e "\nAdmin password will be set to $Admin_Pass\n"
elif [[ $Tmp_Input =~ ^(r|R) ]]; then
Admin_Pass=$(
head /dev/urandom | tr -dc A-Za-z0-9 | head -c 16
echo ''
)
echo -e "\nAdmin password will be provided once installation is completed...\n"
elif [[ $Tmp_Input =~ ^(s|S) ]]; then
if [[ $Tmp_Input =~ ^(s|S) ]]; then
Custom_Pass="True"
echo -e "\nPlease enter your password:"
printf "%s" ""
@@ -749,9 +740,12 @@ elif [[ $Tmp_Input =~ ^(s|S) ]]; then
echo -e "\nRepeated password didn't match , please check...\n"
exit
fi
else
Admin_Pass="1234567"
echo -e "\nAdmin password will be set to $Admin_Pass\n"
else [[ $Tmp_Input =~ ^(r|R) ]]; then
Admin_Pass=$(
head /dev/urandom | tr -dc A-Za-z0-9 | head -c 16
echo ''
)
echo -e "\nAdmin password will be provided once installation is completed...\n"
fi
echo -e "\nDo you wish to install Memcached process and its PHP extension?"