Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 would like to run rsync without the need to enter a password. I understand I can do this using ssh keys and once the right key has been copied over to the remote server rsync logs in fine without user interaction.

However when the key has been changed, has been removed, or, say in case of some automation, a server has been added to a list of servers to be rsync'ed, I would like rsync to not be prompted for a password.

Meaning, rsync should only attempt to use password-less login with ssh and if that doesn't work move on without having to deal with a password prompt and a possible lengthy timeout.

share|improve this question
up vote 5 down vote accepted

You can configure the SSH client to not attempt password authentication:

rsync -e 'ssh -o PasswordAuthentication=no' ...

There is also a BatchMode option which disables password authentication and decreases the timeout:

rsync -e 'ssh -o BatchMode=yes' ...
share|improve this answer
I did try both options before asking the question and couldn't get it to work. But I tried again and it does do the job, so I must have made a mistake before. My first test was part of a larger script, now I tried on the command line. Thanks. – aseq Feb 26 '13 at 18:53

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.