Web interface not prompting for 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
NicNag
Posts: 3
Joined: Tue Apr 10, 2018 6:12 am

Web interface not prompting for authentication

Post by NicNag »

Hi

Tried to look at similar questions, but could not find solution.

Nagios web interface does not prompt for login credentials, also displays message"..you do not have permission to view information for any of the services you requested..."

Installations Nagios 3.5, Apache 2.4, Red Hat 7.4

Confirmed the below are set:
htpasswd /usr/local/nagios/etc/htpasswd.users nagiosadmin
htpasswd.users file permissions- nagios:nagios

==cgi.cfg config file==
use_authentication=1
authorized_for_system_information=nagiosadmin
authorized_for_configuration_information=nagiosadmin
authorized_for_system_commands=nagiosadmin
authorized_for_all_services=nagiosadmin
Disabled SELINUX
sed -i 's/SELINUX=enforcing/SELINUX=permissive/g' /etc/selinux/config
setenforce 0
==Apache nagios.conf==
ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin"

<Directory "/usr/local/nagios/sbin">
# SSLRequireSSL
Options ExecCGI
AllowOverride None
Require all granted
# 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
</Directory>

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

<Directory "/usr/local/nagios/share">
Similar as the above
Any idea what may be missing or if it may be Apache config related?

Thanks
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Web interface not prompting for authentication

Post by scottwilkerson »

Here's the settings I believe you need

Code: Select all

ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin"

<Directory "/usr/local/nagios/sbin">
   Options ExecCGI
   AllowOverride None
   Order allow,deny
   Allow from all
   AuthName "Nagios Core"
   AuthType Basic
   AuthUserFile /usr/local/nagios/etc/htpasswd.users
   Require valid-user
   Require all denied
</Directory>

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

<Directory "/usr/local/nagios/share">
   Options None
   AllowOverride None
   Order allow,deny
   Allow from all
   AuthName "Nagios Core"
   AuthType Basic
   AuthUserFile /usr/local/nagios/etc/htpasswd.users
   Require valid-user
   Require all denied
</Directory>
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
NicNag
Posts: 3
Joined: Tue Apr 10, 2018 6:12 am

Re: Web interface not prompting for authentication

Post by NicNag »

Thanks for the help, seems like Apache 2.4 does not like the below commands
Order allow,deny
Allow from all


After restart messages returned
Invalid command 'Order', perhaps misspelled or defined by a module not included in the server configuration
Invalid command 'Allow', perhaps misspelled or defined by a module not included in the server configuration

However after removing them and the below it was working!
Require all granted
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Web interface not prompting for authentication

Post by scottwilkerson »

NicNag wrote:Thanks for the help, seems like Apache 2.4 does not like the below commands
Order allow,deny
Allow from all


After restart messages returned
Invalid command 'Order', perhaps misspelled or defined by a module not included in the server configuration
Invalid command 'Allow', perhaps misspelled or defined by a module not included in the server configuration

However after removing them and the below it was working!
Require all granted
Excellent, glad it is resolved
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked