Hello Regarding ownership on the destination: rsync's man page indicates that when synchronizing files to a remote host, -o implies the --numeric-ids option, which makes perfect sense aince the named users/groups may not exist on the destination host. The problem I have is that the files created on the destination still appear to be owned by the local user (server1) on the rsync server. I do want to preserve the actual ownership. How can I ensure this is done? Here's an example of my configuration: rsyncd.conf on 192.168.1.1: log file = /var/log/rsyncd.log max connections = 4 #redundant chroot since this is the default, but just to be sure... use chroot = yes [server1] path = /netdisk/server1/mirror comment = server1 Server Root list = no read only = no auth users = server1server secrets file = /root/rsync-passwd hosts allow = 192.168.100.1 #note that the uid and gid belong to a non-privileged linux user "server1" on this host uid = server1 gid = server1 ################################## I run this from Server1: rsync -av --delete --sparse --exclude="rsync-mirror.sh" --exclude="/proc/" --exclude="/tmp/" --exclude="/mnt/" --exclude="/dev/" --exclude="/backup/" --exclude="/backup2/" / server1server@192.168.1.1::server1/ I'm using rsync 2.5.7 protocol version 2.6 TIA Joe _________________________________________________________________ Working moms: Find helpful tips here on managing kids, home, work — and yourself. http://special.msn.com/msnbc/workingmom.armx
On Mon, Dec 29, 2003 at 01:19:06PM -0500, acct svcs wrote:> The problem I have is that the files created on the destination still > appear to be owned by the local user (server1) on the rsync server.Which is the user you told rsync to run as. If you want any other user(s) to own the files, you have to tell it to run as root. ..wayne..
Wayne, AFAIK, the daemon is running as root. Thjs is how I set it up under xinetd. As I understand it, in order for the chroot to work, it has to be root. This is also evidenced by the fact that it is running on rsync's default port which is under 1024. Joe>From: Wayne Davison <wayned@samba.org> >To: acct svcs <heartofthematter@hotmail.com> >CC: rsync@lists.samba.org >Subject: Re: Question about file ownership on destination >Date: Mon, 29 Dec 2003 11:05:41 -0800 >MIME-Version: 1.0 >Received: from binome.blorf.net ([216.228.9.89]) by mc12-f8.hotmail.com >with Microsoft SMTPSVC(5.0.2195.6713); Mon, 29 Dec 2003 11:05:41 -0800 >Received: by binome.blorf.net (Postfix, from userid 1000)id B6CCF2FA8; Mon, >29 Dec 2003 11:05:41 -0800 (PST) >X-Message-Info: JGTYoYF78jFGhKOcwUQ2Qs4xZ7apiUOc >Message-ID: <20031229190541.GC17016@binome.blorf.net> >References: <BAY9-F43FIXR5lK06Ye0004e98a@hotmail.com> >In-Reply-To: <BAY9-F43FIXR5lK06Ye0004e98a@hotmail.com> >User-Agent: Mutt/1.5.4i >Return-Path: wayned@samba.org >X-OriginalArrivalTime: 29 Dec 2003 19:05:41.0208 (UTC) >FILETIME=[C0A8AD80:01C3CE3E] > >On Mon, Dec 29, 2003 at 01:19:06PM -0500, acct svcs wrote: > > The problem I have is that the files created on the destination still > > appear to be owned by the local user (server1) on the rsync server. > >Which is the user you told rsync to run as. If you want any other >user(s) to own the files, you have to tell it to run as root. > >..wayne.._________________________________________________________________ Make your home warm and cozy this winter with tips from MSN House & Home. http://special.msn.com/home/warmhome.armx
On Mon, Dec 29, 2003 at 05:23:21PM -0500, acct svcs wrote:> AFAIK, the daemon is running as root.Quoting from the rsyncd.conf file you cited: uid = server1 gid = server1 Comment-out these lines. ..wayne..
On Mon, Dec 29, 2003 at 03:26:53PM -0800, Wayne Davison wrote:> On Mon, Dec 29, 2003 at 05:23:21PM -0500, acct svcs wrote: > > AFAIK, the daemon is running as root. > > Quoting from the rsyncd.conf file you cited: > > uid = server1 > gid = server1 > > Comment-out these lines.He is also running with use chroot = true so commenting out the uid = server1 will have the daemon running as nobody. uid = 0 gid = 0 is what he wants. -- ________________________________________________________________ J.W. Schultz Pegasystems Technologies email address: jw@pegasys.ws Remember Cernan and Schmitt
Wayne Actually, I tried that earlier and it didn't work. The connection terminates unexpectedly almost immediately after the process begins. Rsyncd uses user nobody by default, and that user can't create the files on the server. That would work perfectly if the server was the source, but in my case it's the destination. After your suggestion I did discover a solution, though. I had to explicitly assign uid and gid to root in rsyncd.conf (hmmm, security?). Well, I have also restricted the allowed hosts and the segment is behind a firewall that filters the rsyncd port, so it should be reasonably secure. Thanks for helping out Wayne. joe>From: Wayne Davison <wayned@samba.org> >To: acct svcs <heartofthematter@hotmail.com> >CC: rsync@lists.samba.org >Subject: Re: Question about file ownership on destination >Date: Mon, 29 Dec 2003 15:26:53 -0800 >MIME-Version: 1.0 >Received: from binome.blorf.net ([216.228.9.89]) by mc10-f41.hotmail.com >with Microsoft SMTPSVC(5.0.2195.6713); Mon, 29 Dec 2003 15:26:53 -0800 >Received: by binome.blorf.net (Postfix, from userid 1000)id 93EA62FA3; Mon, >29 Dec 2003 15:26:53 -0800 (PST) >X-Message-Info: JGTYoYF78jH5atsNlNatiOZjTbY+656T >Message-ID: <20031229232653.GB18544@binome.blorf.net> >References: <20031229190541.GC17016@binome.blorf.net> ><BAY9-F539LLQtQeZMzE00036fb0@hotmail.com> >In-Reply-To: <BAY9-F539LLQtQeZMzE00036fb0@hotmail.com> >User-Agent: Mutt/1.5.4i >Return-Path: wayned@samba.org >X-OriginalArrivalTime: 29 Dec 2003 23:26:53.0192 (UTC) >FILETIME=[3DE3A880:01C3CE63] > >On Mon, Dec 29, 2003 at 05:23:21PM -0500, acct svcs wrote: > > AFAIK, the daemon is running as root. > >Quoting from the rsyncd.conf file you cited: > > uid = server1 > gid = server1 > >Comment-out these lines. > >..wayne.._________________________________________________________________ Make your home warm and cozy this winter with tips from MSN House & Home. http://special.msn.com/home/warmhome.armx