I carefully followed the tutorial there:


And then i wrote the following script.sh on my local machine

echo "Sync"

rsync -avz --links /home/jansiatest/.jenkins/workspace/svn_to_demo/trunk/CPS/ jansia@ps27670.dreamhost.com:/home/tasklite/test

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

I don't know what am I missing exactly

  • 1
    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
  • 1
    @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

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.


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

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

ssh-copy-id jansia@ps27670.dreamhost.com
  • 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.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.