Fortinet black logo

CLI Reference

api-user

api-user

Generate keys for API users.

execute api-user generate-key  Generate key for API users.
        {name}   API user name.

Variable Description
config flash <comment> Back up the system configuration to the flash disk. Optionally, include a comment.
config ftp <filename_str> <server_ipv4[:port_int] | server_fqdn[:port_int]> [<username_str> [<password_str>]] [<backup_password_str>] Back up the system configuration to an FTP server.

Optionally, you can specify a password to protect the saved data.
config management-station <comment_str> Back up the system configuration to a configured management station. If you are adding a comment, do not add spaces, underscore characters (_), or quotation marks (“ “) or any other punctuation marks.

The comment you enter displays in both the portal website and FortiGate web-based manager (System > Maintenance > Revision).
config tftp <filename_str> <server_ipv4> [<backup_password_str>] Back up the system configuration to a file on a TFTP server. Optionally, you can specify a password to protect the saved data.
config usb <filename_str> [<backup_password_str>] Back up the system configuration to a file on a USB disk. Optionally, you can specify a password to protect the saved data.
config usb-mode [<backup_password_str>] Back up the system configuration to a USB disk (Global admin only). Optionally, you can specify a password to protect the saved data.
config-with-forticlient-info ftp <filename_str> <server_ipv4[:port_int] | server_fqdn[:port_int]> [<username_str> [<password_str>]] [<backup_password_str>] Back up the system configuration to a file on an FTP server. Optionally, you can specify a password to protect the saved data.
config-with-forticlient-info tftp <filename_str> <server_ipv4> [<backup_password_str>] Back up the system configuration to a file on a TFTP server. Optionally, you can specify a password to protect the saved data.
config-with-forticlient-info usb [<backup_password_str>] Back up the system configuration to a file on a USB disk. Optionally, you can specify a password to protect the saved data.
config-with-forticlient-info usb-mode [<backup_password_str>] Back up the system configuration to a USB disk (Global admin only). Optionally, you can specify a password to protect the saved data.
full-config ftp <filename_str> <server_ipv4[:port_int] | server_fqdn[:port_int]> [<username_str> [<password_str>]] [<backup_password_str>] Back up the full system configuration to a file on an FTP server. You can optionally specify a password to protect the saved data.
full-config tftp <filename_str> <server_ipv4> [<backup_password_str>] Back up the full system configuration to a file on a TFTP server. You can optionally specify a password to protect the saved data.
full-config usb <filename_str> [<backup_password_str>] Back up the full system configuration to a file on a USB disk. You can optionally specify a password to protect the saved data.
full-config usb-mode <filename_str> [<backup_password_str>] Back up the full system configuration to a file on a USB disk (Global admin only). You can optionally specify a password to protect the saved data.
ipsuserdefsig ftp <filename_str> <server_ipv4[:port_int] | server_fqdn[:port_int]> [<username_str> [<password_str>]] Backup IPS user-defined signatures to a file on an FTP server.
ipsuserdefsig tftp tftp <filename_str> <server_ipv4> Back up IPS user-defined signatures to a file on a TFTP server.
{disk | memory} alllogs ftp <server_ipv4[:port_int] | server_fqdn[:port_int]> [<username_str> <password_str>] Back up either all memory or all hard disk log files for this VDOM to an FTP server. The disk option is available on FortiGate models that log to a hard disk.

The file name has the form: <log_file_name>_<VDOM>_<date>_<time>
{disk | memory} alllogs tftp <server_ipv4> Back up either all memory or all hard disk log files for this VDOM to a TFTP server. he disk option is available on FortiGate models that log to a hard disk.

The file name has the form: <log_file_name>_<VDOM>_<date>_<time>
{disk | memory} alllogs usb Back up either all memory or all hard disk log files for this VDOM to a USB disk. he disk option is available on FortiGate models that log to a hard disk.
The file name has the form: <log_file_name>_<VDOM>_<date>_<time>
{disk | memory} log ftp <server_ipv4[:port_int] | server_fqdn[:port_int]> <username_str> <password_str> {traffic | event | ids | virus | webfilter | spam | dlp | voip | app‑ctrl | netscan} Back up the specified type of log file from either hard disk or memory to an FTP server.

The disk option is available on FortiGate models that log to a hard disk.
{disk | memory} log tftp <server_ipv4> {traffic | event | ids | virus | webfilter | spam | dlp | voip | app‑ctrl | netscan} Back up the specified type of log file from either hard disk or memory to a TFTP server.

The disk option is available on FortiGate models that log to a hard disk.
{disk | memory} log usb {traffic | event | ids | virus | webfilter | spam | dlp | voip | app‑ctrl | netscan} Back up the specified type of log file from either hard disk or memory to a USB disk.

The disk option is available on FortiGate models that log to a hard disk.

Example

This example shows how to backup the FortiGate unit system configuration to a file named fgt.cfg on a TFTP server at IP address 192.168.1.23.

execute backup config tftp fgt.cfg 192.168.1.23

