Introduction
When 2-Factor Authentication (2FA) is enabled in WHM or cPanel, it prevents the login until a code from an external device is validated. Sometimes that device can become lost, broken, or re-configured, which breaks this external validation process. These are the steps you can take to disable 2FA from the Command Line via SSH.
Procedure
Make sure you login as the root user on your server and run the following command:
whmapi1 twofactorauth_disable_policy
This will disable 2FA for your WHM, and will allow you to log in to the server and perform an update to the 2FA policy for your new device.