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.

Server-Side:
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/laptop2.pub [LAPTOPUSER]@192.168.0.11:~/

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

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

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

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

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

Schreibe einen Kommentar »

Es gibt noch keine Kommentare.

RSS feed for comments on this post. TrackBack URI

Schreibe einen Kommentar

Trage deine Daten unten ein oder klicke ein Icon um dich einzuloggen:

WordPress.com-Logo

Du kommentierst mit Deinem WordPress.com-Konto. Abmelden / Ändern )

Twitter-Bild

Du kommentierst mit Deinem Twitter-Konto. Abmelden / Ändern )

Facebook-Foto

Du kommentierst mit Deinem Facebook-Konto. Abmelden / Ändern )

Google+ Foto

Du kommentierst mit Deinem Google+-Konto. Abmelden / Ändern )

Verbinde mit %s

Bloggen auf WordPress.com.

%d Bloggern gefällt das: