Sometimes we are tried logging into WHM servers with 2FA and it was not working.

If you did not setup it on your WHM login page then you are missing a great security feature on your cPanel server

In the event you can’t log in to your device or two-factor just isn’t working for any reason, you have the ability to disable it by logging into your server via command line as root.

I will show you how to turn off 2FA on WHM for a user using the API through the command line.

mv -v /var/cpanel/authn/twofactor_auth/tfa_userdata.json{,.bak}; echo ‘{}’ >> /var/cpanel/authn/twofactor_auth/tfa_userdata.json

Once running the above command you can able to see WHM/cPanel login page without being prompted for 2FA credentials.