Skip to main content
satoh
Staff
Staff
December 24, 2025

Technical Tip: Enforcing PBKDF2 as hash function for administrator accounts in FortiOS v7.2.11 and later

  • December 24, 2025
  • 2 replies
  • 20703 views
Description

This article describes how to ensure PBKDF2 is used to hash administrator passwords after upgrading FortiOS.

Scope FortiGate v7.2, v7.4, v7.6.
Solution

Starting from FortiOS v7.2.11, 7.4.8, and 7.6.1, the hash function used to securely store firewall administrator credentials in configuration is updated from SHA256 to PBKDF2.


When first upgrading from an earlier version, administrator passwords are still stored as SHA256 hashes until the matching administrator logs in successfully.


Notes:

  • In FortiOS v7.2.10, v7.4.7, v7.6.0, and earlier, the hash function is SHA256.
  • 'SH2' denotes SHA256.
  • 'PB2' denotes PBKDF2.

 

Example configuration after upgrade (FortiOS v7.2.11):

In this example, the built-in administrator 'admin' has already logged in to the firewall successfully, so the associated credential was automatically updated.

 

config system admin

    edit "admin"                                        <----- Default admin.

        set accprofile "super_admin"

        set vdom "root"

        set password ENC PB2Ow+O8B  -----snip-----   <----- PBKDF2.

    next

    edit "test_super_admin"

        set accprofile "super_admin"

        set vdom "root"

        set password ENC SH2aZtOA   -----snip-----    <----- SHA256, same as previous firmware.

    next

    edit "test_prof_admin"

        set accprofile "prof_admin"

        set vdom "root"

        set password ENC SH2r7JR7v  -----snip-----    <----- SHA256, same as previous firmware.

    next

end

To enforce a PBKDF2 hash for all administrators:

  1. Require all administrators to log in to the firewall at least once on the updated firmware version.
  2. Manually update the password of any remaining administrators using a super_admin account.

 

FortiGate # config system admin

FortiGate (admin) # edit test_super_admin

FortiGate (test_super_admin) # set password <new_password>
Please enter current administrator password: ******** <----- Password of logged in administrator.

FortiGate (test_super_admin) # show

 

config system admin

    edit "test_super_admin"

        set accprofile "super_admin"

        set vdom "root"

        set password ENC PB2N/Htll  -----snip-----   <----- PBKDF2.

    next

end

FortiGate (test) # next

FortiGate (admin) # end

 

Note:

For backwards compatibility, by default, the previous SHA256 hashes remain stored in the hidden 'old-password' setting after the password setting is updated to a PBKDF2 hash. The 'old-password' setting is not visible to administrators logged in to the firewall, but can be observed in a configuration backup taken by a super_admin.

 

config system admin

    edit "admin"

        set old-password ENC SH2G6rKGG -----snip-----   <----- SHA256.

        set accprofile "super_admin"

        set vdom "root"

        set password ENC PB2Ow+O8B  -----snip-----   <----- PBKDF2.

    next

...

end

 

To fully remove SH2 hashes stored in old-password, enable the 'login-lockout-upon-weaker-encryption' setting in system password-policy. A warning shows asking the administrator to confirm the configuration change. In FortiOS v7.2.x and v7.4.x, the equivalent setting is 'login-lockout-upon-downgrade'.

 

config system password-policy

set login-lockout-upon-weaker-encryption enable

end
The setting "login-lockout-upon-weaker-encryption" enhances the resistance of stored passwords against brute force attacks.
Once enabled, changing the FortiOS firmware to a version where safer passwords are unsupported will lock out administrative users.
Do you want to continue? (y/n)y

 

Related documents:

New features or enhancements 7.2.11

Enhanced administrator password security 7.6.5

Troubleshooting Tip: Unable to login with local administrator after upgrade from FortiOS v7.2.11 to v7.4.7 and below

    2 replies

    New Member
    June 18, 2026

    Ok but what about this option:

    config system admin
    edit "your_admin_user"
    set password ENC <new_PBKDF2_or_SHA256_hash>
    set old-password ENC <previous_SHA256_hash>
    next
    end

    If an administrator logs in and receives a new password with a hash starting with "PB2" but doesn't change their password, the old hash will remain in the "set old-password" option. Therefore, if the user can export the configuration, it is possible to retrieve the hashes. Therefore, simply logging in after the update won't help.

     

    Matt_B
    Staff & Editor
    Staff & Editor
    June 23, 2026

    Hi cebularz, as noted in the article, to remove the “set old-password” lines, enable “login-lockout-upon-weaker-encryption” or “login-lockout-upon-downgrade” depending on firmware version.

    Note: if you enable the option and downgrade to a version that doesn’t support PBKDF2 hashes, you will be locked out if there are no administrator accounts that never logged in to generate a PBKDF2 hash.

    Is it a bug, is it a feature? It's... not in spec!
    Thought Leadership Security Summit. Outpace New Threats with AI - enhanced defense. Tuesday, Septmeber 15, 8:30 AM - 2:30 PM PT. The Golf Club at Newcastle, WA.
    Fortinet Flag the Hack. Wednesday, August 26, 9:00 AM - 5:00 PM ET, COSM, Atlanta, GA.
    Virtual event | September 2026. SASE summit. The age of autonomous trust. Register here!