How to disable Nagios Core GUI authentication

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
xlin125
Posts: 172
Joined: Mon Jan 19, 2015 6:01 pm

How to disable Nagios Core GUI authentication

Post by xlin125 »

We have a Nagios Core v4.2.1 installed on a Ubuntu 16.04 server. We want to disable the Apache authentication when accessing this Nagios Core GUI. What needs to be changed to disable the Apache authentication? Thanks!
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: How to disable Nagios Core GUI authentication

Post by benjaminsmith »

Hi @xlin125,

This is really not something we would reccomend doing due security issues. That said, here's how I was able to get it working.

Change the following line in the /usr/local/nagios/etc/cgi.cfg from:

Code: Select all

use_authentication=1
# to
use_authentication=0
See: https://assets.nagios.com/downloads/nag ... igcgi.html .. for documentation on this parameter.

Next, you'll need to comment out the authorization lines in the nagios Apache configuration file found in /etc/httpd/conf.d ( be sure to make a backup of this file before changing anything).

Sample File:

Code: Select all

<Directory "/usr/local/nagios/sbin">
#  SSLRequireSSL
   Options ExecCGI
   AllowOverride None
   <IfVersion >= 2.3>
     <RequireAll>
        Require all granted
#        Require host 127.0.0.1

#        AuthName "Nagios Access"
#         AuthType Basic
#         AuthUserFile /usr/local/nagios/etc/htpasswd.users
#         Require valid-user
     </RequireAll>
   </IfVersion>
   <IfVersion < 2.3>
      Order allow,deny
      Allow from all
#     Order deny,allow
#     Deny from all
#     Allow from 127.0.0.1

#      AuthName "Nagios Access"
#      AuthType Basic
#      AuthUserFile /usr/local/nagios/etc/htpasswd.users
#      Require valid-user
   </IfVersion>
</Directory>

Alias /nagios "/usr/local/nagios/share"

<Directory "/usr/local/nagios/share">
#  SSLRequireSSL
   Options None
   AllowOverride None
   <IfVersion >= 2.3>
      <RequireAll>
         Require all granted
#        Require host 127.0.0.1

#         AuthName "Nagios Access"
#         AuthType Basic
#         AuthUserFile /usr/local/nagios/etc/htpasswd.users
#         Require valid-user
      </RequireAll>
   </IfVersion>
   <IfVersion < 2.3>
      Order allow,deny
      Allow from all
#     Order deny,allow
#     Deny from all
#     Allow from 127.0.0.1

#      AuthName "Nagios Access"
#      AuthType Basic
#      AuthUserFile /usr/local/nagios/etc/htpasswd.users
#      Require valid-user
   </IfVersion>
</Directory>
Once you make all the changes, restart httpd and nagios:

Code: Select all

service httpd restart
service nagios restart
Then try to access the Nagios home page.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
xlin125
Posts: 172
Joined: Mon Jan 19, 2015 6:01 pm

Re: How to disable Nagios Core GUI authentication

Post by xlin125 »

@benjaminsmith,
Thanks for the response. I commented out the authentication lines in the Nagios.conf, and restart the Nagios. The authentication is disabled now. However, the Nagios Core Web Interface does not show who is the user, it only shows "Logged in as ?". It seems this unknown user has nagiosadmin privilege. I remember we can set this user to a user defined in the cgi.cfg file (set $USER to a user defined in cgi.cfg). Where is this configuration file? I am searching for it.
xlin125
Posts: 172
Joined: Mon Jan 19, 2015 6:01 pm

Re: How to disable Nagios Core GUI authentication

Post by xlin125 »

I found it. It can be set in the cgi.cfg file.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: How to disable Nagios Core GUI authentication

Post by benjaminsmith »

Hi @xlin125,
I found it. It can be set in the cgi.cfg file.
Great. Is ok to close this topic or did you have any other questions?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
xlin125
Posts: 172
Joined: Mon Jan 19, 2015 6:01 pm

Re: How to disable Nagios Core GUI authentication

Post by xlin125 »

@benjaminsmith, thank you! yes, please close this topic.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: How to disable Nagios Core GUI authentication

Post by benjaminsmith »

Sounds good. Closing topic.

Thank you for using the Nagios Support Forum.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked