BackupPC-users

Re: [BackupPC-users] sshd on client?

2008-12-27 07:13:46
Subject: Re: [BackupPC-users] sshd on client?
From: Timothy Murphy <gayleard AT eircom DOT net>
To: backuppc-users AT lists.sourceforge DOT net
Date: Sat, 27 Dec 2008 12:11:09 +0000
Les Mikesell wrote:


>> In my case the only change on the clients
>> is to specify the directories I want to backup,
>> and the only change on the server is to specify which machines
>> are allowed to access it.
>> 
>> The rest is setting up ssh to work as root on the clients,
>> and this requires 3 steps:
>> 1. ssh-keygen as root on the client
>> 2. scp .ssh/id_rsa.pub from /root on the client to the server
>>    and append to ~backuppc/.ssh/authorized_keys .
> 
> You have that backwards.  The private side of the key pair belongs in
> the .ssh directory under the home of the originator of the command.  The
> public part is appended to the authorized_keys or authorized_keys2 file
> in the .ssh directory under the home of the target of the command.  The
> remote side is going to use the public key to make sure that the
> originator can read the private key on the originating system before
> continuing.

This seems to me rather important.
Are you saying that my setup is wrong?
I find your account with "orginator" and "target" difficult to follow,
like most of the BackupPC documentation and tutorials.

As far as I am concerned, there is a BackupPC server,
which is the machine backuppc (and httpd) is running on,
and there are clients, which are the machines I am backing up.

I'm only interested at this moment in how ssh is used
in conjunction with BackupPC.

Assuming that BackupPC is set up and running on the server,
this is what I do to add a client to the BackupPC system.

1. Start sshd running on the client:
        $ sudo service sshd restart
        $ sudo chkconfig sshd on

2. Set up ssh as root on the client
        $ su
        $ Password:
        # ssh-keygen
        ...

3. Copy root's public key from the client to the server
        # cd
        # cd .ssh
        # scp id_rsa.pub helen:/tmp/
["helen" is my server.]

4. On the server, copy the key to ~backuppc 
        $ sudo su -c /bin/sh backuppc
        $ cd
        $ cd .ssh
        $ cat /tmp/id_rsa.pub >> authorized_keys

5. Check that all is working by running (still as backuppc on the server)
        $ ssh -l root mary
["mary" is the client.]

6. Browse to http://helen/BackupPC, click on Server=>Edit Hosts
and add the client to the list, with backuppc as user .
Click on Save .

7. Click on "Select a host..." and choose the new client, "mary".
Click on mary=>Edit Config .
Click on Xfer .
Go to RsyncShareName , check Override and change /
to the directory you want to backup, eg /home/tim/Public/ .
Click on Save.

8. Test if it works by clicking on Server=>Host Summary
Click on the new client, "mary".
Click on "Start Full Backup" and confirm this.
Click on mary=>LOG file to make sure this has worked.



-- 
Timothy Murphy  
e-mail: gayleard /at/ eircom.net
tel: +353-86-2336090, +353-1-2842366
s-mail: School of Mathematics, Trinity College, Dublin 2, Ireland


------------------------------------------------------------------------------
_______________________________________________
BackupPC-users mailing list
BackupPC-users AT lists.sourceforge DOT net
List:    https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:    http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/