rsync password-file not working
I'm trying to rsync my slack10 partition to a debian server using the following script:
#!/bin/sh mount /mnt/hda11 rsync -auvz --delete --password-file=/root/SlackPasswd --exclude=/mnt/* --exclude=/proc/* root@compaq:/ /mnt/hda11 umount /mnt/hda11 This is a home lan, and the script is run on the debian box. This always asks me for the password. SlackPasswd contains the root password, and is in the /root directory, readable by root. I'd like to put a script in a cron job to do this weekly, but need the password to work. I've also tried adding "export RSYNC_PASSWORD=" to the script, to no avail; same results. Anyone do this sort of thing? I've never tried rsync, but the rsync line works outside the script when I enter the password. rsync -auvz --delete --exclude=/mnt/* --exclude=/proc/* root@compaq:/ /mnt/hda11 compaq is the slack box. thanks... |
Hi kmoffat,
I was reading the rsync manual and found this text. Quote:
|
I assume it's the built in protocol, since I didn't specify. I also tried adding -e ssh with no change. I have tried scripts on both the client and the server; same result, always asks for password. I tried running on the server "rsync --daemon" but had a connection protocol failure error. I guess I'll go back to the drawing board and google some more. Must be a basic setup procedure I'm missing.
Odd that rsync works from the command line where I can enter the password, but not from a script. Might be the rsyncd.conf file that I'm messing up. More tomorrow. |
Hi,
Probably the password is being asked by rsh or ssh on the remote machine. By remote machine I want to say the machine you are not sat on. An easy test is enter Code:
rsh <remote-machine> echo rsync normally works without any configuration file for general purposes like as you are trying. The purpose of an rsync server is to work as an ftp server as you can see in www.kernel.org. It is very specific to send always the same set of files. The general purpose serves as a replacement for "rcp" or even "cp" when you are working on the same system. |
rsh noisy echo
results in nothing, just a flashing cursor on the next line ssh noisy echo asks for password, then gives permissiion denied error. |
You have to copy your ssh public key on Debian like :
On slackware : ssh-keygen -t rsa -- type enter (default) after each question even for password, press enter -- it will generate 2 files : the private key and the public key (id_rsa.pub is your public key) Then copy the public key to debian : scp ~/.ssh/id_rsa.pub noisy:.ssh/authorized_keys2 now try ssh noisy |
That is TOO easy, many thanks. I've been beating my head against the proverbial wall for a couple of days trying to figure this out. Seems I had a big gap in my knowledge.
Thanks again. |
All times are GMT -5. The time now is 02:56 PM. |