0

I managed to run ownCloud on my RaspberryPi 2 on Raspbian. Now I am trying to move the data directory to my NAS.

I already shared a folder on my NAS with CIFS and mounted the folder. This allows me to access the shared directory via the command line and manipulate entries. So that works. However, when opening ownCloud in my browser, I get the following error message:

Data directory (/home/pi/Cloud/storage) is readable by other users

Please change the permissions to 0770 so that the directory cannot be listed by other users.

So I tried to adjust the permissions in the /etc/fstab file, where I mounted the shared directory. This also worked out, but changes the owner from www-data to pi. With the result that ownCloud does not run at all, since the data directory has to be owned by www-data.

I mounted the shared folder by adding the following line to the /etc/fstab file:

//<NAS-IP>/<sharedFolder> /home/pi/Cloud/storage cifs username=<my username>,password=<my password>,uid=www-data,gid=www-data,dir_mode=770,file_mode=770,umask=0007 0 0

Which results in these permissions:

drwxr-xr-x 2 pi    pi    4096 Sep  2  23:15 storage

So the problem is that the data directory can be read by all users, but when I restrict the permissions, it is not owned by www-data anymore.

Does anyone have an idea how to fix this? It seems that I am so close to have ownCloud running, but I can't figure out this last step.

1

It sounds like your NAS supports unix extensions that are overriding your mount settings. The man page for mount.cifs notes that dir_mode, file_mode, uid and gid can be overridden by the server if it supports unix extensions (very likely if it is a Linux based NAS).

If this is the case you might be able to change the permissions on the folder directly. If that doesn't work try mounting with the nounix option to disable the extensions.

  • Thanks a lot. You were right, I had to change the permissions on the NAS directly. At first I created the folder as admin in the GUI of the NAS. But then I created it via SSH as the same user that I specified in my /etc/fstab/ file and now it works. I'm getting a different error now, but that is not related to permissions anymore :) – arne.z Sep 4 '16 at 9:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.