# How to disable 2FA

**URL:** https://meta.discourse.org/t/how-to-disable-2fa/131475
**Category:** Support
**Created:** [October 20, 2019, 12:34pm UTC](https://meta.discourse.org/t/how-to-disable-2fa/131475 "2019-10-20T12:34:12Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![koltl](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/koltl/32/152166_2.png) [@koltl](https://meta.discourse.org/u/koltl)
#### Post date: [October 20, 2019, 12:34pm UTC](https://meta.discourse.org/t/how-to-disable-2fa/131475/1 "2019-10-20T12:34:12Z")

</div>

I restored a backup and upon logging in, it asks me for my 2FA code which I don’t have on my phone anymore. Any way to disable 2FA on my account?

Thank you

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [October 20, 2019, 6:34pm UTC](https://meta.discourse.org/t/how-to-disable-2fa/131475/2 "2019-10-20T18:34:27Z")

</div>

An admin will have to disable it for you.

---

<div class="post-metadata">

### Author: ![koltl](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/koltl/32/152166_2.png) [@koltl](https://meta.discourse.org/u/koltl)
#### Post date: [October 20, 2019, 8:39pm UTC](https://meta.discourse.org/t/how-to-disable-2fa/131475/3 "2019-10-20T20:39:58Z")

</div>

I am the administrator. I understand you can do that sort of thing through the terminal but I don’t understand how.

Thank you

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [October 20, 2019, 9:06pm UTC](https://meta.discourse.org/t/how-to-disable-2fa/131475/4 "2019-10-20T21:06:51Z")

</div>

[https://meta.discourse.org/t/admin-locked-out-of-2fa/92156/2?u=pfaffman](https://meta.discourse.org/t/admin-locked-out-of-2fa/92156/2)

---

<div class="post-metadata">

### Author: ![koltl](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/koltl/32/152166_2.png) [@koltl](https://meta.discourse.org/u/koltl)
#### Post date: [October 20, 2019, 9:14pm UTC](https://meta.discourse.org/t/how-to-disable-2fa/131475/5 "2019-10-20T21:14:12Z")

</div>

I followed that and I am getting this,

 ![image](https://global.discourse-cdn.com/meta/original/3X/c/7/c7ad7bed04515ae791cdd831a2149c6fb7b00129.png)

Thank you

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [October 20, 2019, 9:48pm UTC](https://meta.discourse.org/t/how-to-disable-2fa/131475/6 "2019-10-20T21:48:18Z")

</div>

Maybe @featheredtoast can advise. I meant get _another_ admin to reset it for you. Are you the only admin, or something?

---

<div class="post-metadata">

### Author: ![koltl](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/koltl/32/152166_2.png) [@koltl](https://meta.discourse.org/u/koltl)
#### Post date: [October 20, 2019, 9:59pm UTC](https://meta.discourse.org/t/how-to-disable-2fa/131475/7 "2019-10-20T21:59:07Z")

</div>

I am the only admin, I think. This is an old backup

---

<div class="post-metadata">

### Author: ![koltl](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/koltl/32/152166_2.png) [@koltl](https://meta.discourse.org/u/koltl)
#### Post date: [October 20, 2019, 10:17pm UTC](https://meta.discourse.org/t/how-to-disable-2fa/131475/8 "2019-10-20T22:17:56Z")

</div>

Okay and I noticed a syntax error in my screenshot so I did it correctly, same issue,

![image](https://global.discourse-cdn.com/meta/original/3X/e/0/e020de07b3a4045dd866f20818397ac986b73417.png)

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [October 20, 2019, 10:57pm UTC](https://meta.discourse.org/t/how-to-disable-2fa/131475/9 "2019-10-20T22:57:14Z")

</div>

Don’ t type the `%` symbol on every line. Ignore that and type the rest.

---

<div class="post-metadata">

### Author: ![koltl](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/koltl/32/152166_2.png) [@koltl](https://meta.discourse.org/u/koltl)
#### Post date: [October 21, 2019, 12:24am UTC](https://meta.discourse.org/t/how-to-disable-2fa/131475/10 "2019-10-21T00:24:11Z")

</div>

That works but now I am getting this for the last command,

 ![image](https://global.discourse-cdn.com/meta/original/3X/6/f/6f7d424121587a5620193d0607f3fba142f31080.png)

---

<div class="post-metadata">

### Author: ![featheredtoast](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/featheredtoast/32/116994_2.png) [@featheredtoast](https://meta.discourse.org/u/featheredtoast)
#### Post date: [October 21, 2019, 4:44am UTC](https://meta.discourse.org/t/how-to-disable-2fa/131475/11 "2019-10-21T04:44:53Z")

</div>

The alias changed since we have multiple totps now. Also that command would remove _all_ totp instances across all users… You probably want to do the following as the second command:

`UserSecondFactor.totps.where(user_id: id).each(&:destroy!)`

---

<div class="post-metadata">

### Author: ![koltl](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/koltl/32/152166_2.png) [@koltl](https://meta.discourse.org/u/koltl)
#### Post date: [October 21, 2019, 12:52pm UTC](https://meta.discourse.org/t/how-to-disable-2fa/131475/12 "2019-10-21T12:52:20Z")

</div>

That worked! Thank you very much

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [November 20, 2019, 1:05pm UTC](https://meta.discourse.org/t/how-to-disable-2fa/131475/13 "2019-11-20T13:05:45Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
