2

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?

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

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

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

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