rsync help needed please

Although I have read the man pages (although I admit, not ALL of it!) and can’t seem to figure out the wood from the trees.

Requirement:-
Rsync files from one suse11.0 machine to another suse11.0 machine. The files are owned by root and need permissions to be maintained.

rsync -avz /srv/www/htdocs/ 192.168.1.223:/srv/www/htdocs

Problem:-
When run manually, it prompts for a password (remote root) … when I enter the password it rsyncs OK.

I read that I can use a password-file option which I tried but it said:-

The --password-file option may only be used when accessing an rsync daemon.

I want to automate this command by adding it into a cron job but without this password, it’s not performing the task.

Does anyone have any suggestions please how I can get around the problem??

Hi
What about using the ssh option and generate some keys?


Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 11.2 Milestone 5 (i586) Kernel 2.6.31-rc5-git3-2-desktop
up 8:24, 2 users, load average: 0.10, 0.21, 0.09
ASUS eeePC 1000HE ATOM N280 1.66GHz | GPU Mobile 945GM/GMS/GME

Hi,
as stated in the previous post, you have to generate a public ssh key and copy it to the destination’s authorized_keys, pls check this page:
ssh Without a Password | OpenSUSE Linux Rants

HTH

hmm, i have followed the guide but it still prompts me for a password when i run the script or try to ssh?!

i’ve ensured th permissions are correct as per OpenSSH FAQ but still no joy.

Would it matter if I am trying to trying to do from server1/root to server2/root?

Hi
Is the sshd_config file modified ok to allow root login and have you
restarted the sshd daemon?

Look at the logs (messages) to see what it’s saying :slight_smile:


Cheers Malcolm °¿° (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 2.6.27.25-0.1-default
up 9 days 18:25, 2 users, load average: 2.50, 2.67, 2.43
GPU GeForce 8600 GTS Silent - Driver Version: 190.18

Yes, sshd is restarted and root allowed (i can ssh manually from computer1 to computer2 using root).

Ah, the logs - how I forget how useful they are!


Aug 14 16:26:54 bgrsvr-w sshd[20155]: error: buffer_get_ret: trying to get more bytes 129 than in buffer 69
Aug 14 16:26:54 bgrsvr-w sshd[20155]: error: buffer_get_string_ret: buffer_get failed
Aug 14 16:26:54 bgrsvr-w sshd[20155]: error: buffer_get_bignum2_ret: invalid bignum
Aug 14 16:26:54 bgrsvr-w sshd[20155]: error: key_from_blob: can't read dsa key
Aug 14 16:26:54 bgrsvr-w sshd[20155]: error: key_read: key_from_blob ########################
 failed
Aug 14 16:26:54 bgrsvr-w sshd[20155]: error: buffer_get_ret: trying to get more bytes 129 than in buffer 69
Aug 14 16:26:54 bgrsvr-w sshd[20155]: error: buffer_get_string_ret: buffer_get failed
Aug 14 16:26:54 bgrsvr-w sshd[20155]: error: buffer_get_bignum2_ret: invalid bignum
Aug 14 16:26:54 bgrsvr-w sshd[20155]: error: key_from_blob: can't read dsa key
Aug 14 16:26:54 bgrsvr-w sshd[20155]: error: key_read: key_from_blob ########################
 failed

I’m going back to re-read that guide and see if somehow I messed up!!

In the meantime, please any more suggestions are appreciated!

Bah! Silly VIM (ahem, of course, it was VIM’s fault and not mine!)

The key I had copied into the authorized_keys file has line breaks in it (hence I think the
in the messages file), I removed them so it was all on one line and now … IT WORKS!!

Thank you for suggestions and links!
<<< RESOLVED >>>