Can the rsync password be automated?

Shachar Shemesh shachar at shemesh.biz
Mon Aug 18 06:03:10 GMT 2008


Shane Uys wrote:
>
> Is there a way to automate the rsync password or maybe disable? I am 
> currently running rsync from a Windows command prompt and would like 
> to run it from a .bat file. I have read through the config man pages 
> but not sure if my ssh_config file is even being used. I tried 
> passwordauthentication = no but it still asked for password. I have 
> seen a option for --password-file= but I believe this does not apply 
> in that I’m using “ssh” instead of daemon. I am using copssh and 
> cwrsync on two Windows 2003 servers over the internet. Here is the 
> command line used that transfers a single file. Rsync –e “ssh” file1.x 
> user at server:       followed by the password prompt.
>
> Thanks, Shane
>
>  
>
The official and recommended way of solving this issue is to perform 
public key authentication with the ssh server. You are right that the 
--password-file option does not work when running rsync over ssh. Public 
key authentication solves your problem, and does not significantly 
reduce the security of your system.

There is another option, but only go that route if you have tried 
setting up public key authentication and failed for a reason over which 
you have no control. If your server supports public key authentication, 
do not continue to the next option. Only consider it if the 
administrator for the server to which you want to connect has disabled 
public key authentication and cannot be persuaded to change her mind.

There is a tool called "sshpass". It is available at 
http://sourceforge.net/projects/sshpass/. Read about it at 
http://www.debianadmin.com/sshpass-non-interactive-ssh-password-authentication.html

Shachar


More information about the rsync mailing list