SOLVED Disable Two Factor Authentication with SSH from rescue system

Mario Kos

Member
Sep 4, 2015
6
2
3
Croatia
cPanel Access Level
Root Administrator
Got stuck after trying:
Code:
mv -v /var/cpanel/authn/twofactor_auth/tfa_userdata.json{,.bak}; echo ‘{}’ >> /var/cpanel/authn/twofactor_auth/tfa_userdata.json
Now have a problem:
Internal Server Error
500
Security Policy requires exec termination.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,917
2,248
363
I know about api but can api be called if rescue system is booted?
Hello,

Two-factor authentication should not prevent you from accessing the server via SSH as root. Once the server is booted out of rescue mode, you'd simply access the server via SSH as root and run those WHM API 1 commands.

Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,917
2,248
363
Hello,

It's unlikely that command will work while the server is booted in rescue mode, but it depends on the OS and the specific boot options you used. You may want to check with your hosting provider to see if they provide an option to disable the firewall rules so you can access the server via SSH.

Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,917
2,248
363
New Think local whm or csf is blocking ssh access, can you maybe instruct how to dissable csf from rescue mode?
You may find this third-party URL helpful:

How to edit /etc/sysconfig/iptables from: RESCUE MODE boot?

However, running an incorrect command could lead to data loss so it's generally advised to consult with a qualified system administrator or your hosting provider if you are not comfortable in rescue mode.

Thank you.