How To Reset/Change The NagiosAdmin Password in Linux?

Nagios is one of the best monitoring tool, that monitors entire IT infrastructure and ensure everything functioning properly.

It monitors systems, applications, services, appliance (router, switch, load-balancer, etc).

In the event of a failure, Nagios will trigger an alert to given email id.

By default, nagiosadmin user account get created as a admin user. If you forgot or would like to change NagiosAdmin password then don’t worry because it’s not a big deal to change or reset it.

Also, it doesn’t impact Nagios functionality but we can’t able to make any changes on it through GUI as we don’t know the password.

Say for example, if you would like to enable/disable any alerts then you can’t do it right away through GUI but at the same time you can do it via CLI since it doesn’t required any authentication.

If you looking for Nagios related articles, here to go.

However, making the changes through GUI is better than CLI so, we will show you, how to reset or change the NagiosAdmin password in Linux.

How to Change or Reset The Nagios Core Nagiosadmin Password in Linux?

To do so, follow the below procedures.

Make a note that you have to take a backup of your config file whenever you are going to make a changes in Linux system, it’s always good practice.

So, i would advise you to take a backup before performing it, later you can revert it, if something goes wrong.

If you would like to know how many users are available in the htpasswd.users file then run the following command. We have two users in our server as per the below output.

# cat /usr/local/nagios/etc/htpasswd.users

nagiosadmin:$apr1$weLpUK3j$ignFMjGNZqV9E9ToZZBr/1
daygeek:$apr1$Vgn3G9.X$z8TmXdhFV0D655RqPhUq1.
magi:$apr1$GS0Khpta$7pbTrUE4JCLryNdXwsbz00

If you would like to print only usernames, run the following command.

# cat /usr/local/nagios/etc/htpasswd.users | cut -d":" -f1
nagiosadmin
daygeek
magi

Backup the “htpasswd.users” file.

# cp /usr/local/nagios/etc/htpasswd.users /usr/local/nagios/etc/htpasswd.users.bk

Run the following command to reset the Nagiosadmin Password.

# htpasswd /usr/local/nagios/etc/htpasswd.users nagiosadmin

New password: 
Re-type new password: 
Updating password for user nagiosadmin

After generating a new password of nagiosadmin user then you can recheck the same by running the following command.

# cat /usr/local/nagios/etc/htpasswd.users

nagiosadmin:$apr1$Q8PEgBRl$NStzT.TT.KsGZ0KkwbF3r.
daygeek:$apr1$Vgn3G9.X$z8TmXdhFV0D655RqPhUq1.
magi:$apr1$GS0Khpta$7pbTrUE4JCLryNdXwsbz00

Also, you can login to the Nagios Core GUI.

Nagios Core Home Page.

About Magesh Maruthamuthu

Love to play with all Linux distribution

View all posts by Magesh Maruthamuthu

One Comment on “How To Reset/Change The NagiosAdmin Password in Linux?”

  1. Just installing nagios for the first time. When I use the command “htpasswd –c /usr/local/nagios/etc/htpasswd.users nagiosadmin”, I get the usage syntax printed out, as if it was incorrect. But no errors are presented. Any ideas?

Leave a Reply

Your email address will not be published. Required fields are marked *