linux rsync安装 配置 实例详解

2019-09-23 09:23:35王冬梅

(2)、上面提到的,插入规则到最后一条的前面:

#iptables -I RH-Firewall-1-INPUT 10 -p tcp -m state --state NEW -m tcp --dport 873 -j ACCEPT
#iptables -I RH-Firewall-1-INPUT 10 -p udp -m state --state NEW -m udp --dport 873 -j ACCEPT

  插入之前:

插入规则:



插入规则后:


再在客户端执行,可以正常执行。

    (3)、或者关闭服务器的iptables:service iptables stop

30、password file must not be other-accessible

continuing without password file

Password:

解决:这是因为rsyncd.pwd rsyncd.sec的权限不对,应该设置为600。如:chmod 600 rsyncd.pwd

31、@ERROR: auth failed on module xxxxx

rsync: connection unexpectedly closed (90 bytes read so far)
rsync error: error in rsync protocol data stream (code 12) at io.c(150)

解决:这是因为密码设置错了,无法登入成功,检查一下rsync.pwd,看客服是否匹配。还有服务器端没启动rsync 服务也会出现这种情况。

32、@ERROR: chroot failed

rsync: connection unexpectedly closed (75 bytes read so far)
rsync error: error in rsync protocol data stream (code 12) at io.c(150)

解决:这是因为你在 rsync.conf 中设置的 path 路径不存在,要新建目录才能开启同步。

33、[root@hyj rsync_backup]# /usr/bin/rsync -vzrtopg --delete --exclude "res/" --exclude "default.properties" --progress rsync@192.168.8.126::test /usr/local/share/rsync_backup --password-file=/etc/rsync.pass
@ERROR: chdir failed
rsync error: error starting client-server protocol (code 5) at main.c(1516) [Receiver=3.0.9]

原因及解决办法:

    SELinux;(下面这条命令在服务器端执行)
    setsebool -P rsync_disable_trans on

34、ERROR: module is read only
rsync: read error: Software caused connection abort (113)
rsync error: error in rsync protocol data stream (code 12) at io.c(769) [sender=3.0.8]

解决:这是因为服务器端配置文件rsyncd.conf中read only = yes,为只读,即不允许客户端上传文件,改成no就可以了。