# Syncthing with rsync not preserving ownership

**URL:** https://forum.syncthing.net/t/syncthing-with-rsync-not-preserving-ownership/14741
**Category:** Support
**Created:** [April 1, 2020, 10:42pm UTC](https://forum.syncthing.net/t/syncthing-with-rsync-not-preserving-ownership/14741 "2020-04-01T22:42:25Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![se45tr6yftyhb](https://forum.syncthing.net/user_avatar/forum.syncthing.net/se45tr6yftyhb/32/7007_2.png) [@se45tr6yftyhb](https://forum.syncthing.net/u/se45tr6yftyhb)
#### Post date: [April 1, 2020, 10:42pm UTC](https://forum.syncthing.net/t/syncthing-with-rsync-not-preserving-ownership/14741/1 "2020-04-01T22:42:25Z")

</div>

I rsync a file structure from e.g. `/home/fred/folder1` to e.g. `/home/me/sync`, where the latter is a Syncthing directory, and where the operation yields `/home/fred/sync/home/fred/folder1` (_sic_). I have set rsync to preserve ownership, so the owner of `/home/fred/sync/home` is - remains - root. However, once Syncthing transfers `/home/fred/sync/home` to another computer, that directory (‘home’) ends up being the user under which Syncthing runs on that other computer - say, ‘Trish’. But I need that owner to _remain_ root (because I then rsync it to the local filesystem).

What to do? I looked at [this forum post](https://forum.syncthing.net/t/running-syncthing-as-root/6316/7) and [this issue](https://github.com/syncthing/syncthing/issues/2012) but I understand them poorly - they’re too advanced for me. I hope that there is an answer, besides running Syncthing as root.

I suppose the short version of my query is as follows. _I use Syncthing with rsync and Syncthing is not preserving ownership._

---

<div class="post-metadata">

### Author: ![AudriusButkevicius](https://forum.syncthing.net/user_avatar/forum.syncthing.net/audriusbutkevicius/32/277_2.png) [@AudriusButkevicius](https://forum.syncthing.net/u/AudriusButkevicius)
#### Post date: [April 1, 2020, 10:57pm UTC](https://forum.syncthing.net/t/syncthing-with-rsync-not-preserving-ownership/14741/2 "2020-04-01T22:57:29Z")

</div>

Please see:

[https://docs.syncthing.net/users/faq.html?highlight=faq#what-things-are-synced](https://docs.syncthing.net/users/faq.html?highlight=faq#what-things-are-synced)

The following are _not_ synchronized;

- File or Directory Owners and Groups (not preserved)

There are workarounds, like giving the process magical capabilities via linux capability subsystem etc, but these are all undocumented advanced features for power users.

---

<div class="post-metadata">

### Author: ![se45tr6yftyhb](https://forum.syncthing.net/user_avatar/forum.syncthing.net/se45tr6yftyhb/32/7007_2.png) [@se45tr6yftyhb](https://forum.syncthing.net/u/se45tr6yftyhb)
#### Post date: [April 1, 2020, 11:04pm UTC](https://forum.syncthing.net/t/syncthing-with-rsync-not-preserving-ownership/14741/3 "2020-04-01T23:04:20Z")

</div>

Thank you. However: having spent months get my syncthing-with-rsync working - working apart from this problem - I’m not giving up now, especially since, for transferring stuff between my laptops, I really need this ability.

Would the following work? (I draw on [this webpage](https://linuxconfig.org/how-to-manage-acls-on-linux).)

`setfacl -m u:syncthingUser:rw /home/fred/NJ/Sync/Laptops`

= Allow the user ‘syncthingUser’ full access to that folder (but only that folder).

`setfacl -d -m u:syncthingUser:rw /home/fred/NJ/Sync/Laptops`

= Give user syncthingUser full access to everything _created in_ the folder.

And I will need (somehow) to run Syncthing as syncthingUser.

EDIT: I find that there is [Syncthing-acl](https://github.com/idistech/syncthing-acl), but it is in alpha. Perhaps I’m better off not using Syncthing but rather the following procedure.

1. Rsync my stuff to some folder (a non-Syncthing folder) using the script that does that and which I have already.
2. SSH into the other machine.
3. Rsync the stuff out, using another script I have already.

---

<div class="post-metadata">

### Author: ![AudriusButkevicius](https://forum.syncthing.net/user_avatar/forum.syncthing.net/audriusbutkevicius/32/277_2.png) [@AudriusButkevicius](https://forum.syncthing.net/u/AudriusButkevicius)
#### Post date: [April 1, 2020, 11:32pm UTC](https://forum.syncthing.net/t/syncthing-with-rsync-not-preserving-ownership/14741/4 "2020-04-01T23:32:08Z")

</div>

This has nothing todo with acls, acls are effectively permissions, they don’t permit changing ownership (ownership is not permissions).

Its probably easiest to run syncthing as the user you want to own the files.

---

<div class="post-metadata">

### Author: ![se45tr6yftyhb](https://forum.syncthing.net/user_avatar/forum.syncthing.net/se45tr6yftyhb/32/7007_2.png) [@se45tr6yftyhb](https://forum.syncthing.net/u/se45tr6yftyhb)
#### Post date: [April 2, 2020, 12:16am UTC](https://forum.syncthing.net/t/syncthing-with-rsync-not-preserving-ownership/14741/5 "2020-04-02T00:16:42Z")

</div>

> [@AudriusButkevicius](#):
>
> Its probably easiest to run syncthing as the user you want to own the files.

Thanks, but since what I want is a partial mirror of my filesystem, the desired ownership _varies_ by item. Also: the project I mentioned _is_ designed to solve exactly my problem. Or so it seems to me. Perhaps I misunderstand.

Anyhow, I’ll go the SSH route.

---

<div class="post-metadata">

### Author: ![calmh](https://forum.syncthing.net/user_avatar/forum.syncthing.net/calmh/32/15311_2.png) [@calmh](https://forum.syncthing.net/u/calmh)
#### Post date: [April 2, 2020, 5:51am UTC](https://forum.syncthing.net/t/syncthing-with-rsync-not-preserving-ownership/14741/6 "2020-04-02T05:51:20Z")

</div>

Syncthing doesn’t _sync_ ownership or groups - ever, no matter what permissions you grant it.

There is a feature to set ownership of synced items to the same as the parent directory. This does require root or a couple of capabilities to do the chown.

---

<div class="post-metadata">

### Author: ![system](https://forum-uploads.syncthingcdn.net/original/2X/0/0b50e0a202b22ae6a67190759e8c868805b8ed9f.png) [@system](https://forum.syncthing.net/u/system)
#### Post date: [May 2, 2020, 5:51am UTC](https://forum.syncthing.net/t/syncthing-with-rsync-not-preserving-ownership/14741/7 "2020-05-02T05:51:24Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
