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 am writing a synchronisation script to sync some web environments.

Ex: Update integration from production (mostly to fetch new database rows and uploaded files)

Some of my prerequisites are :

  • Developpers will use this script from the integration server
  • DSA keys are needed to connect to production server
  • Integration server can not store developper's private keys


I want developpers to connect to integration with ssh -A to allow the script to connect to production server with their key:

+-------------+    SSH     +-------------+   rsync   +-------------+
| Developer   | ---------> | Integration | --------> |  Production |
|  computer   |            |   Platform  | <-------- |   platform  |
+-------------+            +-------------+           +-------------+
(priv DSA key)              (pub DSA key)             (pub DSA key)

It works just fine for ssh or scp, but I can't get rsync to use forwarded keys to connect to production server.

I saw similar questions but where rsync is run from user's computer and therefore ssh key file may be pointed by -i option.

My concern is not either passphrase related since this script will be run by real users (not cron)

I tried to specify remote shell to rsync like this :

rsync -e "ssh -A" user@production

But with no luck.

share|improve this question
Have you tried using rsync -e "ssh -i /path/to/key" .....? – Flo Jun 12 '14 at 19:11
keys are not stored on the server rsync is run from.I updated my question with a schema to hopefully make that more clear. – Huge Jun 17 '14 at 8:52
I've just successfully done rsync-with-forwarded-agent, so I think there must be something more to the issue. What does the sshd log on the production server say about the connection attempts? – Jenny D Jun 17 '14 at 9:14
Can you copy/paste the rsync call ? Is it suppose to work without any specific options ? sshd does not log anything on prod server (which I'm not root on). – Huge Jun 17 '14 at 10:09

Ok my problem was that I am "SSHing" on non standard port and I was trying to tell rsync via --port= option.

I used rsync -e "ssh -p 1337" user@host:somepath/ . instead and it works just fine out of the box.

share|improve this answer

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.