Samba, TrueNAS, Nextcloud - permissions for data

Hello,

I am trying to set up Nextcloud on my server.
I am running Proxmox and inside that there are two VMs True NAS with pool and Ubuntu that hosts my Nextcloud docker instance.

In True NAS I have created a samba share instance.



After that, I have created a user:

After that, I mounted it inside my Ubuntu:

//192.168.50.36/nextcloud   /nextcloud    cifs  credentials=/etc/samba/user,iocharset=utf8,uid=1000,gid=1000,noperm 0 0

then I am trying to create my nextcloud instance with below docker compose:

version: '3'

volumes:
  database:
  config:


services:
  nextcloud-app:
    image: lscr.io/linuxserver/nextcloud:latest
    container_name: nextcloud-app
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/Warsaw
    volumes:
      - config:/config
      - /nextcloud/data:/data
    ports:
      - 8443:443
    restart: unless-stopped

  nextcloud-db:
    image: mariadb
    restart: unless-stopped
    container_name: nextcloud-db
    volumes:
      - database:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=password
      - MYSQL_PASSWORD=password
      - MYSQL_DATABASE=nc
      - MYSQL_USER=nc

and after providing info about mariadb to my nextcloud I am seeing:

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

I have tried to run

chmod 0770

from ubuntu on created /data folder inside samba share
from truenas on /data folder
from nextcloud container on /data folder

but no luck

What I need to do to make it work properly?

Trying using ls -la or a similar tool to clarify the exact ownership and permissions of each directory as-is.
You can use this information to make corrections or share the exact output here.

Either way, once you know the ownership and permissions you’ll be able to resolve it. :heart:

Since your data is hosted on Truenas you probably want to look through their documentation (and Proxmox) since those are where the underlying directores live.

I know who own it, I just don’t know how to change it, so Nextcloud will not complain. For now, I disabled checking it on the config.php, but for some reason Nextcloud is so freaking slow.

I cannot speak to TrueNas and proxmox, but ls -la will explain what the permissions are

You’ll need to learn how Linux permissions work or it will continue to haunt you forever until you address it. Honestly, not hard to learn with a little internet searching and note taking.

Thankfully, there are endless tutorials on understanding permissions and how to use chown chmod chgrip and other such tools to fix things. You can do it!!! Literally thousands of people have asked this same question and found the answer. You got this!

I kinda now what’s going on, I was just hoping since it should be popular problem within nextcloud for people who use truenas, to have that problem. I just cannot update permissions of the samba share on ubuntu machine to 0770 so I was hoping somebody knows why and how to fix it :slight_smile: but I guess you are right on that. I should look for help not here but on TrueNAS forum

In that case share the link here so we can follow along. :slight_smile:

1 Like