Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have 3 servers. Call them A, B, and C. B and C are remote and only have A in their hosts.allow.

What I need to do is log into A, and then rsync over SSH the files from B to C. I want to use rsync because many of the files are similarly present on both B and C.

I could try to rsync from B -> A and then from A -> C except I don't have nearly enough disk space on A, so I'd have to find some way of "chunking" the files and I don't see an obvious way of grouping them, and even if I did, I'd have to babysit it too much, with deleting files off A's disk, restarting the process with the next chunk etc.

So is it somehow possible for me to rsync between the two servers? I don't think I will be able to get anyone to change the hosts.allow for me :(

share|improve this question
up vote 4 down vote accepted

You should be able to set up an SSH tunnel from A->B and from A-C, and then rsync directly from B->C by going across that tunnel.

It's going to be a bit complicated, but basically you do the following:

  1. Set up an rsync daemon on a high port (say 20000) on B
  2. Set up a LocalForward A:20000 to B:20000 with ssh
  3. Set up a RemoteForward from C:20000 to A:20000 with ssh
  4. On C, rsync -av /path rsync://localhost:20000/path

Bear in mind that all this traffic will be going both in and out the network on A and being encrypted, so it will probably be pretty slow. it might be worth seeing if B is actually firewalled from C, you might be able to run the rsync server on a high port and connect directly.

share|improve this answer
Good advice. Thanks. – user7655 Mar 20 '11 at 14:58

Your Answer


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.