api-user

Generate keys for API users.

execute api-user generate-key  Generate key for API users.
        {name}   API user name.

Variable Description
config flash <comment> Back up the system configuration to the flash disk. Optionally, include a comment.
config ftp <filename_str> <server_ipv4[:port_int] | server_fqdn[:port_int]> [<username_str> [<password_str>]] [<backup_password_str>] Back up the system configuration to an FTP server.

Optionally, you can specify a password to protect the saved data.
config management-station <comment_str> Back up the system configuration to a configured management station. If you are adding a comment, do not add spaces, underscore characters (_), or quotation marks (“ “) or any other punctuation marks.

The comment you enter displays in both the portal website and FortiGate web-based manager (System > Maintenance > Revision).
config tftp <filename_str> <server_ipv4> [<backup_password_str>] Back up the system configuration to a file on a TFTP server. Optionally, you can specify a password to protect the saved data.
config usb <filename_str> [<backup_password_str>] Back up the system configuration to a file on a USB disk. Optionally, you can specify a password to protect the saved data.
config usb-mode [<backup_password_str>] Back up the system configuration to a USB disk (Global admin only). Optionally, you can specify a password to protect the saved data.
config-with-forticlient-info ftp <filename_str> <server_ipv4[:port_int] | server_fqdn[:port_int]> [<username_str> [<password_str>]] [<backup_password_str>] Back up the system configuration to a file on an FTP server. Optionally, you can specify a password to protect the saved data.
config-with-forticlient-info tftp <filename_str> <server_ipv4> [<backup_password_str>] Back up the system configuration to a file on a TFTP server. Optionally, you can specify a password to protect the saved data.
config-with-forticlient-info usb [<backup_password_str>] Back up the system configuration to a file on a USB disk. Optionally, you can specify a password to protect the saved data.
config-with-forticlient-info usb-mode [<backup_password_str>] Back up the system configuration to a USB disk (Global admin only). Optionally, you can specify a password to protect the saved data.
full-config ftp <filename_str> <server_ipv4[:port_int] | server_fqdn[:port_int]> [<username_str> [<password_str>]] [<backup_password_str>] Back up the full system configuration to a file on an FTP server. You can optionally specify a password to protect the saved data.
full-config tftp <filename_str> <server_ipv4> [<backup_password_str>] Back up the full system configuration to a file on a TFTP server. You can optionally specify a password to protect the saved data.
full-config usb <filename_str> [<backup_password_str>] Back up the full system configuration to a file on a USB disk. You can optionally specify a password to protect the saved data.
full-config usb-mode <filename_str> [<backup_password_str>] Back up the full system configuration to a file on a USB disk (Global admin only). You can optionally specify a password to protect the saved data.
ipsuserdefsig ftp <filename_str> <server_ipv4[:port_int] | server_fqdn[:port_int]> [<username_str> [<password_str>]] Backup IPS user-defined signatures to a file on an FTP server.
ipsuserdefsig tftp tftp <filename_str> <server_ipv4> Back up IPS user-defined signatures to a file on a TFTP server.
{disk | memory} alllogs ftp <server_ipv4[:port_int] | server_fqdn[:port_int]> [<username_str> <password_str>] Back up either all memory or all hard disk log files for this VDOM to an FTP server. The disk option is available on FortiGate models that log to a hard disk.

The file name has the form: <log_file_name>_<VDOM>_<date>_<time>
{disk | memory} alllogs tftp <server_ipv4> Back up either all memory or all hard disk log files for this VDOM to a TFTP server. he disk option is available on FortiGate models that log to a hard disk.

The file name has the form: <log_file_name>_<VDOM>_<date>_<time>
{disk | memory} alllogs usb Back up either all memory or all hard disk log files for this VDOM to a USB disk. he disk option is available on FortiGate models that log to a hard disk.
The file name has the form: <log_file_name>_<VDOM>_<date>_<time>
{disk | memory} log ftp <server_ipv4[:port_int] | server_fqdn[:port_int]> <username_str> <password_str> {traffic | event | ids | virus | webfilter | spam | dlp | voip | app‑ctrl | netscan} Back up the specified type of log file from either hard disk or memory to an FTP server.

The disk option is available on FortiGate models that log to a hard disk.
{disk | memory} log tftp <server_ipv4> {traffic | event | ids | virus | webfilter | spam | dlp | voip | app‑ctrl | netscan} Back up the specified type of log file from either hard disk or memory to a TFTP server.

The disk option is available on FortiGate models that log to a hard disk.
{disk | memory} log usb {traffic | event | ids | virus | webfilter | spam | dlp | voip | app‑ctrl | netscan} Back up the specified type of log file from either hard disk or memory to a USB disk.

The disk option is available on FortiGate models that log to a hard disk.

Example

This example shows how to backup the FortiGate unit system configuration to a file named fgt.cfg on a TFTP server at IP address 192.168.1.23.

execute backup config tftp fgt.cfg 192.168.1.23