Permission Denied on any path I choose (FreeNAS)

If I try to create or use an existing directory on my FreeNAS (To replicate to another FreeNAS) I am met with permission denied.

So if I try to replicate for example /mnt/volume1 , or create a new directory (/replicationtest) Syncthing just comes up with the same error each time.


Sorry, but I don’t understand what error comes from where. Do you actually have error messages? Also, does syncthing have the relevant permissions in the directory you are syncing to?

Hey Jesse I’m no FreeBSD expert but it sounds like Syncthing don’t have permission to write to that folders. It can be that Syncthing is running under a different user name that don’t have access to that folders. So make sure your folders have the right permissions.

I found a guide that maybe helpful to you. They explain on that website how to set the correct permissions.

Hi There,

So I installed the add-on via the plugin logged in as root.

I’m not sure how to find what user Syncthing is running under. I would have thought by default it would of allowed itself access to the FreeNAS file system! :unamused:

When creating a new Sync on the config page, I am told mkdir Permission denied on /mnt/Volume1 I presume it is doing an mkdir as it cannot verify a directory called Volume1 because it does have rights thus by default trying to create one which of course it shouldn’t be doing!

I’ve gone back a directory to /mnt which gives a different response “/mnt permission denied” without the mkdir.

Indeed it does sound like syncthing is running as a specific user that does not have permission to the mount points in question. Exactly how this is intended to work can probably only be answered by the author of the FreeNAS package, or someone who uses it… :confused:

Last week I set up syncthing on FreeNas following the guide at the aforementioned link:

Read the comment after the guide, it may provide more insight.

Considering it was my first time working with FreeNas, I found the guide everything I needed it to be to get it to work. It’s all there, print it out, read it over, highlight the salient parts, drink a beer, and follow it :smile:

Hi, I spend considerable time trying to configure an already existing dataset to be synchronized to another server. The problem is/was that I did not want to change the ownership of the existing dataset. I followed the guide precisely, but I noticed a few things. I am running version 0.10.23. instead of changing the “Owner” of the dataset, I made the “syncthing” user member of the group which has all the rights to the dataset.

After that I was still getting permission denied errors. The resolution to the problem was the following:

  1. Follow the above guide, ( but do not change the owner of the dataset to syncthing, instead, after creating the “syncthing” user add “syncthing” user to the group which is already managing your dataset. Make sure the group has read/write/execute (777) privileges.

  2. Log in to the syncthing jail as described in the guide.

  3. Create a folder under the /media for your dataset to be mapped to

  4. Change the permission on the folder you just created to 777. (chmod 777 “yourfolder”)

  5. Go back to your Freenas interface and “Add a storage” to the jail corresponding to your syncthing_1. In the add storage window the “source” is the path to your existing dataset and the “destination” is the folder you created above /media/“yourfolder”

  6. Uncheck the “Create Directory” because this is already created and click OK.

  7. Now go to your syncthing interface, click on “Add Folder” and add the above /media/“yourfolder”

This should take care of the permission problems without compromising the existing permissions on the already existing dataset.

Changing permissions to 777 [rwxrwxrwx] is not advised, unless you want unauthorized users to have full access to the data. Permissions should be set to 770 [rwxrwx—], or, at most, 775 [rwxrwxr-x] (774 [rwxrwxr–] is also acceptable).

If it’s a CIFS share that is set up with Windows ACLs, make sure you create the folder from Windows, then symlink it via the GUI or CLI. You’ll know this is correctly set up if there is a plus sign “+” following the permissions [rwxrwxr-x+]. The plus sign indicates the folder is setup with ACLs.

Please note, if the share is to be used on Windows, permissions must be set to a minimum of 5, otherwise the file will not be able to be read from within Windows.

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