I am trying to create a separete user for syncthing in Linux and experiencing some difficulties as far as access to the files goes. I would like to hear how others have done this.
CREATE USER AND GROUP
useradd --system --user-group --home-dir /home/syncthing --shell /sbin/nologin syncthing
CREATE SYNCTHING STORAGE
mkdir -p /home/syncthing chown -R syncthing:syncthing /home/syncthing
ADD ANOTHER USER TO syncthing GROUP
usermod -a -G syncthing another_user
SETTING UP PERMISSIONS
The fun part comes with permissions.
Computer A (RECEIVE ONLY): chmod -R 750 syncthing
- No modifications of the files are happening on the backup server. I need to read a execute the files.
Computer B (SEND ONLY): chmod -R 770 syncthing
- Here, the files are modified and sent to the backup server. I need writing permissions.
In theory, this should work. If I am a part of syncthing group, then I have rwx permissions for all the files. In practice, LibreOffice says that access to these files was denied. Now I cannot work with the files that are beings synchrnonized.
If I change ownership of these files and let them belong to the another_user, then it all works. Another_user doesn’t have to belong to the syncthing group to modify the files.
Now I add syncthing to another_user group to be able to acess the files that the other user modifies.
Any insight would be appreciated.