|
/Admin/backups/backuppc:
Using rysnc-over-SSH and BackupPC
The goal here, of course, is to protect your login credentials and the data transferred for backup with encryption. The downside, however, is that you must give your backup server the right to SSH into the client being backed up without a password (configured thusly[1]). One must carefully consider the actual security of the backup server, and whether the degraded security of the client being backed-up is acceptable.
Assuming passwordless authentication has been configured, test that everything is setup on both ends to do rysnc-over-SSH by running this command on the backup server:
rsync -avz -e ssh username@client-domain.com:/path/to/testdirectory testing/The contents of testdirectory on the client should be copied to testing on the server. Note that one of the advantages of rysnc-over-SSH is that there *is* no other client-side configuration, other then making sure that SSH and rsync are working on that end, and installing the public key of the backup server to enable passwordless authentication.
If that worked, go ahead and configure BackupPC. First create your /etc/backuppc/client.pl file (borrowed from [2]):
Assuming your client has been added to /etc/hosts as "clienthost", one now just needs to add clienthost to /etc/backuppc/hosts thusly:$Conf{XferMethod} = 'rsync'; $Conf{RsyncClientPath} = '/usr/bin/rsync'; $Conf{RsyncClientCmd} = '$sshPath -q -x -l root $hostIP $rsyncPath $argList+'; $Conf{RsyncClientRestoreCmd} = '$sshPath -q -x -l root $hostIP $rsyncPath $argList+'; $Conf{RsyncShareName} = ['/etc', '/home', '/var/www'];
clienthost 0 backuppcand restart backuppc. Now "client" should show up in BackupPC's list, and you can start the first backup.
Should the client be using a non-standard SSH port, the easiest solution is to use an SSH alias. I have this working with the following:
$ cat .ssh/config
Host olmserver
Hostname olmserver
Port 123
$ cat /etc/hosts | grep olmserver
102.111.120.117 olmserver
$ cat /etc/backuppc/hosts | grep olmserverNote that there is no need to change the backuppc configuration for this to work, or in fact even to change the port of the client SSH server. All of the SSH port configuration is handled by the SSH configuration.
olmserver 0 backuppc
[1] http://blog.langex.net/index.cgi/Admin/SSH-SSL/passwordless-ssh-authentication.html
[2] http://www.howtoforge.com/linux_backuppc_p3
posted at: 10:37 | path: /Admin/backups/backuppc | permanent link to this entry