Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a rsync server and i can not list modules or transfer to modules.

Following work correctly:

rsync -v test.txt user@host.com:test

It will be create a new file "test" in the home directory of user

Following don't work correctly:

rsync -v test.txt user@host.com::moduleA

and

rsync server@host.com::

It returns this:

> rsync: failed to connect to host.com (*inet_ntop failed*):
> Connection refused (111) rsync error: error in socket IO (code 10) at
> clientserver.c(122) [sender=3.0.8]

On the server (with ssh) execute "rsync localhost::" returns the module list. But execute the command with the hostname it will be the same error as above.

Can anyone help? thanks

share|improve this question
add comment

3 Answers

rsync server uses its own protocol (on port 873) for the connection, not ssh. If you're only allowing ssh for the rsync transport, it's not going to work. Is your firewall blocking port 873?

Note that if you're doing this across the Internet, you'll want to secure this traffic. You can use a VPN or set up the remote shell connection using the --rsh option. For the latter, take a look at:

http://linux.die.net/man/1/rsync

And go to the "Using Rsync-daemon Features Via a Remote-shell Connection" section. Basically, run:

rsync -v test.txt --rsh=ssh user@host.com::moduleA or possibly rsync -v -e "ssh -l user" test.txt user@host.com::moduleA (since the user@host.com::moduleA will auth against the rsync user, not the ssh user)

share|improve this answer
    
Thanks, but i have always try to connect with -e ssh etc.. with the same problems. But why work the command when i connect without modules? –  feitzi May 14 '12 at 15:35
    
rsync defaults to ssh if you are not using rsync server. If you specify modules, then you're using rsync server, and the transport is not ssh in that case. –  cjc May 14 '12 at 15:37
    
ok i understand. But the server runs correct because i can list modules on the server (localhost) Is this correct? –  feitzi May 14 '12 at 15:43
1  
Yes, if you're on the server (localhost), you're just connecting over the rsync protocol on port 873 and you're just using the loopback interface. If you're connecting to it from a remote host, either you have to open port 873 in the firewall (and have unencrypted traffic on the Internet), or you have to configure a VPN, or you have to specify the remote shell for the transport. –  cjc May 14 '12 at 15:50
    
Ok i have to connect rsync with ssh, i use this command rsync -e "ssh -i /home/user/.ssh/id_rsa -l user" user@host:: But it don't work. Connect with ssh only, works perfect ( ssh host ) –  feitzi May 15 '12 at 5:48
show 1 more comment
up vote 0 down vote accepted

It works with this command rsync -azve"ssh -l user" --rsync-path="sudo rsync" file.txt user@host::module

The reason was the option --rsync-path="sudo rsync"

share|improve this answer
add comment

For me, I found that it gave this error because my receiving directory had spaces in the name. So "My Directory" did not work as a receiving directory. Once I changed this to "My_Directory", the errors went away.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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