Skip to content

Instantly share code, notes, and snippets.

View djonko's full-sized avatar
🏠
Working from home

djonko djonko

🏠
Working from home
  • @Intact_lab
  • Canada
View GitHub Profile
# In Diagnostics > Command Prompt, run:
mkdir -p /root/.ssh # Create a .ssh folder for the pfSense root user
ssh-keygen -t rsa -q -b 2048 -N "" -f /root/.ssh/id_rsa # Generate a public/private key pair for pfSense
cat /root/.ssh/id_rsa.pub # Get pfSense's public key for adding to the remote server
ssh -oStrictHostKeyChecking=no user@example.com # Add the remote host's host key to pfsense's "known_hosts" file
# Run this command in Diagnostics > Command Prompt
# and if it succeeds, add it as a cron job in Services > Cron
/usr/bin/scp -i /root/.ssh/id_rsa /cf/conf/config.xml user@backup.example.com:~/config-`date +\%Y-\%m-\%d`.xml 2>&1 | /usr/bin/logger -t config-backup