服务端配置
[root@server ~]# yum -y install xinetd rsync
[root@server ~]# chkconfig --level 35 xinetd on
[root@server ~]# mkdir /data/rsync
[root@server ~]# vim /etc/xinetd.d/rsync
disable = no
[root@server ~]# vim /etc/rsyncd.srt
user01:password
[root@server ~]# vim /etc/rsyncd.conf
secrets file = /etc/.rsyncd.srt
read only = yes
list = yes
uid = nobody
gid = nobody
[log]
comment = download log
path = /data/rsync
auth users = rsync
host allow = 192.168.0.1 192.168.1.1
auth users = user01
[root@server ~]# chmod 600 /etc/rsyncd.srt
[root@server ~]# iptables -I INPUT 9 -s 192.168.1.1 -p tcp -m state --state NEW -m tcp --dport 873 -j ACCEPT
[root@server ~]# iptables -I INPUT 9 -s 192.168.0.1 -p tcp -m state --state NEW -m tcp --dport 873 -j ACCEPT
[root@server ~]# service xinetd start
客户端配置
[root@client ~]# vim /tmp/rsyncd.pass
[root@client ~]# chmod 600 /tmp/rsyncd.pass
[root@client ~]# rsync -avzP --password-file=/tmp/rsyncd.pass user01@rsyncd.game.com::log/daily/login* /path
本文出自 “勿忘初心” 博客,请务必保留此出处http://winterysea.blog.51cto.com/9677346/1707316
原文:http://winterysea.blog.51cto.com/9677346/1707316