[ This Blog Was Moved To : http://www.diknows.com ]
Later this afternoon, a colleague asked my help to change the Nagios Password.
As I am not a Nagios user, I searched google for it and found this link about Nagios Installation.
So, lets cut to the chase, here are the steps I used:
root# touch /usr/local/nagios/sbin/.htaccess root# vi /usr/local/nagios/share/.htaccess
And I wrote the follwing text in the .htaccess file
AuthName "Nagios Access" AuthType Basic AuthUserFile /usr/local/nagios/etc/htpasswd.users require valid-user
Then, I did the following:
root# touch /usr/local/nagios/share/.htaccess root# vi /usr/local/nagios/sbin/.htaccessAnd I wrote the same text in that file too. Then, I did the following (Which is the command for changing the password ):root# htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin New password: Re-type new password: Adding password for user nagiosadmin root# ls -l /usr/local/nagios/etc/htpasswd.users -rwxrwxr-- 1 nagios nagios 26 Dec 21 15:54 /usr/local/nagios/etc/htpasswd.usersroot# root# chmod o+r /usr/local/nagios/etc/htpasswd.users root# service httpd restart Stopping httpd: [ OK ] Starting httpd: [ OK ]And, This is it for now.
Advertisement


December 21, 2009 at 10:33 PM
nice work ^_^
January 13, 2012 at 9:00 PM
I just followed these instructions trying to update a password, and it deleted all users.
Here is why: the flag -c means “Create a New File”. NO !
If you use:
htpasswd -c /usr/local/nagios/etc/htpasswd.users USERNAME
you will end up with only one entry, removing all the other user accounts.
htpasswd –help
-c Create a new file.
This will update the file for you:
htpasswd -b /usr/local/nagios/etc/htpasswd.users USERNAME PASSWORD
Enjoy!