SOLVED How can you disable two form authentication via root command?

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,228
463
Hello,

You can disable two-factor authentication with the following command:

Code:
whmapi1 twofactorauth_disable_policy
Thank you.
 

WebHostPro

Well-Known Member
PartnerNOC
Jul 28, 2002
1,726
28
328
LA, Costa RIca
cPanel Access Level
Root Administrator
Twitter
Hello,

You can disable two-factor authentication with the following command:

Code:
whmapi1 twofactorauth_disable_policy
Thank you.
Oh actually, I ran that and got:

# whmapi1 twofactorauth_disable_policy
---
metadata:
command: twofactorauth_disable_policy
reason: OK
result: 1
version: 1

Yet, it's still there. Is there more I need to do to disable it?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,228
463

WebHostPro

Well-Known Member
PartnerNOC
Jul 28, 2002
1,726
28
328
LA, Costa RIca
cPanel Access Level
Root Administrator
Twitter
Hello,

Is this for a specific cPanel account? If so, you can use the following UAPI command to disable it for a specific user:

Code:
uapi --user=username TwoFactorAuth remove_user_configuration
The function is documented at:

UAPI Functions - TwoFactorAuth::remove_user_configuration - Developer Documentation - cPanel Documentation

Thank you.
Oh sorry it's for the WHM. It asks for 4 questions to access that where set by the previous webmaster that our customer used. Now the customer can't get in after letting their webmaster go.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,228
463
Oh sorry it's for the WHM. It asks for 4 questions to access that where set by the previous webmaster that our customer used. Now the customer can't get in after letting their webmaster go.
Hello,

That's actually the Security Questions feature enabled with the Limit Logins to Verified IP Addresses option in "WHM Home » Security Center » Configure Security Policies". We document how to disable this from the command line at:

Configure Security Policies - Version 70 Documentation - cPanel Documentation

Disable security questions via SSH
To disable security questions via the command line, perform the following steps:
  1. Use SSH to log in to your server as the root user.
  2. Open the /var/cpanel/cpanel.config file in your preferred text editor.
  3. Change the value of the SecurityPolicy::SourceIPCheck option to 0.
  4. Save and exit the file.
  5. Run the /scripts/restartsrv cpanel command to restart cPanel & WHM.
Thank you.