Skip to content

Rolling out 2FA on cPanel user logins without a support flood

How to enable two-factor authentication for cPanel user accounts, communicate the change, and handle the inevitable "I lost my phone" tickets.

Enabling 2FA on cPanel takes one toggle. Rolling it out across an existing customer base takes a week of planning, two communications, and an explicit procedure for the customer who locks themselves out the same day. The technology is easy; the rollout is what fails.

What’s happening

cPanel’s 2FA is TOTP-based and works with any authenticator app. WHM > Security Center > Two-Factor Authentication lets you make it available, then require it. The required-for-all toggle does not retroactively force existing sessions to set up TOTP — users only see the setup screen on next login, which is good. But once required, anyone without a configured token cannot log in until they configure one or you manually disable 2FA on their account.

How to verify

whmapi1 twofactorauth_get_user_configs
whmapi1 twofactorauth_policy
grep -c "2FA" /usr/local/cpanel/logs/access_log | tail

The first command lists which cPanel accounts have 2FA configured. The second shows the current policy (off, optional, required).

The fix

  1. Week 1: enable 2FA in WHM > Security Center > Two-Factor Authentication > Settings with policy Optional. Send a customer communication explaining the change and pointing to the cPanel interface > Security > Two-Factor Authentication.
  2. Week 2: track adoption via whmapi1 twofactorauth_get_user_configs. Send a second communication to non-adopters with a hard deadline.
  3. Week 3: flip policy to Required. Have a recovery procedure documented: how an account holder verifies identity, how you remove their 2FA token via whmapi1 twofactorauth_remove_user_config user=<user>, and how they re-enroll.
  4. Operator accounts get 2FA first, not last. If you require 2FA for customers but not for operator WHM logins, your security model is upside-down.
  5. Recovery without lockout: provide each customer with a one-page PDF that says “if you lose your token, email support@ with these three identity proofs.” Skipping this step turns 2FA into a customer-service incident, not a security win.

Stack Harbor handles 2FA rollouts as part of cPanel server administration.