Writing access for an NTFS network disk!

First, I am very new to Ubuntu! I set up the next cloud and with the default data location it works fine. Then I decided to move it to an external disk that I access through my home network using an IP address. I mounted the disk using CIFS (it took me hours to figure out that I must mount it in /media/ directory not /mnt/ for nextcloud to have access) in /media/ folder.
Now this is the error I get:

Data directory (/media/…/data) is readable by other users
Please change the permissions to 0770 so that the directory cannot be listed by other users.

The problem is that CIFS does not provide chmod protocol and my hdd is in NTFS (my router does not support ex3/4). I couldn’t get ntfs-3g to mount the network disk. I appreciate any help! :blush:

it is possible but it is quite an intricate issue since there are different access-models involved.
NTFS is a microsoft filesystem (manages filestructures on a disk) and CIFS is a (microsoft) network-protocol. ntfs-3g is a (linux-)filesystem utility that allows access to ntfs-filesystems (on a local disk).
so your router mounts the ntfs-disk with the defined access-settings (imagine about 50 different permissions, inheritance settings etc.) then your router’s cifs-daemon allows access to that disk with its own network-access-settings (if you “add” those perms, the lowest has precedence, eg if the network-daemon allows to write but the local disk does not, writing is not possible). eg. A can read, B can read/write, unknown has no access etc. the users that can obtain those perms are either local (to the ntfs-filesystem; eg user-accounts on the host it resides on) or network, ie in a directory-service (windoze-server with LDAP; “domain”, “active directory”, …)
when a network-host wants to access your router’s cifs daemon (or rather, the ressources it offers), it uses the CIFS-protocol and supplies it with a username/pw-combo, and the cifs-daemon chaecks and maps all that (and some other stuff) to its permission-structure.
because of that and since windoze and unix/linux use a completely different permission-structure, it is not possible to to just cifs-mount a ressource on a linux-host and do chown or chmod with its local users.
there’s lots of documentation on this which you (probably) have to read, i’ll try to give you a rough outline:
-look for documentation for cifs-mount and ntfs for your distro (eg manpage: http://manpages.ubuntu.com/manpages/wily/man8/mount.cifs.8.html ) and howtos
-you’ll probalby have to install cifs-mount or cifs-utils (pkg-name like that) on your linux-host
-you might have to create the same user and password on your router (which os?) and linux-host to access the ntfs-disk over the network
-play around (test) with the mount-command on your linux-host and when it works, put that config into your /etc/fstab
one line i use to access a resource in ADS:
//windoze-server-name/dept-4$/dept-4/folder /mnt/doze cifs noauto,user,credentials=/root/creds.smb,uid=,vers=1.0 0 0
fstype:cifs
extra-cifs-options:

  1. credentials: textfile that contains the windoze-user-info in A=B-pair-lines; eg
    username=USER (username on your router)
    workgroup=WORKGROUP (ADS/local on your router; might be omitted)
    password=PASSWORD (yes, cleartext-password of user on your router)
    i think it has to be owned and readeable only be root
  2. uid is the linux-username of the user that is allowed to mount this, you can omit it if it is mounted automatcally (auto) or only by root
  3. vers= is the cifs-version used to connect. if you get version-errors (mount -v … will state them) adjust it with that parameter

GOOD LUCK!

1 Like

If you use the external disk only for Nextcloud, I’d consider to use a native Linux filesystem. In case your server breaks and you need to access the data, you can use Linux-LiveCDs on any system to read the disk again. There are even some experimental drivers on Windows to read ext4 or btrfs directly.