VMware Images:
|
Back Up Linux And Windows Systems With BackupPC - Page 4
5.1 Configure The SSH TunnelThe rsync backup will be tunneled through SSH. The backup is run as the user backuppc, therefore this user must be able to login to falko-desktop as root without being prompted for a password. Therefore we must exchange public keys to allow password-less logins for backuppc. First we must log in on falko-desktop on the shell and create a root login (if you don't use Ubuntu you most probably have one already): falko-desktop: sudo passwd root Now that you're logged in as root, install OpenSSH and rsync: falko-desktop: apt-get install rsync ssh openssh-server Then create a private/public key pair: falko-desktop: ssh-keygen -t rsa Generating public/private rsa key pair. If you don't have a DNS record for server1.example.com, you should add server1.example.com to /etc/hosts now: falko-desktop: vi /etc/hosts
Next we create a private/public key pair on server1.example.com. We must do this as the user backuppc! server1.example.com: su backuppc Generating public/private rsa key pair. Then we copy the public key to falko-desktop. Make sure you use falko-desktop's current IP address in the scp command: server1.example.com: cp ~/.ssh/id_rsa.pub ~/.ssh/BackupPC_id_rsa.pub The authenticity of host '192.168.0.213 (192.168.0.213)' can't be established. Next we append backuppc's public key to ~/.ssh/authorized_keys2 on falko-desktop (we do this as root): falko-desktop: cat ~/.ssh/BackupPC_id_rsa.pub >> ~/.ssh/authorized_keys2 If you have a proper DNS record for server1.example.com or added it to falko-desktop's /etc/hosts file, you can now open ~/.ssh/authorized_keys2 and add from="server1.example.com" at the beginning of the file. Thus only server1.example.com can enjoy password-less logins. (If server1.example.com cannot be resolved on falko-desktop, then don't add from="server1.example.com") falko-desktop: vi ~/.ssh/authorized_keys2
Then copy root@falko-desktop's public key to server1.example.com (make sure you use the correct IP address): falko-desktop: scp ~/.ssh/id_rsa.pub root@192.168.0.100:/var/lib/backuppc/.ssh/client_id_rsa.pub The authenticity of host '192.168.0.100 (192.168.0.100)' can't be established. Back on server1.example.com, we append root@falko-desktop's public key to ~/.ssh/known_hosts. Make sure you're still logged in as the user backuppc! server1.example.com: cat ~/.ssh/client_id_rsa.pub >> ~/.ssh/known_hosts Then we switch back to the root user and delete /var/lib/backuppc/.ssh/client_id_rsa.pub: server1.example.com: su Then become backuppc again and change the permissions of the ~/.ssh directory: server1.example.com: su backuppc Do the same on falko-desktop (as root): falko-desktop: chmod -R go-rwx ~/.ssh Then go back to server1.example.com and make sure you're still logged in as backuppc. Run the following test command to see if falko-desktop prompts you for a password. If you did everything right, it shouldn't. (Make sure to use falko-desktop's current IP address!) server1.example.com: ssh -l root 192.168.0.213 whoami The output should simply be root
|



Recent comments
2 hours 13 min ago
6 hours 26 min ago
10 hours 42 min ago
19 hours 25 min ago
21 hours 16 min ago
22 hours 29 min ago
1 day 10 hours ago
1 day 17 hours ago
1 day 18 hours ago
1 day 21 hours ago