Skip to main content
pginete
Staff
Staff
Dec 14, 2021 12:27 AM UTC

How to change the admin password on the FortiGate for the managed FortiSwitch

  • Oct 27, 2026 8:59 AM UTC
  • 0 replies
  • 31617 views
  • Translate All

Description

How to change the admin password on the FortiGate for managed FortiSwitch units.

Scope

FortiGate, FortiSwitch.

Solution

By default, each FortiSwitch has an admin account without a password.
To replace the admin passwords for all FortiSwitch units managed by a FortiGate, use the following commands from the FortiGate CLI:

 

config switch-controller switch-profile
    edit default
        set login-passwd-override enable
        set login-passwd <password>
    next
end


If there was already a profile applied with the override enabled and the password set, and if it is necessary to remove the admin password, apply a profile with the override enabled and no password set; otherwise, the previously set password will remain in the FortiSwitch.

 

For example:

 

config switch-controller switch-profile
    edit default
        set login-passwd-override enable
        unset login-passwd
    next
end


Note:

Starting with FortiOS 7.4.6 and FortiOS 7.6.1, empty passwords are no longer allowed.
The FortiGate will generate an admin password for switches without one during authorization.
For more information, see Whatʼs new in FortiOS 7.4.6.


If it is necessary to change the password for only one switch, avoid using the default profile: by default, it applies to all of the switches in the configuration. Verify which switch-profile is applied to which switch by using the following commands:

 

config switch-controller managed-switch
    edit "S248EFTFxxxxxxxx"
        get | grep switch-profile


To change the admin password for a specific switch:

1. Configure the switch-profile:

config switch-controller switch-profile
    edit "New-profile"
        set login-passwd-override enable
        set login-passwd <password>
    next
end


2. Apply the switch-profile to the specific switch:


config switch-controller managed-switch
    edit "S248EFTFxxxxxxxx"
        set switch-profile "New-profile"
    next
end

    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