From 548d83810a77b11d747528e9e95fa4f3a31af021 Mon Sep 17 00:00:00 2001 From: nickchomey <88559987+nickchomey@users.noreply.github.com> Date: Tue, 10 May 2022 09:17:22 -0600 Subject: [PATCH] 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. --- cyberpanel.sh | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/cyberpanel.sh b/cyberpanel.sh index 052bb20d6..ccee194cc 100644 --- a/cyberpanel.sh +++ b/cyberpanel.sh @@ -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?"