πŸ” Copy Data Using Pull Backup Method with SCP (No Password Authentication)

This method is ideal when:

  • You’re backing up a DirectAdmin account to a backup server.
  • Password authentication is disabled on the source server.
  • rsync is not available or not permitted.

In this setup, the backup server pulls data from the source server using scp over SSH with key-based authentication.


🧰 Step 1: Generate SSH Key Pair on the Backup Server

On your backup server, generate a key pair:

ssh-keygen -t rsa -b 4096 -C "[email protected]"
  • Press Enter through all prompts to accept default location (/root/.ssh/id_rsa).
  • Leave the passphrase blank unless you want additional security.

πŸ“€ Step 2: Copy Public Key to Source Server

Copy the contents of /root/.ssh/id_rsa.pub (from the backup server) to the source server.

On the source server (logged in as the user to back up):

mkdir -p ~/.ssh
nano ~/.ssh/authorized_keys
  • Paste the contents of id_rsa.pub into the file.

Set correct permissions:

chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys

πŸ” Step 3: Test SSH Access

From the backup server, test the connection:

ssh [email protected]
  • You should be logged in without entering a password.
  • If prompted for a passphrase, ensure you created the key without one, or use an agent like ssh-agent.

πŸ“¦ Step 4: Pull Backup Data Using SCP

Now, from the backup server, pull the data:

scp -r [email protected]:/home/webuser/backups/* /home/backupuser/backups/

Breakdown:

  • [email protected] β†’ SSH login for the source server.
  • /home/webuser/backups/* β†’ Folder to pull (absolute or relative to home).
  • /home/backupuser/backups/ β†’ Destination directory on the backup server.

βœ… Make sure the destination directory exists on the backup server:

mkdir -p /home/backupuser/backups/

βœ… Summary

This method offers a secure, password-less, and automated way to pull backup data from a source serverβ€”ideal when using cPanel or DirectAdmin or in environments where rsync is disallowed and password logins are blocked.

Scroll to Top