Skip to main content
sdebnath
Staff
Staff
Jun 27, 2025 1:06 PM UTC

FortiToken 2FA recovery: steps to restore device access

  • Oct 28, 2026 8:29 AM UTC
  • 0 replies
  • 4979 views
  • Translate All

Description

Steps to regain access to a device after losing FortiToken 2FA credentials.

Scope

FortiGate.

Solution

An administrator may encounter difficulties accessing the FortiGate GUI due to issues with two-factor authentication (2FA). Common scenarios include:

  1. The 2FA token is not being delivered to the registered email address.

  2. The mobile device with the FortiToken application has been lost.

  3. The FortiToken application was migrated to a new device and is no longer functioning correctly.

 

In these circumstances where access to the FortiGate device is lost due to issues with two-factor authentication (2FA), there are several methods available to restore administrative access.

 

  1. Local super_admin account.
    Fortinet recommends creating a backup super admin account, especially when enabling 2FA for the primary admin user. This backup account can be used to regain access if the primary account encounters 2FA or password-related issues.

  2. FortiManager.
    If the device is managed through FortiManager, a CLI script can be pushed to the FortiGate to remove the FortiToken configuration from the affected admin user, allowing access to be restored. To push the admin account from FortiManager, see 
    Technical Tip: Admin account can be pushed from FortiManager to FortiGate.

  3. Premium FortiGate Cloud.
    For devices linked to a premium FortiGate Cloud account, remote admin management capabilities may allow for resetting or reconfiguring the admin account without requiring local access. See this article:
    Recover access to FortiGate via FortiGate Cloud.

    Important Note: FortiCloud Premium can assist in recovering access when the administrator's 2FA token is lost, or the admin password is lost, but only if the required conditions were met before the lockout.
    Refer to the following article for additional information: 
    Technical Tip: Recover admin access with FortiCloud if 2factor FortiToken has been assigned accidentally to admin ID.

    Purchasing a Premium/paid FortiGate Cloud subscription after losing the device admin password or two-factor authentication (2FA) does not guarantee immediate recovery of the current situation. The FortiGate must be reachable and connected to FortiGate Cloud for management commands to be successfully delivered. If FortiGate Cloud management was not previously configured, purchasing a subscription afterwards cannot retroactively establish management access while the device remains inaccessible. For more information, see
    Technical Tip: Reset FortiGate admin password via FortiGate Cloud

  4. Last resort: Factory reset or format and restore.
    If none of the above solutions are viable, the final option is to regain administrative access by resetting the FortiGate appliance and restoring a backup configuration from which the FortiToken settings for the affected administrator account have been removed.

    Two recovery methods are available:

    Option 1: Factory reset and restore the configuration

    Reset the FortiGate appliance to factory default settings and restore a modified backup configuration with the FortiToken settings removed from the affected administrator account.

    This method avoids the need to format the appliance and reinstall the firmware. Before proceeding, ensure that a valid configuration backup is available and that the modified configuration is compatible with the FortiGate model and firmware version. For instructions on resetting the FortiGate to factory default settings, refer Technical Tip: How to reset to factory default configuration using external button                                                                         

    Option 2: Flash format and restore the configuration

    If a factory reset is not sufficient or flash formatting and firmware reinstallation are otherwise required, format the appliance and reinstall the FortiGate firmware before restoring a modified backup configuration with the FortiToken settings removed.

    This procedure is more invasive and should only be performed when necessary, with proper planning and caution.

    To remove the FortiToken settings from the configuration file due to a lost token issue, see Troubleshooting Tip: Admin user lost FortiToken / Token is not working.

    For the flash formatting and firmware reinstallation procedure, see Technical Tip: Formatting and loading FortiGate firmware image using TFTP.

 

Recommendation:
High Availability (HA).

If any site is critical and minimal downtime is a priority, Fortinet strongly recommends implementing a High Availability (HA) setup in production environments before proceeding to the last resort.

 

Disclaimer:

Fortinet TAC does not have any super admin credentials and cannot bypass 2FA or password protection; therefore, it is the client's responsibility to follow the recommended steps before enabling MFA on a primary admin account.

  • Token activation grace period:

    There is a three-day period for an administrator to activate the FortiToken for the administrator account. As insurance, a temporary administrator account with super-admin privileges can be created until successful activation of the FortiToken has been achieved and access to it has been tested.

  • Individual admin accounts:

    Always assign separate administrator accounts to each user with elevated privileges. This allows other admins to reverse configurations or regain access if one account becomes inaccessible, regardless of the 2FA method in use.

  • Backup access account:

    Create a privileged admin account that does not use a token but is restricted to access only from trusted internal networks. Use the Restrict logins from trusted hosts (Technical Tip: System administrator best practices for FortiGate and FortiProxy) feature as a fail-safe recovery method.

  • Risk of lockout:

    If the OTP code is not received, the FortiToken is lost, or the mobile device with the FortiToken app is reset, admin users will be locked out of the device.

  • No recovery from Fortinet:

    Fortinet cannot access any device or recover lost 2FA codes under any circumstances. In such cases, a hardware reset is required to regain access. To avoid data loss, ensure regular backup of the device configuration and store it securely. See how to automate backups with Technical Tip: How to send automated backups of the configuration from a FortiGate with an automation stitch, using TFTP/FTP or SFTP Server and a recommendation for configuring a Linux machine

  • Email token delivery tips:

    When using email-based tokens (Email-Token), configure a properly authenticated email account to ensure reliable delivery. See the configuration guide for Office 365: Technical Tip: How to configure the alert-mail settings with Microsoft Office365.

  • Email and token communication requirements:

    FortiGate requires internet access to send token emails, provision FortiTokens, and deliver email tokens. Ensure proper connectivity and DNS settings are in place.

  • NTP synchronization required:

    Even after assigning a token, authentication may fail if the system time is not synchronized. Ensure NTP is properly configured and in sync before assigning the token to an administrator account.

 

Related article:
Technical Tip: Recommendations and common scenarios for Administrator access on FortiGate

    Risk and Resilience in the Age of AI. An OT Thought Leadership Summit for Houston's Critical Infrastructure Leaders. Date: Thursday, December 3, 2026. Time: 8:30 am - 1:30 pm (CT). Location: The Westin Houston, Memorial City | 945 Gessner Road, Houston, TX 77024