Disabling two factor authentication in WHMCS

I ran across this issue today, and you may run across it yourself over time. Disabling two factor authentication in WHMCS can be tricky if you don’t actually have access to the account, device, or admin side to take care of this. Personally, I feel WHMCS should handle this better, but that’s just my own opinion. Each is very well welcome to their own.

The issue:
While working on a beta install, I copied the entire live install over, without disabling 2fa. Great in theory, but if you’ve got 2fa setup, you may have problems logging into your accounts when doing something like this. There are a couple of steps to disabling two factor authentication in WHMCS if you don’t have it disabled already

Step #1:
Disabling two factor authentication in WHMCS globally (via configuration)
In the account’s phpmyadmin (or mysql shell), under the database, run this:

update tblconfiguration set value='a:3:{s:11:"forceclient";s:0:"";s:10:"forceadmin";s:0:"";s:7:"modules";a:1:{s:6:"yubico";a:2:{s:8:"clientid";s:0:"";s:9:"secretkey";s:0:"";}}}' where setting='2fasettings';

This will globally disable two factor authentication for your site

Step 2:
Now, you need to run this (again from phpmyadmin, or your MySQL shell):

update tbladmins set authmodule='';
update tbladmins set authdata='';

This will globally disable two factor authentication for your admins

Additional Considerations:
Now, let’s say you want to just disable this for one specific admin (say, said admin lost their device)? Here’s how you do that. Use the very same query except just add the username clause in there… So, this (again in phpmy/shell) :

update tbladmins set authmodule='' where username='admin';
update tbladmins set authdata='' where username='admin';

Next up, we’ll be discussing how to enable two factor authentication in WHMCS, the methods of doing so (what can you use) and what the benefits of this are to you and your site. Two factor authentication is a pretty essential piece of security that should be enabled on all websites that can. Is it enabled on yours?

As always, if you have any questions, concerns, or need any further assistance… Please, get ahold of us, via our forums , support portal, chat, or any other method. We’d love to hear from you

Open in CodePen Copy