Not Again! (Was: Re: FAQ: Moving files between two machines using rsync)

Mauricio raub at afn.org
Mon Feb 23 12:21:07 GMT 2004


	I can't believe this!  I am having the very same problem I 
had before.  For those who do not remember, I was trying to rsync a 
file from a Solaris 9 box(kushana)  to a netbsd 1.6.1 (the rsync 
server, katri) box, without much luck:

raub at kushana-13>rsync -vz \
?         --password-file=/export/home/raub/nogo \
?         /export/home/raub/sync-me \
?         raub at katri::tmp
NetBSD 1.6.1 (GENERIC) #0: Tue Apr 8 21:00:42 UTC 2003

Welcome to NetBSD!


@ERROR: auth failed on module tmp
rsync: connection unexpectedly closed (164 bytes read so far)
rsync error: error in rsync protocol data stream (code 12) at io.c(165)
raub at kushana-14>

As Andrew explained below, the issue was I had the wrong file 
permissions in the /etc/rsync.secrets for the target (katri) machine:

At 05:50 -0500 2/17/04, Mauricio wrote:
>At 05:26 +0000 2/17/04, Andrew Liles wrote:
>>check /var/log/messages
>
>	All it has is stuff related to my Win2K machine (argh!):
>
>Feb 17 05:39:23 katri dhcpd: DHCPINFORM from 10.0.0.4 via le0
>Feb 17 05:39:23 katri dhcpd: DHCPACK to 10.0.0.4
>
>>check you have the correct file permissions on the daemon secrets 
>>file and local secret file; both should not be world readable
>
>	That was it!
>
>katri# ls -l /etc/rsyncd.*
>-rw-r--r--  1 root  wheel  250 Feb 16 10:50 /etc/rsyncd.conf
>-rw-r--r--  1 root  wheel   14 Feb 16 10:50 /etc/rsyncd.secrets
>katri# chmod go-r /etc/rsyncd.secrets
>katri# ls -l /etc/rsyncd.*
>-rw-r--r--  1 root  wheel  250 Feb 16 10:50 /etc/rsyncd.conf
>-rw-------  1 root  wheel   14 Feb 16 10:50 /etc/rsyncd.secrets
>katri#
>
>the daemon secrets file was world readable.  Once that was 
>corrected, I had no problem moving the file around:

So, I now decided to do the same thing, this time going from a 
Solaris 8 (moss) box to a Redhat 9 (azalea, the rsync server) box. 
First thing I did was to make sure the permissions were correct:

<in the rsync server>
[root at azalea mauricio]# ls -l /etc/rsyncd.*
-rw-r--r--    1 root     root          650 Feb 23 07:57 /etc/rsyncd.conf
-rw-------    1 root     root           71 Feb 23 07:58 /etc/rsyncd.secrets
[root at azalea mauricio]#

<in the Solaris 8 box; I am using /etc/rsyncd.secret as the local secret file>
root at biostat-10>ls -l /etc/rsyncd.secrets
-rw-------   1 root     root          71 Feb 23 07:01 /etc/rsyncd.secrets
root at biostat-11>

Then, I checked if the rsync entry in /etc/xinit.d in the server makes sense:

[root at azalea mauricio]# cat /etc/xinetd.d/rsync
# default: off
# description: The rsync server is a good addition to an ftp server, as it \
#       allows crc checksumming etc.
service rsync
{
         disable = no
         socket_type     = stream
         wait            = no
         user            = root
         server          = /usr/bin/rsync
         server_args     = --daemon
         log_on_failure  += USERID
}
[root at azalea mauricio]#

/etc/rsync.conf for the server is the same as I used before (with the 
Sol9 and netbsd boxes), just having the IP of the allowed host and 
the authorized user changed:

[root at azalea mauricio]# cat /etc/rsyncd.conf
motd file = /etc/motd
max connections = 25
syslog facility = local3

[tmp]
         comment = temporary file area
         uid = root
         gid = root
         path = /tmp
         read only = no
         list = yes
         hosts allow = 159.178.77.177
         auth users = mauricio
         secrets file = /etc/rsyncd.secrets

[root at azalea mauricio]#

But, when I try to rsync, I do not go very far:

root at biostat-12>rsync -avz --password-file=/etc/rsyncd.secrets 
/usr/users/mauricio/sync-me mauricio at 159.178.79.119::tmp
Welcome to Azalea, the Backup Server


@ERROR: auth failed on module tmp
rsync: connection unexpectedly closed (126 bytes read so far)
rsync error: error in rsync protocol data stream (code 12) at io.c(165)
root at biostat-13>

Checking azalea's log file is not very helpful:

[root at azalea mauricio]# cat /var/log/messages
[...]
Feb 23 08:17:12 azalea rsyncd[5279]: auth failed on module tmp from 
moss (159.178.77.177)
[root at azalea mauricio]#

but at least confirms the IP I set for the allowed host is correct. 
What else should I check?


More information about the rsync mailing list