The remote rsync command runs as your user, not as root, and so cannot set 
ownership.
IIRC there's an environment variable you can set that specifies how to invoke 
the remote rsync (post-ssh, there's an end var for establishing the ssh 
connection, too).
Set that to "sudo rsync", would be my guess.
-Adam

On August 19, 2014 9:27:11 AM CDT, Markus Rosjat <ros...@ghweb.de> wrote:
>Hello,
>
>this has been asked befor though but since searching the net always 
>tells me it should work  but not when I try to do it  .. I'll ask
>again.
>
>what I want to do is:
>  - copy keep ownership and permission when I rsync a file or directory
>
>what I get is:
> - I have a user on both machines who is in wheel (this should make it 
>possible to do this)
> - when I $sudo rsync -a /some/random/file me@remotemachine:/tmp I get 
>the file synced
>     - file has owner someone:someone and 0600
>  - when I check the permission and owner on the remote machine
>     - file has owner me:wheel and 0644
>
>what I can do but dont want to:
>  - I can enable root ssh access
>  - I rsync as root and the owner and permission gets copied even the 
>user doesnt exist on the remote machine
>
>Is there any other thing I miss with the sudo  approach?
>
>Regards
>
>-- 
>Markus Rosjat    fon: +49 351 8107223    mail: ros...@ghweb.de
>
>G+H Webservice GbR Gorzolla, Herrmann
>Königsbrücker Str. 70, 01099 Dresden
>
>http://www.ghweb.de
>fon: +49 351 8107220   fax: +49 351 8107227
>
>Bitte prüfen Sie, ob diese Mail wirklich ausgedruckt werden muss!
>Before you print it, think about your responsibility and commitment to
>the ENVIRONMENT

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

Reply via email to