Create SMB/CIFS share on my NC server and access from web to this share simultaneously

Hi.

I have a Windows domain.
I’m joined my NC 18 server to Windows domain with sssd package.

I installed SAMBA on my NC server and created a folder for my domain users:

cat  /etc/samba/smb.conf
..
 [123]
  comment = 123
  path = /home/data/123
  admin users = 'Domain Admins'
  locking = no

  browsable = yes
  writable = yes
  guest ok = yes
  read only = no
...

So, how I can make this folder accessible via the web too, so that my domain users can create folders and files via the web with their own domain permissions?

Thx in advance.

Guys ?
Anyone ?

Hi, you should use the external storage app to mount this directory to Nextcloud. Best is to use the mount type local.

Setting the correct perms will be very hard (if not impossible). NC uses www-data:www-data but CIFS/windoze uses a completely different scheme. Also, you might be in for some interesting errors because for CIFS/windoze FILE==file but for *nix they are different.
you can try to mount -o bind the dir(s) somewhere and see what happens.
GOOD LUCK!

You should make the SMB share on a Windows server and then mount it as external storage in Nextcloud with each user mapping it with their individual AD credentials. Then permissions will be correct.

Here is an example how a working fstab entry looks like: vm/smbmount.sh at 4bd5d3a22f2c5b05fca0ef701ac2cd502f4778b1 · nextcloud/vm · GitHub

cool, very nice script! if i ever need it i’ll copy like like hell from it.
i haven’t studied it really in-depth but i think there might be some troubles in AD/“Domain”-environments (not only b/c windoze update constantly breaks things). i’ll be glad to learn the opposite, though.
it might be worth noting to the OP that he (probably) does not need a full-featured samba-server but only some kind of cifs-utils/smbmount-pkg.

from this i gleaned that domain-perms were to be retained pervasively - to which i guess my first answer still applies.

I am not sure if he wants to create a samba server on the same server where the Nextcloud is installed on. For this usecase there is the smbserver script. (But it doesn’t cover AD integration). vm/smbserver.sh at master · nextcloud/vm · GitHub
And here are some docs about it: https://szaimen.github.io/Nextcloud-NAS-Guide/docs/smb-server

BTW: it is also ppssible to mount a smb-share with the smbmount script and then use that mountpoint in the smb-server script to make it available via smb. :slight_smile:

But as I said: it doesn’t cover AD integration.

Thx, guys.