Skip to main content

Disable Two Factor Authentication with SSH from rescue system

Comments

9 comments

  • Kosinus
    Got stuck after trying:
    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.
    0
  • Infopro
    This thread should be helpful for your original issue: Two-Factor Authentication
    0
  • Kosinus
    This thread should be helpful for your original issue: Two-Factor Authentication

    I know about api but can api be called if rescue system is booted?
    0
  • cPanelMichael
    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.
    0
  • Kosinus
    Firewall is preventing me from accesing, is it possible to disable 2FA from rescue mode?
    0
  • cPanelMichael
    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.
    0
  • Kosinus
    Think local whm or csf is blocking ssh access, can you maybe instruct how to dissable csf from rescue mode?
    0
  • cPanelMichael
    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.
    0
  • Kosinus
    Solved by disabling CSF adding file csf.disable to csf folder.
    touch /etc/csf/csf.disable
    After reboot managed to SSH login and disable 2FA with whmapi1
    whmapi1 twofactorauth_disable_policy
    0

Please sign in to leave a comment.