Hi All, I have a win2k3 server that its backing up to a CentOS 5.3 server. On the Win2k3 machine I plan to have rsync back up nightly to the CentOS server through ssh. The command I am using is as follows: rsync -vrPtz -e ssh myuser at myserver:/remote/backup/folder/ /local/backup/folder/ This all works great for the inital test except its prompts me for a password for "myuser" (as you would except) but how can I embed the password for ssh into the command line? Or can I not? Is the following some how possible: rsync -vrPtz -e ssh myuser at myserver mypassword /remote/backup/folder/ /local/backup/folder/ Or something like that? I can't find anything that says it is possible so its probably isn't but I know that some of you out there have far superior searching skills than I or hopefully, you might already know? Assuming this isn't possible as I've got that gut feeling it won't be, does anyone else have a better idea? BTW; Rsync in running on the windows box through cygwin in case you wondered or hadn't guessed ;) Many thanks, James ;) -----BEGIN GEEK CODE BLOCK----- Version: 3.1 GIT/MU/U dpu s: a--> C++>$ U+> L++> B-> P+> E?> W+++>$ N K W++ O M++>$ V- PS+++ PE++ Y+ PGP t 5 X+ R- tv+ b+> DI D+++ G+ e(+++++) h--(++) r++ z++ ------END GEEK CODE BLOCK------
James Bensley wrote on Wed, 29 Apr 2009 08:14:54 +0100:> This all works great for the inital test except its prompts me for a > password for "myuser" (as you would except) but how can I embed the > password for ssh into the command line? Or can I not?You can't. You use a certificate. There are many tutorials about this. I found this one in the short time: http://www.ehow.com/how_4750765_rsync-over-ssh-password.html Kai -- Kai Sch?tzl, Berlin, Germany Get your web at Conactive Internet Services: http://www.conactive.com
On Wed, Apr 29, 2009, James Bensley wrote:>Hi All, > >I have a win2k3 server that its backing up to a CentOS 5.3 server. On >the Win2k3 machine I plan to have rsync back up nightly to the CentOS >server through ssh. The command I am using is as follows: > >rsync -vrPtz -e ssh myuser at myserver:/remote/backup/folder/ /local/backup/folder/ > >This all works great for the inital test except its prompts me for a >password for "myuser" (as you would except) but how can I embed the >password for ssh into the command line? Or can I not?We use rsync modules, hostname::modulename, extensively for things like this as they can restrict the remote host to specific directories, and IP address/CIDR block ranges without using ssh. For things like rsync dns updates of djbdns/tinydns data files, this can be done without encryption. Where the data is sensitive, doing the update over OpenVPN tunnels works nicely. Bill -- INTERNET: bill at celestial.com Bill Campbell; Celestial Software LLC URL: http://www.celestial.com/ PO Box 820; 6641 E. Mercer Way Voice: (206) 236-1676 Mercer Island, WA 98040-0820 Fax: (206) 232-9186 Skype: jwccsllc (206) 855-5792 Common sense is genius dressed in its working clothes. -- Ralph Waldo Emerson
James Bensley wrote:> > I have a win2k3 server that its backing up to a CentOS 5.3 server. On > the Win2k3 machine I plan to have rsync back up nightly to the CentOS > server through ssh. The command I am using is as follows: > > rsync -vrPtz -e ssh myuser at myserver:/remote/backup/folder/ /local/backup/folder/The first thing I'm sure you noticed was that this syntax copies data from a remote system to the local one, which is the opposite of what you described doing, above. The second thing you will notice, eventually, is that rsync over ssh under Cygwin is unreliable. This has been the case for years and has something to do with Cygwin's emulation of blocking sockets which causes rsync to hang. Even if your backups are working now, I strongly recommend against continuing in this manner. If you want to use rsync on Windows, the best thing to do is run rsync and ssh daemons on the Windows host. Rsync should only listen for localhost connections. Run your backup jobs from Linux; ssh to the Windows machine and forward a port for rsync. A local rsync can then connect to the Windows machine over the port forward.