Home » Categories » Multiple Categories

Changing Default Passwords in Nagios Network Analyzer

Changing Default Passwords in Nagios Network Analyzer

Prerequisites

You must have an existing Nagios Network Analyzer installation using default passwords. This document assumes you have not already changed any of the passwords.

Password Consideration

All of these password changes are completely optional, however it is typically a good idea to change default password settings for any software package. This will help secure your Nagios Network Analyzer software from security threats and network compromises.

For every example throughout this document you are setting the password to NewPassword which represents the password you will be changing the defaults to. When updating files on the Linux server or running commands replace NewPassword with the password of your choice.

MySQL vs MariaDB

MySQL is the database used by Nagios Network Analyzer in RHEL / CentOS 6.x, however in RHEL / CentOS 7.x onwards MariaDB is used instead of MySQL. MariaDB is simply a fork of the MySQL database, the commands issued in this documentation will work with either product. If there are any differences they will be clearly identified.

Editing Files

In many steps of this documentation you will be required to edit files. This documentation will use the vi text editor. When using the vi editor:

  • To make changes press i on the keyboard first to enter insert mode

  • Press Esc to exit insert mode

  • When you have finished, save the changes in vi by typing :wq and press Enter

Changing the Linux Root System Account

Start by logging into the Linux server as the root user. Run the passwd command from the Linux command line with no arguments.

passwd

Changing password for user root.

New UNIX password: NewPassword

Retype new UNIX password: NewPassword

Nothing will be shown when you type the new password as Linux hides it for security reasons.

Changing MySQL Account Passwords

There are two important accounts for the MySQL database in a Nagios Network Analyzer installation: root and nagiosna. Each must be changed individually and in several places. This will by done from the Linux command line as the root user.

ROOT

First you will change the password for the root user in the MySQL database. To do so you will use the mysqladmin command and enter a new password, replace your new password in the command for NewPassword. Note the old password is welcome.

mysqladmin -u root password NewPassword

Next you will need to alter the files where the password for the root user is referenced. Locate the old password and replace it with your NewPassword.

/usr/local/nagiosna/scripts/restore_na.sh

Replace mysqlpass="nagiosna" with mysqlpass="NewPassword"

NAGIOSNA

Altering users passwords with MySQL requires a few different commands and different files will need to be modified. The following commands will be used to alter the fusion user account for the MySQL database.

After executing this command you will be prompted for the MySQL root password.

mysql -u root -p

You are now logged into the mysql command interface, this is indicated by the mysql> OR MariaDB [(none0]> prompt. Type each command as follows:

use mysql;
set password for 'nagiosna'@localhost= password('NewPassword');
flush privileges;
quit;

Next you need to alter the files where the password for the nagiosna user is referenced.

vi /var/www/html/nagiosna/application/config/config.local.php   
$config['db']['hostname'] = 'localhost';
$config['db']['username'] = 'nagiosna';
$config['db']['password'] = 'nagiosna';
$config['db']['database'] = 'nagiosna';

Replace $config['db']['password'] = 'nagiosna' with 'NewPassword'

Save the file, you have finished making changes.

0 (0)
Article Rating (No Votes)
Rate this article
  • Icon PDFExport to PDF
  • Icon MS-WordExport to MS Word
Attachments Attachments
There are no attachments for this article.
Related Articles RSS Feed
There are no related articles for this article.