Created on
03-01-2024
10:07 AM
Edited on
04-29-2025
07:12 AM
By
Jean-Philippe_P
Description | This article describes several troubleshooting methods that can be followed when experiencing SFTP configuration backup issues in FortiGate. |
Scope | FortiGate. |
Solution |
Since v7.0.1, administrators now have the option to backup the configuration file using SFTP.
When performing a manual SFTP backup config from the FortiGate CLI or when using the same command through a CLI script in an automation stitch fail, it is recommended to check the items listed in this article.
Example error for an unsuccessful backup attempt from FortiGate CLI due to wrong credentials:
The same error will show up for connectivity issues between FortiGate and the SFTP server, and if the users have insufficient privileges.
execute telnet <IP address or domain name> <SFTP port#>
If the SFTP server cannot be reached by telnet, check the following:
get router info routing-table details <SFTP IP address>
diagnose sniff packet any 'host <SFTP IP address> and port <SFTP port#>' 4 0 l
Simulate the traffic.
execute backup config sftp </directory/filename> <SFTP server>[<:SFTP port>] <username> <password>
Below is an example of CLI output for a successful attempt to create an SFTP configuration backup. The default SFTP port number is TCP port 22.
Here are two scenarios where a non-root user 'testpau6' is being utilized for the SFTP configuration backup:
Scenario A: User 'testpau6' serves as the owner of the /home/testpau6 directory. User permission for the /home/testpau6 directory is 'rwx', so the user 'testpau6' can successfully send backup config in that particular directory.
Successful backup of fgt.conf in the /home/testpau6 directory:
Scenario B: User 'testpau6' was added to the 'root' user group. user 'root' serves as the owner of the /backup directory and is also part of the 'root' user group. Group permission for the /backup directory is 'rwx', so the user 'testpau' can successfully send the backup config to that particular directory.
Adding user 'testpau' to the 'root' user group:
Successful backup of fgt.conf in the /backup directory:
Output without the full backup path:
execute backup full-config sftp FortigateBackup/test_backup.conf 10.10.10.1:3597 TestUser <password>
Output with the full backup path:
execute backup full-config sftp /share/CACHEDEV1_DATA/FortigateBackup/test_backup.conf 10.10.10.1:3597 TestUser <password> Send config file to sftp server OK.
In some scenarios, backing up the configuration via SFTP with multiple available paths in the routing table may work through the CLI, however, it can fail with an error when executed through an automation stitch.
Note: FTP backup works without referencing the complete directory path but for SFTP/TFTP backup it would require the full path or it could have some issue connecting.
Refer to the below article for SFTP Backup via the IPsec site-to-site VPN: Technical Tip: Configure automation backup over IPsec-tunnel.
Related articles: Technical Tip: Backup of configuration file from CLI using FTP Technical Tip: Automated configuration backups with variable names based on the date |
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2025 Fortinet, Inc. All Rights Reserved.