rsync and unattended ssh syncing 2 machines

Greg Bernard bsd at todoo.biz
Sun Dec 21 07:42:44 PST 2003


Le 21/12/03 1:56, « Brent Bailey » <misterb at bmyster.com> a écrit :

> ive been trying to get rsync to work with  unattended SSH and syncing of
> file systems
> between 2 machines running FBSD 4.9RC. I have rsync installed and i run a
> script like
> 
> #!/bin/sh
> 
> remote="192.168.25.12"
> 
> fslist="/var/mail /var/db/mysql /usr/local/www/data /user2"
> 
>   for fs in $fslist ;
>   do
>     /usr/local/bin/rsync -avz --delete ${remote}:${fs}/ ${fs}/
>   done
> 

You need to specify the -e option (cf man rsync).

/usr/local/bin/rsync -e ssh -avz --delete ${remote}:${fs}/ ${fs}/


If you intent to use It as root you need to set up your ssh server so that
It does not require a password when rsync initiate the connexion.

This can be done in a quite "not so secure manner" by providing an empty
password when you generate the ssh key you will be using. Other more tricky
and safer solutions could be used...

More info and quick setup at this link :

http://killyridols.net/tutorials/rsyncssh.html


Good luck... Once It works, It works steadily and for long !

> but when i tail the logs of the remote machine i see..
> Dec 20 19:23:26 doppleganger sshd[24493]: Failed password for root from
> 192.168.25.1 port 4476
> 
> Anyone have any good luck with doing this ? suggestions ?? any all all
> help is greatly appreciated
> 
> 
> 
> -- 
> Brent
> 

________________________________________________
«?»¥«?»§«?»¥«?»§«?»¥«?»§«?»¥«?»§«?»¥«?»§«?»¥«?»§
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Gregober ---> PGP ID --> 0x1BA3C2FD
omni_osx_ml @at@ todoo.biz
________________________________________________
«?»¥«?»§«?»¥«?»§«?»¥«?»§«?»¥«?»§«?»¥«?»§«?»¥«?»§
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯




More information about the freebsd-questions mailing list