Hi Hatem
Hope you are doing well.
There is no need to
remove and reinstall the agent You just need to follow these steps:
1. Enable the password authentication option by adding the configuration highlighted below to the <auth> section of the manager configuration file /var/ossec/etc/ossec.conf.
<auth>
<use_password>yes</use_password>
</auth>2. Setting your own password. This is done by creating the file /
var/ossec/etc/authd.pass on the manager with your password. Replace <CUSTOM_PASSWORD> with your chosen agent enrollment password and run the following command:
echo "<CUSTOM_PASSWORD>" > /var/ossec/etc/authd.pass
3. Change the
authd.pass file permissions and ownership.
chmod 640 /var/ossec/etc/authd.pass
chown root:wazuh /var/ossec/etc/authd.pass
4. Restart the Wazuh service for the changes to take effect.
systemctl restart wazuh-managerAt agent side:
The following steps serve as a guide on how to enroll a Linux/Unix endpoint with password authentication:
1. Create the file
/var/ossec/etc/authd.pass with the enrollment password in it.
echo "<CUSTOM_PASSWORD>" > /var/ossec/etc/authd.passYou have to replace <CUSTOM_PASSWORD> with the agents enrollment password created on the manager.
2. File permissions for the authd.pass file should be set to 640 and the owner should be root. The permissions and ownership can be configured by running the commands below:
chmod 640 /var/ossec/etc/authd.pass
chown root:wazuh /var/ossec/etc/authd.pass3. Restart the agent to make the changes effective:
systemctl restart wazuh-agentSelect the “agents” tab to check for its connection status in the Wazuh dashboard .
Hope this helps