Rocket.Chat's Community Open Call 🎤 Dec 15, 2021 Join us!

Locked out of my Admin Panel (2FA email problem)


I somehow managed to lock myself out of my administration panel. Actually I’m still logged in but I can’t perform any changes cause the 2FA Email Code verification is popping up.

I haven’t enabled 2FA but somehow it got enabled by itself (strange) and now it asks me for email confirmation for any critical modification I’m trying to make. The user interface was acting pretty sketchy today and I had to switch from Firefox to Chrome in order to be able to modify stuff, on Firefox I was changing settings and saving and they were reverting back after refresh.

I haven’t setup the SMTP so my rocket chat can’t send emails out which means I can’t get my 2FA email.

  1. Is there a way to send the emails internally without having smtp set and read the confirmation from my server’s cli?
    If not then

  2. Can I disable 2FA Email confirmation from MongoDB? How can I go into MongoDB from my server’s CLI and disable the 2fa?


Server Setup Information

  • Version of Rocket.Chat Server: 3.18.1
  • Operating System: Ubuntu 18.04
  • Deployment Method: snap
  • Number of Running Instances: 1
  • DB Replicaset Oplog:
  • NodeJS Version: v12.22.1
  • MongoDB Version: 3.6.14 / wiredTiger (oplog Enabled)
  • Proxy:
  • Firewalls involved:

Any additional Information


You can disable 2fa through environment variables.

Read this post - Not receiving emails anymore so cannot change settings as admin as TOTP is required - #2 by dudanogueira

In case of snap, create a file say named 2fa_disable.env in $SNAP_COMMON (/var/snap/rocketchat-server/common) and add those two environment variables there.

Finally restart the server - sudo snap restart rocketchat-server

Thanks, this sorted it out.

I did this:

create file /var/snap/rocketchat-server/common/2fa_disable.env

edit file to:


Finally, reset server with:

sudo snap restart rocketchat-server

Thanks to @debdut.chakraborty for the help.

1 Like