Generally, in the filebeat configuration located at /etc/filebeat/filebeat.yml is the user and password configuration to authenticate with Elasticsearch. As I see in the execution of the script you are using Opendistro.
Within the Filebeat configuration you should have something like this:
username: "admin"
password: "admin"
Could you try logging in with those credentials?
Secondly,
You could follow the instructions in this guide to change the password for a specific user:
Where you could change the password of the user "wazuh".
Could you check the above and tell me the result?
Best regards,
Alexander Bohorquez