I could never get the basic http auth to work for the linux agent. It would never contact. It was easier just to disable http access via web browser, so only https can be done.
You can try if you like:
To add basic auth:
$htpasswd -c /etc/apache2/htpasswd.users company
$password:xxx
$nano /etc/apache2/conf.d/z-ocsinventory-server.conf
Uncomment these lines and add correct password file
AuthType Basic
AuthName "OCS Inventory
AuthUserFile "/etc/apache2/htpasswd.users"
require valid-user
To disable http
$nano /etc/apache2/conf.d/ocsinventory-reports.conf
Uncomment following to force use of HTTPS in Administration Server
SSLRequireSSL
And then you will want to force the security of the http footer. Change “ServerTokens” to “Prod” in the file:
$nano /etc/apache2/conf.d/security