[TriLUG] how-to: preshare ssh key
Ron Joffe
rjoffe at yahoo.com
Tue Jun 3 14:14:52 EDT 2008
On Tuesday 03 June 2008 14:02, Warren Myers wrote:
> Ron - the rsyncd man pages don't look exactly the clearest, so I'm going to
> ask:
>
> My specific problem is that I have a master repository of content that may
> or may not be updated, but must be replicated from a parent server to too
> child servers if it is updated.
>
> If the repository *is* updated, new data will be on the order of gigabytes
> (these are os images).
>
> If using rsync in daemon mode makes sense, I will definitely need some
> assistance as I've only ever been on the receiving end of rsyncs in the
> past (I'm a mirror for m0n0wall).
>
> Thanks,
> WMM
Simple example:
Server A is the source
Server B is the mirror
1. On server B edit the rsyncd config file (/etc/rsyncd.conf)
Here is an example of a single directory being syncd:
uid = root
gid = root
use chroot = yes
transfer logging = true
log format = %h %o %f %l %b
log file = /var/log/rsyncd.log
pid file = /var/run/rsyncd.pid
[data]
path = /data/
read only = false
hosts allow = xxx.xxx.xxx.xxx
The hosts allow would be the ip address from server A
The path would be wherever the root directory of your repository
Please read the man pages to understand each line from this file and the
security implications. This is just a simple example
2. Start up rsyncd on your server B (my systems "/etc/init.d/rsyncd start")
Make sure your firewall is not blocking your rsyncd port (873)
3. Then on server A, you can schedule a cron job that does the following:
rsync -Pazuvq --delete /data/ B::data/
This will sync the directories /data (and everything below)
Notice the :: which specifies to use the rsyncd port
Please read the pages on the options I have specified above.
That should be all it takes.
This can also be turned around such that rsync is running on Server A, and the
rsync command is executed from server B.
Let me know how it works!
Ron
More information about the TriLUG
mailing list