Syncthing setting incorrect permissions on NAS

Hi! I’m running Syncthing on my UnRAID NAS. For some reason, when I change a file on a different device that is then synced over to the NAS, Syncthing will not apply the correct permissions.

For example, this is a file with the correct permissions applied on the NAS:

-rw-rw-rw- 1 nobody users  988070 Jul 20 07:00 demoA.txt

In comparison, when I sync over another file with Syncthing, this is the result:

-rw-r--r-- 1 nobody users  988070 Jul 20 07:00 demoB.txt

The ownership information is correct (nobody:users), but the permission is wrong. It should be 666 for files and 777 for directories. If Syncthing sets 644, then users of the NAS will not be able to edit the file, as it belongs to nobody. Is there a way to tell Syncthing to use 666 for incoming files?

“Ignore permissions” is checked for the shared folder.

Found the answer… that’s what I get for not searching a bit more. (To be clear I did search but most of the threads that came up were about permissions conflicts because of syncing, not setting the default permission for folders and files.) Sorry everyone!

See: Force syncthing to set same permissions for all files? - #2 by calmh

The solution as outlined in that thread is to just set umask to 0. Because umask is subtracted from the default of 777 for directories and 666 for files, this gives the intended result. Make sure PUID and GUID is set to nobody and users respectively, if you are running UnRAID.

1 Like

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