Two-factor authentication (2FA) is a security measure that requires 2 forms of identification to successfully access a service. Enabling this service will strengthen the overall security within your server.
To enable 2FA within the WHM interface, you can navigate to the "Two-Factor Authentication" page, and click on the toggle button at the top right.
In some instances, this interface will not exist in the WHM interface. If you have already verified that you're on cPanel v54 or higher, the page may need to be enabled manually. To do this, you can run the following command:
touch /var/cpanel/enable_twofactor_ui && /usr/local/cpanel/whostmgr/docroot/themes/x/rebuildtmpl
There will be select instances where you would want to enable 2FA over the command line, such as if you're managing multiple servers at once. We currently do have a WHMAPI1 command in place to accomplish this through:
# whmapi1 twofactorauth_enable_policy
You can find additional settings for configuration over WHMAPI1 for the service through the below documentation: