Locked Out of Admin GUI¶
Symptom: can't log into the FortiGate admin GUI. Wrong password, forgotten password, account locked, Trusted Hosts blocking you, MFA broken, or the admin user got deleted.
Diagnose Path¶
Forgot password but still know username¶
Use console access:
- Console cable to FortiGate.
- At login prompt:
<username>then<password>. If you remember EVEN ONE valid admin, log in and reset. - If no valid creds at all → see Maintenance Mode below.
Account locked from failed attempts¶
Wait the lockout window (default 60 sec) and try again, OR unlock via another admin:
diagnose user banned-ip clear
Trusted Hosts blocking you¶
Your IP isn't in the admin user's Trusted Hosts. Use console or another admin to fix:
config system admin
edit <username>
set trusthost1 <your-current-ip>/32
next
end
MFA broken (lost phone, etc.)¶
Console in as another admin and disable MFA for the user, OR use a backup recovery code if you stored one.
config system admin
edit <username>
set two-factor disable
next
end
Maintenance Mode (last resort — no admin creds at all)¶
This is the FortiGate's "factory reset" via boot menu. Wipes config but lets you back in.
- Console cable in.
- Power-cycle.
- Press any key when boot prompt appears.
- Choose Format boot device OR TFTP firmware load — both wipe to fresh state.
- After reboot, log in as
adminwith blank password (factory defaults). - Restore config from backup if you have one — but only the parts you need, NOT the admin accounts.
Recover the original admin password via backup (without wiping config)¶
If you have a recent config backup:
- Boot the FortiGate to factory defaults (Maintenance Mode).
- Restore the config — but BEFORE restoring, edit the backup file to remove the
config system adminblock, OR replace the admin password hash. - Boot with the restored partial config + fresh admin.
This requires understanding the FortiOS config format. Easier: just factory reset and rebuild.
Hardcoded Maintenance Account (if enabled)¶
Some models support a hardcoded maintainer account at console — useful for "I lost the admin password" recovery. Requires:
- Console cable access.
- Knowing the serial number.
- Specific timing window after boot.
Procedure:
- Reboot FortiGate.
- At login prompt, login as
maintainer. - Password:
bcpb<serial-number>(case-sensitive). - You're in with full access.
Note: maintainer access can be disabled by config; if disabled, this won't work. If you NEED maintenance recovery in your environment, ensure set admin-maintainer is enabled.