# Admin Two-Factor Authentication Backup Code Forgotten

**URL:** <https://help.nextcloud.com/t/admin-two-factor-authentication-backup-code-forgotten/139078>\
**Category:** ℹ️ Support\
**Tags:** mfa, feature\
**Created:** [May 15, 2022, 11:29am UTC](https://help.nextcloud.com/t/admin-two-factor-authentication-backup-code-forgotten/139078 "2022-05-15T11:29:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrevoa](https://help.nextcloud.com/letter_avatar/andrevoa/32/5_5575768a8748004e209b776fc1b2916d.png) [@Andrevoa](https://help.nextcloud.com/u/Andrevoa)\
**Post date:** [May 15, 2022, 11:29am UTC](https://help.nextcloud.com/t/admin-two-factor-authentication-backup-code-forgotten/139078/1 "2022-05-15T11:29:21Z")

</div>

Hello dear community,

I have a problem. Today I set up my nextCloud and wanted to activate a two-factor authentication directly.  
I logged in as admin and activated the two-factor authentication. As I thought that you have to configure the two-factor authentication first, I logged out directly. Of course, I did not save the backup code.

Is there a way to get the backup code again? Or is there a way to bypass the two-factor authentication?

I still have full access to the server (via command line) but I cannot log into the account.

> Two-factor authentication
> 
> Two-factor authentication is enforced but has not been configured for your account. Use one of your backup codes to log in, or contact your administrator for assistance.
> 
> Use backup code
> 
> Cancel login

---

<div class="post-metadata">

**Author:** ![mritzmann](https://help.nextcloud.com/user_avatar/help.nextcloud.com/mritzmann/32/43763_2.png) [@mritzmann](https://help.nextcloud.com/u/mritzmann)\
**Post date:** [May 17, 2022, 8:05am UTC](https://help.nextcloud.com/t/admin-two-factor-authentication-backup-code-forgotten/139078/2 "2022-05-17T08:05:45Z")

</div>

You can deactivate 2fa on the console.

Show Configuration:

```auto
php ./occ twofactorauth:state <user>

```

Disable 2FA:

```auto
php ./occ twofactorauth:disable <user> <provider>

```

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 13, 2024, 2:14pm UTC](https://help.nextcloud.com/t/admin-two-factor-authentication-backup-code-forgotten/139078/3 "2024-12-13T14:14:59Z")

</div>


