Configure Linux client for BackupPC

Instructions to add a linux client to an existing BackupPC installation. These are also good instructions for allowing automatic login from another PC. The full how-to can be found at HowToForge.

  1. Log into BackupPC with backuppc user at http://ServerIP/backuppc. Click the link to “Edit Hosts” and add the hostname of the new client. Add the users who need access to the backups.
  2. Configure auto login for the root user:
  3. Install OpenSSH and rsync on the client:
  4. apt-get install rsync ssh openssh-server
  5. Then create a private/public key pair on the client:
  6. ssh-keygen -t rsa

    Generating public/private rsa key pair.
    Enter file in which to save the key (/root/.ssh/id_rsa): <--
    Created directory '/root/.ssh'.
    Enter passphrase (empty for no passphrase): <--
    Enter same passphrase again: <--
    Your identification has been saved in /root/.ssh/id_rsa.
    Your public key has been saved in /root/.ssh/id_rsa.pub.
    The key fingerprint is:
    0f:95:00:4b:fd:c3:cc:0b:1f:2b:00:c9:29:bf:ca:4e [email protected]

  7. Then we copy the already created server public key to the new client (This must be done as the backuppc user):

    scp ~/.ssh/BackupPC_id_rsa.pub [email protected]:/root/.ssh/
  8. Next we append backuppc’s public key to ~/.ssh/authorized_keys2 on the client PC (we do this as root on the new client):

    cat ~/.ssh/BackupPC_id_rsa.pub >> ~/.ssh/authorized_keys2
  9. Then copy the new clients public key to the server (do this as root on the new client):

    scp ~/.ssh/id_rsa.pub [email protected]:/var/lib/backuppc/.ssh/client_id_rsa.pub
  10. Back on the server, append [email protected] public key to ~/.ssh/known_hosts. Make sure you’re still logged in as the user backuppc!

    cat ~/.ssh/client_id_rsa.pub >> ~/.ssh/known_hosts
  11. Switch back to the root user on the server and delete /var/lib/backuppc/.ssh/client_id_rsa.pub:

    rm -f /var/lib/backuppc/.ssh/client_id_rsa.pub
  12. Then become backuppc again and change the permissions of the ~/.ssh directory:

    su - backuppc
    chmod -R go-rwx ~/.ssh
  13. Do the same on the new client (as root):

    chmod -R go-rwx ~/.ssh
  14. Then go back to the server and make sure you’re still logged in as backuppc. Run the following test command to see if the new client prompts you for a password. If you did everything right, it shouldn’t.

    ssh -l root ClientPC whoami

    The output should simply be

    root
  15. The new client is now ready to be backed up, and will start a backup at the next backup window using the default configuration if it is not changed before then.

Leave a Reply