Settle a problem:66
This document provides a comprehensive, validated procedure for configuring automated backups from a Cisco Firepower Management Center (FMC) to a remote server using SSH key-pair authentication. The objective is to establish a secure, passwordless mechanism suitable for automation, addressing the common requirement to replace password-based authentication for scheduled backup tasks. The solution details the generation of SSH keys, configuration of the remote backup server, and the specific steps required within the FMC graphical user interface (GUI) and command-line interface (CLI) to implement and verify this functionality.
The core technical challenge is automating FMC backups to a remote Linux/Unix-based server using Secure Copy (SCP) or Secure File Transfer Protocol (SFTP) without manual password entry. While the FMC backup utility supports these protocols, its native configuration for automated jobs requires a secure and persistent authentication method. Standard password authentication is less secure and problematic for automation. The required solution is to leverage public/private SSH key-pair authentication, where the FMC can authenticate to the backup server automatically using its private key. The initial steps involve generating the key pair and placing the public key on the server, but the critical, FMC-specific part of the process is correctly uploading the private key to the FMC and associating it with the backup operation.
Before proceeding with the configuration, ensure the following prerequisites are met:
fmcbackup). This user must have write permissions to the target backup directory.This procedure is divided into four stages: key generation, server-side configuration, FMC configuration, and verification.
On a secure workstation or the backup server itself, generate a new SSH key pair. It is best practice to use a strong key algorithm and length.
Open a terminal session.
Execute the ssh-keygen command. We recommend using RSA with a 4096-bit length for enhanced security.
ssh-keygen -t rsa -b 4096 -f ~/.ssh/fmc_backup_key
When prompted for a passphrase, press Enter twice to leave it blank. A passphrase-protected key cannot be used for passwordless automation.
This command creates two files:
fmc_backup_key (the private key)fmc_backup_key.pub (the public key)Configure the backup server to trust the public key for the designated backup user.
Log in to the remote backup server as the backup user (e.g., fmcbackup).
Create the .ssh directory if it does not exist and set the correct permissions to ensure security.
mkdir -p ~/.ssh
chmod 700 ~/.ssh
Append the content of the public key (fmc_backup_key.pub) to the authorized_keys file.
cat /path/to/fmc_backup_key.pub >> ~/.ssh/authorized_keys
Set strict permissions on the authorized_keys file. Incorrect permissions will cause SSH key authentication to fail.
chmod 600 ~/.ssh/authorized_keys
Upload the private key to the FMC and configure the backup profile.
Upload the Private Key:
fmc_backup_key) generated in step 4.1.Configure the Backup Profile:
22 (or your custom port).fmcbackup)./backups/fmc).It is critical to verify the connection from the FMC before relying on the scheduled job.
Use SSH to log in to the FMC’s command-line interface (CLI) as admin.
Enter expert mode to access the underlying Linux shell: > expert
Manually test the SCP or SSH connection to the backup server to confirm the key authentication is working correctly.
ssh -i /etc/ssh/ssh_host_rsa_key <backup_user>@<backup_server_ip>
Note: The FMC stores the uploaded private key as /etc/ssh/ssh_host_rsa_key. You should receive a successful login without a password prompt.
If the connection fails, verify file permissions on the server, check for firewall blocks, and ensure the correct private key was uploaded to the FMC.
By following this detailed procedure, you can successfully configure a secure, reliable, and automated backup solution for the Firepower Management Center using SSH key-pair authentication. This method eliminates the security risks and operational inefficiencies associated with storing and using passwords for scheduled tasks, aligning with industry best practices for system administration.