The situation is our client wants to download the most recent backup from our server (and they don't want us setting it up for them via rdesktop etc.. (sigh)). The client is running windows, server is linux.
I don't want to have to write a lengthy and complicated guide for them to set up pub/pri key auth as they'll no doubt waste all their time and ours. I'm going to get them to install cwRsync which is just rsync for windows pretty much.
Normally I'd use a public/private key setup to do this and set it up securely, however that's not really too much of a concern.
How do I specify a password for ssh on the command line for rsync? I'm used to: rsync -avz someone@somehost:/blah .
Cheers, John
The short answer is that you can't. SSH is designed to prevent you from doing this. cwRsync is a extremely stripped down cygwin install that has only ssh/rsync. The tools you might use instead like sshpass or expect won't be present.
I really doubt you'll save any time trying to get them to use a password given the above limitations.
It is generally a bad idea, but if you have a secure communications method between you and them, you might consider just generating the key-pair for them, and then transmitting the private key to them. It doesn't seem like it would be that much worse then enabling them to have a password stored in a script/text file somewhere.
You are not going to be able to do this without an rsync daemon. Trust me, I tried many many times before I went for the key solution (which is by far much easier and more secure). So while there are many options showing that you can do something like this:
Do not believe them. Do not waste your time. It will not work just because you have rsync and ssh installed. Until you understand how to make the transfer without ssh (and I wasted my time for a while until I verified that it wasn't easy) and getting a rsync daemon running it'll never work. Here are two really good reads if you still want to try (if you haven't already followed the good advice of Zoredache).
http://everythinglinux.org/rsync/ (let's party like it's 1999 - seriously, that's when it was written)
http://finmath.uchicago.edu/~wilder/Security/rsync/
I dropped my attempts at making that work years ago, went with keys over ssh, and never looked back.
You can use sshpass like this: