Score:0

Unable to access samba user restricted share from Windows 10

ng flag
Ben

Server: Debian 10, SAMBA v4.9.5 Client: Windows 10 21H1

I'm trying to create two Samba shares. One is open access to any user and doesn't request a password. The shared folder is /media/NAS. The other defines a username in its settings and requests a password. It's shared folder is /media/NAS/films.

So the second share points to a sub folder of the first share. It is intended to be connected to by my TV for sharing media from that folder.

The user defined as having access to this second share has had its account created with the following steps:

  1. useradd -s /sbin/nologin mediauser
  2. usermod -a -G mediaUsers mediauser
  3. usermod -g mediaUsers mediauser
  4. smbpasswd -a mediauser

The password for both the user account and samba are the same.

With these settings I can connect to the first share with read/write access just fine, but the second keeps coming back with 'You do no have permission to access this share'.

In a twist that I do not understand, if I only have the first share enabled (I comment out the second share in the conf file and restart samba) it works OK, but as soon as I add in the second Films share I can no longer access the first share. I also see a new share appear called mediauser which contains a bunch of profile stuff. Any clues why this is happening?

I've provided various bits of config files and ls -l outputs below. Many thanks.

smb.conf:

[global]
   workgroup = WORKGROUP
   interfaces = 192.168.54.0/24 enp1s0
   bind interfaces only = yes
   log file = /var/log/samba/log.%m
   max log size = 1000
   logging = file
   panic action = /usr/share/samba/panic-action %d

####### Authentication #######
   server role = standalone server
   obey pam restrictions = yes
   unix password sync = yes
   passwd program = /usr/bin/passwd %u
   passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
   pam password change = yes
   map to guest = bad user
   usershare allow guests = yes

#======================= Share Definitions =======================

[homes]
   comment = Home Directories
   browseable = no
   read only = yes
   create mask = 0700
   directory mask = 0700
   valid users = %S

[NAS]
   comment = NAS Storage
   path = /media/NAS
   browseable = yes
   read only = no
   guest ok = yes
   create mask = 777
   force create mode = 777
   directory mask = 2777
   force directory mode = 2777

[Films]
   comment = Film Archive
   path = /media/NAS/films
   browseable = yes
   read only = yes
   guest ok = no
   valid users = mediauser
   create mask = 775
   force create mode = 775
   directory mask = 2775
   force directory mode = 2775

Folder Permissions:

drwxrwxr-x 158 nobody mediaUsers  4096 Jun 23 22:30  films
drwxrwxr--   7 nobody nogroup     4096 Jun 24 22:11  MP3
drwxrwxr--  14 nobody nogroup     4096 Jun 23 20:39  Pictures
drwxrwxr--  16 nobody nogroup     4096 Jun 24 21:59  Software
drwxrwxrwx  25 nobody nogroup     4096 Jun 24 08:50  Video

pdbedit output:

root@fileServer:/etc/samba# pdbedit -L
mediauser:1001:
Dennis Nolte avatar
us flag
are you trying to use the group mediaUsers for the films share? if so maybe the typo is already a problem. valid users = mediauser other than that valid users itself might need more checking.
Ben avatar
ng flag
Ben
Not in this instance no. mediauser is a member of mediaUsers so in my understanding should have access to the films folder under the group permissions. Please correct me if I'm wrong.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.