OSSEC start problem due to keys

The following is an error I got after starting ossec as an agent that is supposed to connect back to a central server:


#/var/ossec/bin/ossec-control start
Starting OSSEC HIDS v2.5.1 (by Trend Micro Inc.)...
Started ossec-execd...
ossec-agentd(1402): ERROR: Authentication key file '/var/ossec/etc/client.keys' not found.
ossec-agentd(1750): ERROR: No remote connection configured. Exiting.
ossec-agentd(4109): ERROR: Unable to start without auth keys. Exiting.




The server (the one that ossec connects to) needs to have a key created for this agent, you can do so via:
# /var/ossec/bin/manage_agents



On the client (the one that got the error message) you need to add the key via the same command. Finally you can start ossec on the client:
# /var/ossec/bin/ossec-control start

That should do it!