How To Change Nagios Password

[ This Blog Was Moved To : ]

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/.htaccess

And 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.


4 Responses to “How To Change Nagios Password”

    • Nick Says:

      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

  1. asim Says:

    Thanks 1st one i work perfectly

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: