Windows – Rsync over ssh with password in command rather than using keys

passwordrsyncsshwindows

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

Best Answer

How do I specify a password for ssh on the command line for rsync?

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.