Permission problem with rsync in daemon mode

Matt McCutchen hashproduct at
Wed Dec 28 17:49:09 GMT 2005

On Wed, 2005-12-28 at 09:21 -0800, Jonathan Chen -X wrote:
> sudo rsync --archive --compress -vv --sparse --progress -e ssh
> jon at linuxhost::netegrity /users/jon/test/
> The /users/jon/test/ is owned by jon:jon while the "netegrity" dir on
> the rsync server has root:root ownership.   So when I try execute the
> above command, I get the correct ownership for netegrity, but somehow
> the "test" directory ownership changes(maybe access permission changed
> too?) to root:root instead of jon:jon.   I don't know why that happens.
> If I execute the command without "sudo" all ownership goes to jon:jon

rsync is copying the server's netegrity directory onto your test
directory, and you told rsync to preserve ownership (--archive), so it
sets the ownership of test to match netegrity, i.e. root:root.  (When
rsync lacks the privileges to give test to root:root, it simply skips
that step without complaining; some consider this behavior wrong.)

If you don't want to preserve ownership at all, use -rltpD instead of
--archive, which means -rltpogD.

Alternatively, use a wildcard to copy only the files inside netegrity
but not netegrity itself, in which case no attributes of test will be
changed to match netegrity:
	rsync <...> jon at linuxhost::netegrity/* /users/jon/test/

Matt McCutchen, ``hashproduct''
hashproduct at --

More information about the rsync mailing list