Root Password no longer working

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
LAPFCU
Posts: 15
Joined: Mon Mar 02, 2020 9:56 am

Root Password no longer working

Post by LAPFCU »

Hello,

Originally when I setup NagiosXI, I changed out the default password for our own. It worked for some time, but no longer works.
Any idea why this may have happened or how to recover or change the password?

I attempted to use the default thinking it may have reverted, but that one does not work either.

Thank you
gsmith
Posts: 1253
Joined: Tue Mar 02, 2021 11:15 am

Re: Root Password no longer working

Post by gsmith »

HI,

When you say root password I think you really mean the password for nagiosadmin, right?

If so, please run this:

/usr/local//nagiosxi/scripts/reset_nagiosadmin_password.php

Code: Select all

[root@gs-centos8-23-95 local]# nagiosxi/scripts/reset_nagiosadmin_password.php
Nagios XI Admin Password Reset Tool
Copyright (c) 2016-2018 Nagios Enterprises, LLC

Usage: nagiosxi/scripts/reset_nagiosadmin_password.php --password=<newpassword>

Resets password used to login to the Nagios XI interface as the nagiosadmin user.
[root@gs-centos8-23-95 local]#
Thanks
LAPFCU
Posts: 15
Joined: Mon Mar 02, 2020 9:56 am

Re: Root Password no longer working

Post by LAPFCU »

Sorry for the very long delay. No I mean the root credentials for CentOS7.

For the life of me I cannot figure out why they no longer work.

I changed the default credential Linux side a while back and immediately saved it, and used it many times. Why would it just quit working?
gsmith
Posts: 1253
Joined: Tue Mar 02, 2021 11:15 am

Re: Root Password no longer working

Post by gsmith »

Hi,

I found this process for resetting the root password:
CentOS 7
As the system boots, press ESC to bring up the GRUB boot prompt. The prompt happens early in the boot process. If you miss the prompt, you need to restart the server from the control panel and try again.
At the GRUB boot prompt, press E to edit the first boot option.
Find the kernel line starting with linux16.
Change ro to rw init=/sysroot/bin/sh.
Press CTRL+X or F10 to boot into single user mode.
Access the system with the command: chroot /sysroot.
Type passwd and follow the prompts to change the root password.
Run touch /.autorelabel to force file system relabeling. This is required for systems with SELinux. When you reboot the system, it will relabel the filesystem for SElinux. The reboot may take extra time during this process.
Run exit.
Run reboot -f to reboot the server.
I am not sure how the root password would have gotten changed. Do you have any server automation (Ansible, Chef, Puppet)
running?

You could try looking at /var/log/audit/audit.log to see if you can find out when the root password was changed.

Thanks
Locked