📘Backup & Restore Data to/from Remote Backup Server (with SSH Key Authentication)

This guide shows how to securely transfer data between a production server and a Remote Backup Server using rsync over SSH. It includes examples for both password-based and SSH key-based authentication, as well as JetBackup snapshot transfers.


🔐 Prerequisites for SSH Key Authentication

  1. Generate an SSH Key (if not already done): ssh-keygen -t rsa -b 4096
  2. Upload the public key (~/.ssh/id_rsa.pub) to your Remote Backup Server.
  3. Ensure your private key (~/.ssh/id_rsa) is accessible to the user initiating the rsync.

🔁 Backup: Production ➝ Remote Backup Server (with SSH Key)

rsync -av --progress -e "ssh -i ~/.ssh/id_rsa -p 36256" /home/example c14ssh@f032ab59-8612-4f98-b5c6-d86965f1da43.buffer.c14.io:/buffer/example

🔁 Restore: Remote Backup Server ➝ Production (with SSH Key)

rsync -av --progress -e "ssh -i ~/.ssh/id_rsa -p 36256" c14ssh@f032ab59-8612-4f98-b5c6-d86965f1da43.buffer.c14.io:/buffer/example /home/example

📦 Backup JetBackup Snapshots (From within cPanel account, with SSH Key)

rsync -avR --progress -e "ssh -i ~/.ssh/id_rsa -p 45311" ./jetbackup_1_1_5c732966bdf5a655e55542e2/*/snap.2019-03-18* c14ssh@8183fc0d-07ff-4eea-83ca-8d654b263671.buffer.c14.io:/buffer

📥 Restore JetBackup Snapshots from Remote Backup Server (with SSH Key)

rsync -av --progress -e "ssh -i ~/.ssh/id_rsa -p 36256" c14ssh@f032ab59-8612-4f98-b5c6-d86965f1da43.buffer.c14.io:/buffer/example /home/example

📝 Notes

  • Replace ~/.ssh/id_rsa with the path to your actual private key file if it’s different.
  • Ensure correct file/directory permissions on the SSH key (typically chmod 600).
  • Avoid using root access unless necessary—non-root users can be configured appropriately.
  • The --progress flag helps monitor transfers, especially over slower links.
Scroll to Top