Using Debian 10 Buster (specifically version Linux HAL 5.4.28-odroidxu4 #20.02.7 SMP PREEMPT Thu Mar 26 23:36:03 CET 2020 armv7l GNU/Linux)
I have an external drive mounted using an entry in /etc/auto.master, mounted to "/externaldrive".
On this drive, I currently have 3 configured shares:
/externaldrive/data shared as Data
/externaldrive/music shared as Music
/externaldrive/videos shared as Videos
'Data' is accessible by everyone, and this share is accessible from a Win10 machine and Android device.
'Music' is restricted to user 'media', and can successfully be logged into from a Win10 machine & Android device.
'Videos' is visible as a share, but cannot be logged into from either device, on the basis that the permissions appear to be preventing access.
What I don't understand is that the share config for Music & Videos is identical, as as the folder permissions for the 2 folders.
testparm doesn't appear to show any problems:
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Registered MSG_REQ_POOL_USAGE
Registered MSG_REQ_DMALLOC_MARK and LOG_CHANGED
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section "[Data]"
Processing section "[Videos]"
Processing section "[Music]"
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions
# Global parameters
[global]
idmap config * : backend = tdb
[Data]
force user = nobody
path = /externaldrive/data
read only = No
[Videos]
path = /externaldrive/videos
read only = No
valid users = media
[Music]
path = /externaldrive/music
read only = No
valid users = media
My smb.conf file is very basic:
[global]
workgroup = WORKGROUP
[Data]
path = /externaldrive/data
browsable = yes
writable = yes
read only = no
force user = nobody
[Videos]
path = /externaldrive/videos
valid users = media
browsable = yes
writable = yes
read only = no
[Music]
path = /externaldrive/music
valid users = media
browsable = yes
writable = yes
read only = no
And folder permissions are as follows:
drwxrwsrwx+ 5 root users 4096 Jul 15 2019 data
drwxrws---+ 7 root users 4096 Apr 23 08:17 music
drwxrws---+ 8 root users 4096 Apr 23 08:10 videos
I have tried applying chcon as per Samba - can access 1 share but not the other. Same config:
chcon -t samba_share_t /externaldrive/videos
However received the following error:
chcon: can't apply partial context to unlabeled file '/externaldrive/videos'
I have also tried applying it recursusively as per http://redhatshiju.blogspot.com/2011/03/configuring-samba-server-in-linux.html:
chcon -Rt samba_share_t /externaldrive/videos
Unsurprisingly I receive the same error message, but for every single file/folder within this folder.
Any idea what the problem is and how I can resolve it? It may be linked to the context issue, but I'm not familiar with it.