yum -y install rsync
mkdir -p /home/lee/rsync
motd file = /etc/rsyncd.motd
transfer logging = yes
log file = /var/log/rsyncd.log
port = 873
address = 192.168.8.81
uid = nobody
gid = nobody
use chroot = no
read only = yes
max connections = 10
[common]
comment = rsync lee
path = /home/lee/rsync/
ignore errors
auth users = lee
secrets file = /etc/rsyncd.secrets
hosts allow = 192.168.8.0/255.255.255.0
hosts deny = *
list = false
echo "lee:123456" > /etc/rsyncd.secrets
chmod 600 /etc/rsyncd.secrets
echo "rsync lee" > /etc/rsyncd.motd
iptables -I INPUT -p tcp --dport 873 -j ACCEPT
rsync --deamon
echo "rsync --deamon" >> /etc/rc.local
二、客户端(192.168.8.81):
yum -y install rsync
echo "123456" > /root/passwd
chmod 600 /root/passwd
rsync -avz --password-file=/root/passwd lee@192.168.8.81::common /home/lee/rsync/
原文:http://blog.51cto.com/12173069/2069243