We backup our production servers to an office server, to have an extra offline backup, just in case. This backup is done using rsync over port 873, and doesn't require a login like when using rsync over ssh. I've tried to do this from a private server to see if that would work, but it doesn't.

I haven't set this up, the admin is gone, and I would like to know how this works. How secure is this?

  • 1
    What makes you think it's not using SSH? It's presumably using SSH over a non-default port.
    – Barmar
    Jul 29, 2014 at 20:01
  • That's what I assumed, as I thought it didn't need a login. I understand it uses a key to login, so still is able to use SSH.
    – SPRBRN
    Jul 30, 2014 at 7:56
  • @Barmar - sorry to have modded up your comment, because it's simply not true. Rsync over port 873 is not over ssh, is not encrypted. You can make rsync listen to port 873, without the need for ssh.
    – SPRBRN
    Jul 30, 2014 at 12:28

2 Answers 2


The first time you need to create keys in the private server and share the keys in your office server. You can do it as below.

In your private server, perform the following steps.

$ ssh-keygen
Enter passphrase (empty for no passphrase):
Enter same passphrase again:

Note: When it asks you to enter the passphrase just press enter key, and do not give any password here.

Use ssh-copy-id, to copy the public key to the remote host.

ssh-copy-id -i ~/.ssh/id_rsa.pub office-server


rsync -rvz -e 'ssh -p 873' --progress --remove-sent-files /private_server
/files/ user@office_server:/office_server/directory

If you just run the rsync command without copying the keys, it will ask for the password. To stop it from asking for password, you have to share the keys of your private server in the office server so that you can send files using rsync and port 873 without the need of password.



  • 1
    Although I appreciate the effort, you don't answer my question.
    – SPRBRN
    Jul 30, 2014 at 12:29
  • However, on second or third tought, I see that what you suggest might be a much better solution.
    – SPRBRN
    Jul 30, 2014 at 12:38
  • @SPRBRN, the ssh command specified inside rsync command makes the transfer secure.
    – Ramesh
    Jul 30, 2014 at 14:09

The setup is as follows:

  • The office server has rsync accepting connections over port 873.
  • Portforwarding is setup to route 873 traffic to this server.
  • In /etc/rsyncd.conf a module is added to allow traffic from the production server IP address to a folder on the local server.
  • Iptables is updated to allow traffic for port 873 and 22 from the production server IP address.

Apparently this syncing is unencrypted, so it's better to pipe this over ssh like Ramesh suggested.

You must log in to answer this question.

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