This KB article shows you how to resolve issues with two factor authentication and not being able to login when it is enabled.
Confirm Correct Email Address
Two factor authentication sends an email to the address associated with a user account. If a user is not receiving the emails then the first step is to confirm their email address is correct via Admin > Users > Manage Users.
You need to be an administrative user to be able to manage users, if you are unable to login as an administrative user then the next step in this KB article will help.
Cannot Login As nagiosadmin
If the only administrative account you have enabled is the nagiosadmin account, it is possible to lock yourself out of Nagios XI. This usually occurs when the nagiosadmin account is still configured with the default root@localhost email address. You can still retrieve the token that is emailed to the root@localhost address by looking at the /var/spool/mail/root mailbox on the Nagios XI server.
Establish a terminal session to your Nagios XI sever as the root user and execute the following command:
grep -A2 'token below' /var/spool/mail/root
This should output something similar to:
To continue logging in, please enter the token below:
To continue logging in, please enter the token below:<br />
You can see from the output above that the token is 16616, this can be used to login to your Nagios XI system as the nagiosadmin account. Once logged in you can change the nagiosadmin account to the correct email address.
If you are unable to retrieve the token from the /var/spool/mail/root mailbox on the Nagios XI server then it is likely that the nagiosadmin account has an email address you are unaware of. In this scenario you are required to reset the nagiosadmin account which also disables two factor authentication. This is explained in the following KB article:
Nagios XI - Resetting The nagiosadmin Password
For any support related questions please visit the Nagios Support Forums at:
Article ID: 811
Created On: Tue, Apr 10, 2018 at 10:37 AM
Last Updated On: Thu, Jun 28, 2018 at 9:56 PM
Authored by: tlea
Online URL: https://support.nagios.com/kb/article/nagios-xi-unable-to-login-using-two-factor-authentication-811.html