rsync Q, third try.

Gene Heskett gene.heskett at verizon.net
Mon Aug 14 08:06:16 UTC 2006


On Monday 14 August 2006 02:58, Felipe Figueiredo wrote:
>On Friday 11 August 2006 17:25, Gene Heskett wrote:
>> On Friday 11 August 2006 01:57, Felipe Figueiredo wrote:
>> >Le Friday 11 August 2006 01:25, Gene Heskett a écrit :
>> >> rsync: could not open password file "/etc/rsync/xxxx.yyyy":
>> >> Permission denied (13)
>> >> Password:
>> >>
>> >> This file has been world readable, owned by root:root, and gene:gene
>> >> with a chmod 0600 applied to it, all without effecting that error
>> >> message a bit.
>> >
>> >First things first.
>> >
>> >What about directory permissions? Are they correct?
>> >
>> >Have you tried copying xxxx.yyyy from /etc/rsync to another  dir, say
>> > /tmp, and use that in the CL?
>>
>> Ah mm, no, but I did move it from /etc to ~/user, and that had no
>> effect. rsync wants rather exclusive perms, but maybe my setting it via
>> chown to the user, and chmod 0600 is too tight?  I started out with it
>> owned by root:root, and I've setup a root password, exactly as its
>> setup on 2 other machines, and that gave the exact same failure.  The
>> rsync client has been configured, and until I removed it and
>> reinstalled it, it was running, and is now also.  Apparently the
>> removal & reinstall didn't nuke the configs I had setup, modeled on
>> what works on the other 2 machines.
>
>Ok, so then I went to the source ( man rsync ) :
>
>       --password-file
>              This  option  allows  you  to  provide  a password in a
> file for accessing a remote rsync daemon. Note that this option  is 
> only useful  when accessing an rsync daemon using the built in trans-
> port, not when using a remote shell as the transport.  The  file must 
> not be world readable. It should contain just the password as a single
> line.
>
>If I understand the scope of this file, it probabably shouldn't reside
>in /etc. It probably shouldn't even exist for long, just for the
> execution of the sync, so your ~ should be fine (maybe a dot-file, with
> perm 0600).
>
>Are you accessing the remove machine which gets you to a ssh shell, or
> does the remote run a rsyncd?
>
It was running an rsync daemon before I removed rsync and reinstalled it, 
right now:
gene at shop:~$ ps -ea|grep rsync
 8036 ?        00:00:00 rsync

>Is your password-file in the correct format?

Identical to working versions.

>Is it still world readable?

gene at shop:~$ ls -l rsyncd.secrets
-rw------- 1 gene gene 16 2006-08-10 10:31 rsyncd.secrets

Results as of right now are, from this evenings email from rsync:
---------------
Linux shop 2.6.15-magma #1 Fri Jun 9 20:51:19 EEST 2006 i686 GNU/Linux

The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

rsync: could not open password file "/etc/rsync/coyote.elladene": 
Permission denied (13)
Password: @ERROR: auth failed on module shop-gene
rsync error: error starting client-server protocol (code 5) at main.c(1296) 
[receiver]
Sun Aug 13 23:07:58 EDT 2006
--------------------
Now, that file is:gene at shop:~/rsync$ ls -l
total 4
-rw------- 1 gene gene 10 2006-08-14 03:14 coyote.elladene

which is where I just put a copy of it, and set 0600 perms.  Then I 
modified my script line and ran it as:
[root at coyote bin]# su gene -c "rsync -avz --delete 
--password-file=/home/gene/rsync/coyote.elladene 
gene at 192.168.71.4::shop-gene/ /home/shop"
Linux shop 2.6.15-magma #1 Fri Jun 9 20:51:19 EEST 2006 i686 GNU/Linux

The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

rsync: could not open password file "/home/gene/rsync/coyote.elladene": No 
such file or directory (2)
Password:

So now its asking for a password, and regardless of the password entered, 
genes or roots, this then comes back:

@ERROR: auth failed on module shop-gene
rsync error: error starting client-server protocol (code 5) at main.c(1296) 
[receiver]

Which is different than it was before I removed and reinstalled rsync.  
Prior to that, it would actually run, but skip over any files that were 
not gene:gene for owner:group

And after all this puttering around:
gene at shop:~/rsync$ ps -ea|grep rsync
 8036 ?        00:00:00 rsync

so the daemon is still running.  The /etc/rsyncd.conf:
-------------
#rsync config file. Same configuration as SAMBA

motd file = /etc/motd
max connections = 20
syslog facility = local3
[shop-gene]
    comment = The shop.coyote.den/home/gene dir
    path = /home/gene
    read only = yes
    list = yes
    hosts allow = 192.168.71.3
    auth users = backup gene root
    secrets file = /etc/rsyncd.secrets
-----------------------
and /etc/rsyncd.secrets?
Humm, is now located in /home/gene, and is:
gene at shop:~$ ls -l rsyncd.secrets
-rw------- 1 gene gene 16 2006-08-10 10:31 rsyncd.secrets
So let me point the conf file at it, I forgot to fix that..
Did, and then found the pid's for rsync weren't valid & had to resort to a 
kill of the displayed number, and now I can start and stop it again.  So 
lets see what happens when I run it this time:
------
No change, see above, I have to enter a password, and get this when I do:
@ERROR: auth failed on module shop-gene
rsync error: error starting client-server protocol (code 5) at main.c(1296) 
[receiver]

rsync has too many 'secrets' files IMO.  Confusing.  So I put it back 
in /etc and owned by root.  And change the .conf file back to point at the 
one in /etc again.

Humm, still asks for a password, I give it gene's, and its running with the 
usual perms skips..
----------

  And 5 minutes later ends with this:
---------
rsync: send_files failed to open "/rsync/coyote.elladene" (in shop-gene): 
Permission denied (13)

sent 85293 bytes  received 67770911 bytes  1180107.90 bytes/sec
total size is 94371635  speedup is 1.39
rsync error: some files could not be transferred (code 23) at main.c(1298) 
[generator]
----------

I don't think its actually using that file, so it could be rm'd.

But how do I get it to use a password file on the kubuntu box?  Also, I do 
have a valid root account on that box, and it appears I'm going to have to 
use it to do a full rsync, so the 'su gene -c' goes away in that script I 
guess.  At least its running again IF I can make it find that password 
file and use it.  Thats the $64K question I started out with 3 weeks 
ago...

Ok, moved that secrets file back to /etc/rsync, owned by root with roots 
password in it, and now I'm apparently passing the password ok, but still 
exiting:
-----------------
[root at coyote bin]# rsync -avz --delete \ 
--password-file=/etc/rsync/coyote.elladene \ 
gene at 192.168.71.4::shop-gene/ /home/shop
Linux shop 2.6.15-magma #1 Fri Jun 9 20:51:19 EEST 2006 i686 GNU/Linux

The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

@ERROR: auth failed on module shop-gene
rsync error: error starting client-server protocol (code 5) at main.c(1296) 
[receiver]
-----------------
I got the @ERROR this time without the password prompt before it!

Its not generating any log file entries, is that something I can turn on in 
the rsyncd.conf?  Anything to make it a little more verbose as to the 
reason for the failure.

Thanks for the trigger to make me go checking again, and any further hints 
you can offer about the password file problem.

-- 
Cheers, Gene
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Yahoo.com and AOL/TW attorneys please note, additions to the above
message by Gene Heskett are:
Copyright 2006 by Maurice Eugene Heskett, all rights reserved.





More information about the kubuntu-users mailing list