Mounted Drive Permission Conundrum

Nextcloud 13.0.5
Ubuntu 18.04
Apache 2.4.29
PHP version 7.1.20

I am mounting an WD EX2100 drive using this command:
sudo mount -t cifs -o username=USER,password=PASSWORD //192.168.1.253/nextcloud /var/www/html/nextcloud/data

With that, I get this error in the web gui:
Your data directory is not writable
Permissions can usually be fixed by giving the webserver write access to the root directory. See Installation wizard — Nextcloud 13 Administration Manual 13 documentation.

So then I pass a username to it:
sudo mount -t cifs -o username=USER,password=PASSWORD,uid=www-data, //192.168.1.253/nextcloud /var/www/html/nextcloud/data

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

folder permissions (when mounted):
image

Is there any in between?

  1. I have tried other directories. Making new ones and mounting the drive there, etc. I tried /media/nextcloud/ and a couple others.
  2. Owner and write permissions are always good…

I’m lost

Have you tried setting the permissions as recommended on the WD drive? The way ls -l displays it, that 0770 translates to:
-rwxrwx---
If you can run commands on your WD, you can set those permissions with chmod:
chmod --recursive 0770 /media/nextcloud/data.

If you’re not able to do that on the WD device itself, then we can change some mount options so that your web server sees fake permissions that will satisfy it. man mount.cifs lists a few options we can use here.
Try adding these to your list of -o options in the mount command:
nounix,file_mode=0770,dir_mode=0770

You’re the man, thank you! That worked. I have been trying to figure this out for two days.