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:
- useradd -s /sbin/nologin mediauser
- usermod -a -G mediaUsers mediauser
- usermod -g mediaUsers mediauser
- 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: