Blog

How To Change Nagios Password

Posted by:

How To Change Nagios Password

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.

2


  • AG

    sudo htpasswd /etc/nagios3/htpasswd.users nagiosadmin

  • http://id3m.net Mohamed Zaki

    nice work ^_^