1.首先关闭iptables,和selinux(很大原因就是selinux造成的)
2.服务器配置
/etc/rsyncd.conf
uid=0
gid=0
use chroot=no
pid file=/var/run/rsyncd.pid
lock file=/var/run/rsync.lock
log file=/var/log/rsyncd.log
[data1]
path = /data1
read only = false
hosts allow = 192.168.200.157
auth users=abc#这个是虚拟用户,与系统用户,和普通用户无关
secrets file=/etc/rsync.pas #600 #内容为abc:123
timeout 5
dont compress = *.gz
max connections = 4
/etc/xinetd/rsync
service rsync{
disable = no
flags= IPv6
socket_type=stream
wait=no
user=root
servser=/usr/bin/rsync
server_args=--daemon --config=/etc/rsyncd.conf
log_on_failure+=USERID
}
server iptables stop
setenforce 0
server xinetd restart
netstat -tlunp | grep 873
3.客户端配置
/etc/rsync.pas #内容为123
客户端不需要配置/etc/rsyncd.conf
测试
rsync -avz abc@192.168.200.155::data1 test
本文转自神ge 51CTO博客,原文链接:http://blog.51cto.com/12218412/1865748