sync sub folders belonging to different users?

Is there a way to sync a folder which contains sub folders that belong to multiple Linux users?

I have already successfully installed syncthing onto two linux servers and swapped the keys on them so that they can talk to each other.

One of them is a samba server with multiple users able to read/write into their own subfolder from Windows PCs. I would like to sync the entire thing over to the other linux server. I am happy to add the users on server 1 onto server 2 if that helps.

On both of them the syncthing is started automatically by systemctl as a service. They are both running Debian 10.

thanks, DNJ

There is an option to set ownership of things to that of the containing folder (check advanced config for the folder). The use case is for your situation, so I think the answer is yes – set that option and sync the top level folder.

Note that the ownership copying is done on the receiving side, so you’ll need to create the user lever folders with the right ownership there once and for all. Or chown them afterwards.

I have decided that this is the wrong solution. I was really struggling with permissions.

What I have done is disabled the daemon running as user “syncthing” and deleted the user account. Then I did this:-

systemctl enable syncthing@normaluser1.service

systemctl start syncthing@normaluser1.service

I did this on both machines and set up sharing of normaluser1 subfolders.

I haven’t yet tried the same thing with user2 and user3, but I think that it will work and it seems cleaner. I know that each user will need a different tcp port number in their individual ~/.config/syncthing/config.xml but that’s fine.

The instructions I saw kind of (but not exactly) seem to imply that syncthing should be run as a system user if you want it daemonised (for example on a server), but my server seems to be quite happy to daemonise it as a normal user and it starts up and syncs if I reboot the server without needing to log in.

1 Like