SaMBa Permissions

I’m not new to OSMC, Linux or Windows. That said, I’m sure there’s a lot I can learn.

I installed SaMBa on my OSMC by going into the Apps Add-Ons, selecting SaMBa and installing it. No problem there. I SSHed into the box and modified the smb.conf file (I know, not the right procedure and I should be using the local file). Regardless… the only thing I changed was the shares mount point to /media/VideoVol1 (my USB mounted video drive). I set the owner and group (chown osmc /media/VideoVol1, same for chgrp). I changed the mods to 777. It’s on my home network and wide open is fine with me.

The default, in SMB.CONF is security=user, for the share it’s browsable=yes and read only=no, valid user=osmc

I’ll attache the smb.conf below but it’s the default except for redirecting the included osmc share.

I have an ubuntu machine handling downloads. On that box I issue “sudo mount // /mnt/OSMC -o username=osmc”. This works and I can browse the directory. However, when I try to write to it, I get permission denied.

Any ideas why? How can I troubleshoot this? Any suggestions on how to fix it?

Thanks in advance.

Here is an example of the output of an ls -al of the movies:

-rw-rw-rw- 1 osmc osmc 1274291456 Sep 5 15:07 Despicable Me 3 (2017) [HDRip.XviD.AC3-EVO].avi

Here is the smb.conf file:

osmc@OSMC-8:/media/VideoVol1$ cat /etc/samba/smb.conf

# If you require a fully custom smb.conf create smb-local.conf instead of editing smb.conf so your
# configuration will not be overwritten by samba upgrades. You can use smb.conf as a template by
# copying it to smb-local.conf then removing the config file line below in the new file. If you only
# need to add some additional shares see smb-shares.conf below for a simpler way to do this.

    config file = /etc/samba/smb-local.conf

    workgroup = WORKGROUP
    follow symlinks = yes
    wide links = no
    unix extensions = no
    lock directory = /var/cache/samba
    load printers = no
    printing = bsd
    printcap name = /dev/null
    disable spoolss = yes
    log level = 1
    map to guest = bad user
#   usershare template share = automount template

# Automount template disabled to work around a samba bug causing crashes accessing external drives.

    read raw = Yes
    write raw = Yes
    strict locking = no
    min receivefile size = 16384
    use sendfile = true
    aio read size = 2048
    aio write size = 2048
    socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=131072 SO_SNDBUF=131072

    browsable = yes
    read only = no
    valid users = osmc
    path = /media/VideoVol1
    comment = OSMC Home Directory

[automount template]
    browseable = yes
    -valid = no
    valid users = osmc
    path = %P
    hide files = /$RECYCLE.BIN/System Volume Information/desktop.ini/thumbs.db/

# Add custom shares in smb-shares.conf instead of editing smb.conf so they will not be
# overwritten by samba updates. You can only add new shares to smb-shares.conf, not change
# the default shares or global options. If you need full control see smb-local.conf above.

include = /etc/samba/smb-shares.conf

deleted (I figured out how to format the smb.conf file)

You should not have done that, all automounted drives are shared by the default smb.conf. So I suggest you delete the smb.conf, remove samba server and reinstall it to get the clean smb.conf.

Or I could just copy the smb.conf.original to smb.conf. Which, sadly, doesn’t fix the problem.

I did learn about the “hide files” line from the automount section (which I never deleted). That’s a nice trick.