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@server: followed by the password prompt. Thanks, Shane -------------- next part -------------- HTML attachment scrubbed and removed
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@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
Hey Guys, This works great. Thanks a lot. From: Julian Pace Ross [mailto:linux@prisma.com.mt] Sent: Monday, August 18, 2008 3:03 AM To: Shane Uys Subject: Re: Can the rsync password be automated? Shane, For the first option Shachar mentioned, just: 1) Generate the keys as described here http://optics.ph.unimelb.edu.au/help/rsync/rsync_pc1.html (you can do this on a linux machine, then just copy the public key file to the windows pc, and leave the private key in the default directory (i think that should be "./.ssh/) .. 2) from the command line , do rsync - e "ssh -i publickeyfile -l username" etc Follow the link above and you should be fine. Hope this helps Julian -----Original Message----- From: Shachar Shemesh [mailto:shachar@shemesh.biz] Sent: Monday, August 18, 2008 1:03 AM To: Shane Uys Cc: rsync@lists.samba.org Subject: Re: Can the rsync password be automated? 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-authenti cation.html Shachar