2

I'd like to use rsync over openvpn to copy some files as root from one server to another, all on the same LAN (i.e., not over the Internet). Both servers are running Wheezy. I could do this over ssh, but I'd prefer not to because I want to keep ssh root access disabled. The VPN is working - e.g., from the client I can successfully ping the server's openvpn IP (and I can connect over the Internet using the VPN ip and VNC, though again for this use case I want to copy files on my LAN behind my firewall). However, when I try rsync, I get an error "connection over port 22 refused". Q: is this a problem with my rsync syntax and what syntax should I use, or with this approach do I need to setup the rsync daemon on the server? Rsync without the daemon seems to assume the use of ssh.

Thanks!

2
  • 3
    You need to set up rsync daemon. That's the best way of dealing with the transport issue.
    – cjc
    Feb 24, 2014 at 23:25
  • 1
    but I'd prefer not to because I want to keep ssh root access disabled. - Right, so for security reasons you don't want to permit rsync via root, and the alternative would have to be running a daemon with root privileges that a very primitive authentication system.
    – Zoredache
    Feb 25, 2014 at 1:20

2 Answers 2

2

This page has a pretty decent (and brief) description of the steps you need to take on Debian Wheezy.

http://www.server-world.info/en/note?os=Debian_7.0&p=rsync

Note that when you're using the rsync daemon (as opposed to rsync over ssh) you use hostname::sharename syntax to (in the example on that page the rsync share is "site").

So you'd run rsync -avz hostname::sharename or similar from the client.

You probably want to use hosts.allow to permit only specific IP addresses. If you want username/password logins as well add this to your share definition in rsyncd.conf:

   auth users = user
   secrets file = /etc/rsyncd.secrets

and then create an /etc/rsyncd.secrets

username:password

and then

chmod 600 /etc/rsyncd.secrets
1
  • Thanks guys - very helpful, and appreciate the level of detail in response, which will be really helpful. Thanks!
    – Senrabdet
    Feb 25, 2014 at 12:37
1

rsync is client-server program so the client has to connect to something running on the remote server, SSH or rsyncd. VPN is only the transport here, not the service to connect to.

I would suggest to:

  1. run a rsync deamon on host2 and connect to it from host1
  2. if you don't want to use SSH try to mount stuff via NFS from host2 to host1 and then use rsync or cp "locally" on host1 to copy what you need to host2 share exported via NFS
1
  • Re: option 2, an NFS mount over OpenVPN is not likely to perform very well. Feb 25, 2014 at 0:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .