Title: Small problem with 2FA
Last modified: March 8, 2023

---

# Small problem with 2FA

 *  Resolved [crimsonhack](https://wordpress.org/support/users/crimsonhack/)
 * (@crimsonhack)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/small-problem-with-2fa/)
 * Hi, I have a small problem with one of my pages. In one of them I have enabled
   two-factor authentication, the problem is that a few days ago my phone was stolen
   and I can’t find the recovery codes either. Is there any way to reset the 2FA
   to reconfigure it again?
 * Thank you!
 * PS: The only thing I have been able to do for now is to log into FTP and disable
   the plugin, login to the site, re-activate the plugin and disable 2FA, but what
   I want to do is to reconfigure the two-step authentication to re-enable it.
    -  This topic was modified 3 years, 3 months ago by [crimsonhack](https://wordpress.org/support/users/crimsonhack/).

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Support [Simeon Boev](https://wordpress.org/support/users/k3llanved/)
 * (@k3llanved)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/small-problem-with-2fa/#post-16541320)
 * Hello [@crimsonhack](https://wordpress.org/support/users/crimsonhack/),
 * One of the best methods to reset the 2FA setup for a specific user is using WP-
   CLI:
 * `wp sg 2fa reset username`
 * The alternative is to remove/rename the sgs_encrypt_key.php file from the wp-
   content/ folder of the website. Keep in mind ,however, that this will reset the
   2FA for all users in your website.
 * Best Regards,
 * Simeon Boev
 *  Thread Starter [crimsonhack](https://wordpress.org/support/users/crimsonhack/)
 * (@crimsonhack)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/small-problem-with-2fa/#post-16541338)
 * Thank you very much [@k3llanved](https://wordpress.org/support/users/k3llanved/),
 * Honestly I’m not familiar with WP-CLI and I don’t know how to do it, but I tried
   removing the file you mention and it doesn’t work, when I login it keeps asking
   me for the authentication code or a recovery code.
 * Is there a detailed tutorial on how to use WP-CLI?
 *  Plugin Support [Simeon Boev](https://wordpress.org/support/users/k3llanved/)
 * (@k3llanved)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/small-problem-with-2fa/#post-16541457)
 * To use WP-CLI you would need access to your hosting account via SSH. Depending
   on your hosting provider take a look if they have a tutorial on how to generate
   SSH key and how to use it. Depending on the operating system SSH setup/usage 
   will differ:
 * [https://www.howtogeek.com/311287/how-to-connect-to-an-ssh-server-from-windows-macos-or-linux/](https://www.howtogeek.com/311287/how-to-connect-to-an-ssh-server-from-windows-macos-or-linux/)
 * The process may look dauntful, however, once you have the SSH key it gets easier.
   You would only need to access the home folder of the website after and execute
   the command that I have earlier. The tricky part here would be if the hosting
   provider that you use does not have native WP-CLI included in their service as
   this would require installing it if it’s not available:
 * [https://make.wordpress.org/cli/handbook/guides/installing/](https://make.wordpress.org/cli/handbook/guides/installing/)
 * Last but not least you could always disable the 2FA using your website’s database
   via phpMyAdmin or any other database management tool. In the options table of
   the website database, you should find “sg_security_sg2fa” and update its value
   to “0”. This should be sufficient to disable the feature and grant you access
   to the administrative backend of the website.
 * Best Regards,
 * Simeon Boev
 *  Thread Starter [crimsonhack](https://wordpress.org/support/users/crimsonhack/)
 * (@crimsonhack)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/small-problem-with-2fa/#post-16541618)
 * Thank you for your help [@k3llanved](https://wordpress.org/support/users/k3llanved/)!
   I solved the problem using Putty, although I had to use another command.
 * `wp sg 2fa reset all`
 *  Plugin Support [Simeon Boev](https://wordpress.org/support/users/k3llanved/)
 * (@k3llanved)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/small-problem-with-2fa/#post-16541621)
 * I am glad I could help. The options to reset the 2FA for all users works as well
   🙂

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Small problem with 2FA’ is closed to new replies.

 * ![](https://ps.w.org/sg-security/assets/icon-256x256.gif?rev=2971855)
 * [Security Optimizer - The All-In-One Protection Plugin](https://wordpress.org/plugins/sg-security/)
 * [Support Threads](https://wordpress.org/support/plugin/sg-security/)
 * [Active Topics](https://wordpress.org/support/plugin/sg-security/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/sg-security/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/sg-security/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [Simeon Boev](https://wordpress.org/support/users/k3llanved/)
 * Last activity: [3 years, 3 months ago](https://wordpress.org/support/topic/small-problem-with-2fa/#post-16541621)
 * Status: resolved