从Windows到CentOS的Rync连接问题

尝试在Windows 7上从Cygwin连接到CentOS上的rsync,但出现以下错误:

$ rsync -vrtz -vvv --password-file=c:\cygwin\secret --delete /cygdrive/d/Data [email protected]::modulename opening tcp connection to xx.xx.xx.xx port 873 rsync: failed to connect to xx.xx.xx.xx (xx.xx.xx.xx): Connection timed out (116) [sender] _exit_cleanup(code=10, file=/home/lapo/package/rsync-3.0.9-1/src/rsync-3.0.9/clientserver.c, line=122): entered rsync error: error in socket IO (code 10) at /home/lapo/package/rsync-3.0.9-1/src/rsync-3.0.9/clientserver.c(122) [sender=3.0.9] [sender] _exit_cleanup(code=10, file=/home/lapo/package/rsync-3.0.9-1/src/rsync-3.0.9/clientserver.c, line=122): about to call exit(10) 

我可以在同一台Windows机器上从putty SSH服务器。 我也可以直接ping IP地址。

我需要确保一个特定的端口是打开的rsync连接吗?

更新

 cat /etc/services | grep rsync 

返回

 rsync 873/tcp # rsync rsync 873/udp # rsync 

另一个更新

iptables -L

输出:

 Chain INPUT (policy ACCEPT) target prot opt source destination RH-Firewall-1-INPUT all -- anywhere anywhere tcp -- anywhere anywhere tcp dpt:ftp ACCEPT tcp -- anywhere anywhere tcp dpt:ftp Chain FORWARD (policy ACCEPT) target prot opt source destination RH-Firewall-1-INPUT all -- anywhere anywhere Chain OUTPUT (policy ACCEPT) target prot opt source destination Chain RH-Firewall-1-INPUT (2 references) target prot opt source destination ACCEPT all -- anywhere anywhere ACCEPT icmp -- anywhere anywhere icmp any ACCEPT esp -- anywhere anywhere ACCEPT ah -- anywhere anywhere ACCEPT udp -- anywhere 224.0.0.251 udp dpt:mdns ACCEPT udp -- anywhere anywhere udp dpt:ipp ACCEPT tcp -- anywhere anywhere tcp dpt:ipp ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh REJECT all -- anywhere anywhere reject-with icmp-host-prohibited 

你有CentOS服务器上运行的默认netfilter规则集。

如果这个主机是内部的(不可公开访问),你可以禁用防火墙:

 service iptables stop chkconfig iptables off 

但是,简单地允许rsync端口会更好:

 iptables -A INPUT -p tcp --dport 873 -j ACCEPT service iptables save