Rsync Push files from linux to windoes. ssh issue - connection refused

Posted by piyush c on Server Fault See other posts from Server Fault or by piyush c
Published on 2011-06-24T12:52:32Z Indexed on 2012/06/27 3:17 UTC
Read the original article Hit count: 480

Filed under:
|
|
|
|

For some reason I want to run a script to move files from Linux machine to Windows. I have installed cwRsync on my windows machine and able to connect to linux machine.

When i execute following command:

rsync -e "ssh -l "piyush"" -Wgovz --timeout 120 --delay-updates --remove-sent-files /usr/local/src/piyush/sync/* "[email protected]:/cygdrive/d/temp"

Where 10.0.0.60 is my widows machine and I am running above command on Linux - CentOS 5.5.

After running command I get following error message:

ssh: connect to host 10.0.0.60 port 22: Connection refused
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(463) [sender=2.6.8]
[root@localhost sync]# ssh [email protected]
ssh: connect to host 10.0.0.60 port 22: Connection refused

I have modified my firewall settings on widows to allow all ports. I think this issue is due to SSH Daemon not present on my windows machine. So I tried installing OpenSSH on my machine and running ssh-agent but didn't helped.

I tried similar command to run on my widows machine to pull files from Linux and its working fine. For some reason I want command for Linux machine so that I can embed it in a shell script.

Can you suggest me if I am missing anything.


I am already having cwRsync installed on my widows and running it in daemon mode using --damemon option. And I am able to login using ssh from windows machine to linux machine.

When I issue bellow command, it just blocks for 120 seconds (timeout I specified in command) and exits saying there is timeout.

rsync -e "ssh -l piyush" -Wgovz --timeout 120 --delay-updates --remove-sent-files /usr/local/src/piyush/sync/* "[email protected]:/cygdrive/d/temp"

After starting rsync on widows, I checked, rsyc is running. And widows firewall setting are set to minimal, and on Linux machine stopped iptables service so that port 873 (default rsync port) is not blocked.

What can be the possible reason that Linux machine is not able to connect to rsync-daemon on windows machine?

© Server Fault or respective owner

Related posts about linux

Related posts about shell