This article explains how to integrate FortiGate with FortiCloud account from the CLI in case of issues with GUI (that is, GUI is inaccessible or the FortiCloud account has a long password).
FortiGate and FortiCloud.
From a console or SSH connection, run the following command:
execute fortiguard-log login <email> <password> <domain>
Domain can be Global/US/Europe
When trying to change a FortiCloud user from a previous account to a newer account, the below error appears.
"Failed: FGT internal error(-1)
Command fail. Return code 5"
Clearing the service-account-id on the FortiGate may resolve this issue.
config system fortiguard
The following commands will enable debug logging for troubleshooting.
diagnose debug cons time-stamp enable
diagnose debug application forticldd -1
diagnose debug enable
To disable debug logging run the following commands.
diagnose debug reset diagnose debug disable
The commands # execute 'fortiguard-log' login and 'unset service-account-id' are hidden commands and must be manually typed in. The auto-complete feature will not work for those.