Dedors’s Weblog

19. Juli 2008

Howto: rsync SSH Configuration for backuppc

Filed under: Linux — dedors @ 00:32
Tags: , , ,

It’s a little diffrent from normal SSH connection, so i post it as stand-alone howto. I use here [LAPTOPUSER] as client username, and has to be replaced in the commands.

Generate a public/private key on the server machine in /home/backuppc/.ssh/laptop & Generate a public/private key on the client machine in /home/$USER/.ssh/laptop. Replace [LAPTOPUSER]

sudo su backuppc
cd ~
ssh-keygen -t dsa -f ~/.ssh/laptop2
scp ~/.ssh/ [LAPTOPUSER]@

Create the folder ‘.ssh’ if it doesn’t exist and configure the public key to OpenSSH’s liking. Replace [LAPTOPUSER]

if [ ! -d .ssh ]; then mkdir .ssh ; chmod 700 .ssh ; fi ; mv .ssh/ ; cd .ssh/ ; if [ ! -f authorized_keys ]; then touch authorized_keys ; chmod 600 authorized_keys ; fi ; cat >> authorized_keys ; rm;

Test if you can connect without being prompted for a password, but you should have to enter the passphrase

ssh -i ~/.ssh/laptop2 [LAPTOPUSER]@

Manually Rsync via SSH

rsync -avrz   $USER@laptop:/home/$USER/ -i ~/.ssh/laptop2

Now you need the ssh-agent,

ssh-add laptop2

but you will propably get the following error (with user backuppc):

Could not open a connection to your authentication agent.

then just use this command:

eval `ssh-agent`

Edit backuppc settings:

type: rsync
rsyncclientcmd: replace root with [LAPTOPUSERNAME] and add -i ~/.ssh/laptop2

that should work and backup with your clients username


Erstelle eine kostenlose Website oder Blog – auf