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.
- 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.
- Configure auto login for the root user:
- Install OpenSSH and rsync on the client:
- apt-get install rsync ssh openssh-server
- Then create a private/public key pair on the client:
- 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 root@clientpc:/root/.ssh/
- 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
- Then copy the new clients public key to the server (do this as root on the new client):
scp ~/.ssh/id_rsa.pub root@ServerIP:/var/lib/backuppc/.ssh/client_id_rsa.pub
- Back on the server, append root@clientPC 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
- 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
- Then become backuppc again and change the permissions of the ~/.ssh directory:
su - backuppc
chmod -R go-rwx ~/.ssh
- Do the same on the new client (as root):
chmod -R go-rwx ~/.ssh
- 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
- 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.
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: