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 carefully followed the tutorial there:

And then i wrote the following on my local machine

echo "Sync"

rsync -avz --links /home/jansiatest/.jenkins/workspace/svn_to_demo/trunk/CPS/

But when i launch the script typing ./ it keeps asking me for the password on the server again.

I don't know what am I missing exactly

share|improve this question
missing -e ssh flag? Try running your command directly (ie type rsync -avz ...). – user130370 Aug 30 '12 at 16:23
@EricDANNIELOU, the -e ssh has been the default behavior for many years now, it is almost never required. – Zoredache Aug 30 '12 at 16:28
My question is, can you login using SSH and not get prompted for a password without using rsync? When you were generating your keypair, you left the pass-phrase empty right? – Zoredache Aug 30 '12 at 16:29
no i'm always prompted, so a problem in my RSA config i guess – Jerome Ansia Aug 30 '12 at 16:29
@JeromeAnsia If your public key is correctly deployed in /home/jansia/.ssh/authorized_keys, the next thing to do is look at the log files on the server to see what sshd thinks is going on. It's possible that permissions are not correct on the directory, or for /home/jansia, etc. You need to check your logs. – cjc Aug 30 '12 at 16:51
up vote 2 down vote accepted

Check the permissions on the .ssh directory on the remote host accepting the key. Key auth will not work if the permissions are readable by any other user. The .ssh directory should be 700 and authorized keys should be 600. Or, drwx------ and -rw-------, respectively. I forget this every time I set up a new host.

share|improve this answer

It should work you have not correctly deploy your ssh key.

On Debian/Ubuntu, you can deploy it with this command :

share|improve this answer
Thanks i typed this command on my local machine, it asked for my password, but still not working :/ – Jerome Ansia Aug 30 '12 at 16:44

Use the rsync -e option to specify a script you write that runs ssh with options you control. Use the ssh option -o "batchmode yes" to block password prompts. Now if the keys do not get access, there will be an error message and ssh will exit with a status code. Be sure your script passes that status code back to rsync. If your script outputs anything, be sure it outputs only to STDERR. If it still fails, next diagnose why the key(s) is/are not accepted by the server.

share|improve this answer
Thanks Skaperen but i just found the answer :p – Jerome Ansia Aug 30 '12 at 19:41

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.