# Command line disable Two Factor Authentication

**URL:** <https://meta.discourse.org/t/command-line-disable-two-factor-authentication/121480>\
**Category:** Product Support\
**Created:** [June 27, 2019, 9:54am UTC](https://meta.discourse.org/t/command-line-disable-two-factor-authentication/121480 "2019-06-27T09:54:06Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![Dat\_Nguyen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dat_nguyen/32/160485_2.png) [@Dat\_Nguyen](https://meta.discourse.org/u/Dat_Nguyen)\
**Post date:** [March 24, 2020, 7:01am UTC](https://meta.discourse.org/t/command-line-disable-two-factor-authentication/121480/7 "2020-03-24T07:01:02Z")

</div>

I am a newbie, and have the same problem. I deleted Factor Authentication on my phone without saving the backcode.  
Currently I cannot log in to the admin. Currently, I have no other staff to disable it from dasboard.  
Can anyone explain more about how to use this command ?:

> [@simon](#):
>
> Yes, you can do this by updating the `enforce_second_factor` site setting to “no”. Enter the rails console and run:
> 
> ```plaintext
> SiteSetting.enforce_second_factor = "no"
> 
> ```
> 
> The available options for that setting are “no”, “staff”, and “all”.

Thanks you

---

_[View the full topic](https://meta.discourse.org/t/command-line-disable-two-factor-authentication/121480)._
