diff --git a/salt/common/tools/sbin/so-fleet-user-add b/salt/common/tools/sbin/so-fleet-user-add index 2b803326b..747e8a780 100755 --- a/salt/common/tools/sbin/so-fleet-user-add +++ b/salt/common/tools/sbin/so-fleet-user-add @@ -53,8 +53,10 @@ if [[ $? -ne 0 ]]; then exit 2 fi +TEMPPW=$FLEET_SA_PW! + # Create New User -CREATE_OUTPUT=$(docker exec so-fleet fleetctl user create --email $USER_EMAIL --name $USER_EMAIL --password $USER_PASS --global-role admin 2>&1) +CREATE_OUTPUT=$(docker exec so-fleet fleetctl user create --email $USER_EMAIL --name $USER_EMAIL --password $TEMPPW --global-role admin 2>&1) if [[ $? -eq 0 ]]; then echo "Successfully added user to Fleet" @@ -64,6 +66,9 @@ else exit 2 fi +# Reset New User Password to user supplied password +echo "$USER_PW" | so-fleet-user-update "$USER_EMAIL" + # Disable forced password reset MYSQL_OUTPUT=$(docker exec so-mysql mysql -u root --password=$MYSQL_PW fleet -e \ "UPDATE users SET admin_forced_password_reset = 0 WHERE email = '$USER_EMAIL'" 2>&1) diff --git a/setup/so-functions b/setup/so-functions index a38a8ce7b..f39b65c43 100755 --- a/setup/so-functions +++ b/setup/so-functions @@ -1511,7 +1511,7 @@ generate_passwords(){ PLAYBOOKADMINPASS=$(get_random_value) PLAYBOOKAUTOMATIONPASS=$(get_random_value) FLEETPASS=$(get_random_value) - FLEETSAPASS=$(get_random_value) + FLEETSAPASS="$(get_random_value)!" FLEETJWT=$(get_random_value) GRAFANAPASS=$(get_random_value) SENSORONIKEY=$(get_random_value)