Page 1 of 1

Web interface not prompting for authentication

Posted: Tue Apr 10, 2018 7:28 am
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

Re: Web interface not prompting for authentication

Posted: Tue Apr 10, 2018 11:54 am
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>

Re: Web interface not prompting for authentication

Posted: Wed Apr 11, 2018 3:08 am
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

Re: Web interface not prompting for authentication

Posted: Wed Apr 11, 2018 9:15 am
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