Due to a problem with our password manager, we have lost the passwords for user wazuh and wazuh-wui. For the wazuh-ui user we have been able to recover it from the dashboard server, but is there any way to recover the wazuh user's password or reset it?
Best regards,
C. L. Martinez
Hello Carlos,
I’d like to share another method to reset the password for the wazuh user:
1. Access your master node and navigate to the python3 console:
root@wazuh-master:/# /var/ossec/framework/python/bin/python32. Once in the python3 console, import the update_user framework function and use it with the user_id and a new password. In this case, the user_id is 1 for the “wazuh” user.
>>> from wazuh.security import update_user >>> update_user(user_id="1", password="NewPassword1!").render()3. If the process was successful, you will receive the following output:
{'data': {'affected_items': [{'id': 1, 'username': 'wazuh', 'allow_run_as': True, 'roles': [1]}], 'total_affected_items': 1, 'total_failed_items': 0, 'failed_items': []}, 'message': 'User was successfully updated', 'error': 0}This indicates that the user has been updated, and the password has been reset.