# Reset 2FA settings for user

**URL:** <https://forums.rocket.chat/t/reset-2fa-settings-for-user/1460>\
**Category:** Community Support\
**Created:** [July 2, 2018, 7:01am UTC](https://forums.rocket.chat/t/reset-2fa-settings-for-user/1460 "2018-07-02T07:01:47Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![flow-fval](https://avatars.discourse-cdn.com/v4/letter/f/3d9bf3/32.png) [@flow-fval](https://forums.rocket.chat/u/flow-fval)\
**Post date:** [July 2, 2018, 7:01am UTC](https://forums.rocket.chat/t/reset-2fa-settings-for-user/1460/1 "2018-07-02T07:01:47Z")

</div>

1. have own installation of rocket.chat
2. user enables 2FA
3. user loses phone

is the account lost forever? is there a way for me as admin to reset a specific user’s 2FA settings?

---

<div class="post-metadata">

**Author:** ![dazoot](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/dazoot/32/704_2.png) [@dazoot](https://forums.rocket.chat/u/dazoot)\
**Post date:** [November 21, 2018, 5:12pm UTC](https://forums.rocket.chat/t/reset-2fa-settings-for-user/1460/2 "2018-11-21T17:12:46Z")

</div>

I could not find any option in the Admin to reset the TOTP (2FA) code for a particular user.

The only solution is to run a query to update the mongo DB directly:

```
db.users.update({"username": "USERNAMEHERE"}, {"$unset":{"services.totp": 1}});
```

---

<div class="post-metadata">

**Author:** ![TongHova](https://avatars.discourse-cdn.com/v4/letter/t/9dc877/32.png) [@TongHova](https://forums.rocket.chat/u/TongHova)\
**Post date:** [August 18, 2019, 7:13am UTC](https://forums.rocket.chat/t/reset-2fa-settings-for-user/1460/3 "2019-08-18T07:13:46Z")

</div>

How to use your code?  
where to put that code?  
Im a newbie ofcourse!! 🙂 and lost my phone.

please help.

---

<div class="post-metadata">

**Author:** ![horstepipe](https://avatars.discourse-cdn.com/v4/letter/h/9dc877/32.png) [@horstepipe](https://forums.rocket.chat/u/horstepipe)\
**Post date:** [February 4, 2020, 10:07am UTC](https://forums.rocket.chat/t/reset-2fa-settings-for-user/1460/4 "2020-02-04T10:07:27Z")

</div>

On Ubuntu (snap installation) you have to do the following:  
Navigate to /snap/rocketchat-server/current/bin/  
and execute “mongo” with

> ```
> ./mongo
> 
> ```

you’re in the mongo command line now.  
Now you have to find the correct database used by rocket.chat with

> show dbs

and select the correct db used by rocket.chat (in my case the db is called “parties”, so enter

> use parties

now you can run the query from above

```auto
db.users.update({"username": "USERNAMEHERE"}, {"$unset":{"services.totp": 1}});

```

Best regards

---

<div class="post-metadata">

**Author:** ![2disbetter](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/2disbetter/32/1203_2.png) [@2disbetter](https://forums.rocket.chat/u/2disbetter)\
**Post date:** [June 21, 2020, 3:53pm UTC](https://forums.rocket.chat/t/reset-2fa-settings-for-user/1460/5 "2020-06-21T15:53:15Z")

</div>

Sorry to rez this thread, but I am curious, if there is a way to reset an accounts individual 2FA settings. IE: phone was lost, authenicator data lost, backup codes are poof, etc.

I would like my users to use 2FA, but need a way around this. Using the mongo command above appears to work, but the user account still has 2FA enabled and requires a code from the authenticator or backup codes to disable.

Is there a way around this, that leads to the user being able to setup a new association with an authenticator?

---

<div class="post-metadata">

**Author:** ![helvetepjeksa](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/helvetepjeksa/32/2493_2.png) [@helvetepjeksa](https://forums.rocket.chat/u/helvetepjeksa)\
**Post date:** [January 15, 2021, 8:25am UTC](https://forums.rocket.chat/t/reset-2fa-settings-for-user/1460/6 "2021-01-15T08:25:44Z")

</div>

This helped me turn off 2fa email code for my users.

```auto
db.users.update({"username":USERNAME}, {"$set":{"services.email2fa.enabled": false}});

```
