I am trying to use rsync over SSH, server runs rsync in daemon mode, client connects in with:

rsync -options user@server::folder /local/copy

This works fine. The problem is that SSH runs on a non-default port on the server, the following fails:

$rsync -options -e 'ssh -p 1234' user@server::folder /local/copy
#######################################
# Access to this server is prohibited #
########## Disconnect NOW! ############
#######################################
rsync: connection unexpectedly closed (0 bytes received so far) [receiver]
rsync error: error in rsync protocol data stream (code 12) at io.c(463) [receiver=2.6.8]

But SSH works (its using keys):

[user@client ~]$ ssh -p 1234 user@server
#######################################
# Access to this server is prohibited #
########## Disconnect NOW! ############
#######################################
Last login: Thu Mar 31 09:18:08 2011 from 1.2.3.4
[user@server ~]$

How can I trouble shoot this? SSH works, rsync works, together, its not working. I have turned iptables off and as we can see above it does connect but rsync fails to connect to the defined folder?

link|improve this question

2  
don't mix rsync daemon mode with remote shell mode – MattBianco Mar 31 '11 at 12:08
feedback

1 Answer

up vote 3 down vote accepted

You are using the :: syntax which is used for a rsyncd daemon. If you are going to copy via an alt ssh port use the following opts:

$rsync -options -e 'ssh -p 1234' user@server:/folder /local/copy

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.