I can't log in to Nagios web interface
Solution 1
<Directory "/usr/lib/nagios/cgi-bin/">
Options ExecCGI
AllowOverride None
Order allow,deny
Allow from all
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /etc/nagios/passwd
Require valid-user
</Directory>
You have specified the wrong path for AuthUserFile
: it should be /etc/nagios/htpasswd.users
instead of /etc/nagios/htpasswd
.
Solution 2
Ensure that apache's user can read /etc/nagios/htpasswd.users
:
If your apache user is www-data
, then:
$ sudo chown www-data /etc/nagios/htpasswd.users
$ sudo chmod 600 /etc/nagios/htpasswd.users
Related videos on Youtube
Comments
-
Quanticat almost 2 years
When i try to login to Nagios in my web browser and after having repeatedly enter my login and password on my Nagios page
http://127.0.0.1/nagios/
, i get this :Authorization Required
This server could not verify that you are authorized to access the document requested. Either you supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required. Apache/2.2.15 (Red Hat) Server at 127.0.0.1 Port 80
I changed the password :
htpasswd -c /etc/nagios/htpasswd.users nagiosadmin
And restart the server :
service httpd restart
But without result !
-
Greg Petersen almost 12 yearsWhat does the Apache error log say? Show us your configuration for Nagios
/etc/httpd/conf.d/nagios.conf
? -
Quanticat almost 12 yearsThis is the configuration for Nagios : pastebin.com/eNek5CPD
-
Quanticat almost 12 yearsAnd this is the Apache's error.log : pastebin.com/94iWakSu
-
Greg Petersen almost 12 yearsuser nagiosadmin: authentication failure for "/nagios/": Password Mismatch.
-
ILMostro_7 over 7 yearsRHEL/CentOS provides
/etc/nagios/passwd
by default. Executehtpasswd -c /etc/nagios/passwd nagiosadmin
, followed by your desired password, and all's fine in the world. :D
-
-
ILMostro_7 over 7 yearsOddly enough, the file supplied by the
nagios
package on CentOS7, for example, already has an entry fornagiosadmin:RaNdOmHash
. However, that doesn't take effect until one executeshtpasswd -c /etc/nagios/passwd
. As long as theAuthUserFile
is specified tohtpasswd
, it shouldn't matter what it's called. -
ILMostro_7 over 7 yearsAs long as the Group, e.g.
www-data
, canread
the file, it can have640
permissions, owned byroot:www-data
. -
ILMostro_7 over 7 yearsDuh, it makes sense that it doesn't work by default, as the password entry is hashed/scrambled.