# Disable 2FA from commandline

**URL:** <https://forum.gitea.com/t/disable-2fa-from-commandline/138>\
**Category:** Install/Maintain/Configure\
**Created:** [November 30, 2017, 10:20am UTC](https://forum.gitea.com/t/disable-2fa-from-commandline/138 "2017-11-30T10:20:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tistjendop](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/tistjendop/32/93_2.png) [@tistjendop](https://forum.gitea.com/u/tistjendop)\
**Post date:** [November 30, 2017, 10:20am UTC](https://forum.gitea.com/t/disable-2fa-from-commandline/138/1 "2017-11-30T10:20:10Z")

</div>

Hi,

I lost the device I used for 2FA and my scratch codes with it.  
Is it possible to disable 2FA for my user from the commandline (like ./gitea admin ) or by setting a config option or changing a database field?

I have full access to the server and database, just not getting into gitea.

thanks in advance,  
Tist

---

<div class="post-metadata">

**Author:** ![lunny](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/lunny/32/4701_2.png) [@lunny](https://forum.gitea.com/u/lunny)\
**Post date:** [December 1, 2017, 5:18am UTC](https://forum.gitea.com/t/disable-2fa-from-commandline/138/2 "2017-12-01T05:18:25Z")

</div>

Delete the record on table two\_factor via uid is your id on table user which will help you login with your password.

---

<div class="post-metadata">

**Author:** ![tistjendop](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/tistjendop/32/93_2.png) [@tistjendop](https://forum.gitea.com/u/tistjendop)\
**Post date:** [December 1, 2017, 8:27am UTC](https://forum.gitea.com/t/disable-2fa-from-commandline/138/3 "2017-12-01T08:27:43Z")

</div>

Thanks, Iḿ back in my gitea instance!

---

<div class="post-metadata">

**Author:** ![nullishamy](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/nullishamy/32/3692_2.png) [@nullishamy](https://forum.gitea.com/u/nullishamy)\
**Post date:** [May 13, 2023, 4:43pm UTC](https://forum.gitea.com/t/disable-2fa-from-commandline/138/4 "2023-05-13T16:43:58Z")

</div>

Hate to necro but since this is one of the only articles discussing the topic, if you use a webauthn security key, you’ll need to inspect the `webauthn_credential` table instead of `two_factor`!
