> /var/lib/samba/usershares has its group owner inappropriately set to "users", which is not allowed

  1. Issue

    dolphin can’t share any directories because

    I’ve never been able to configure samba. It’s never worked in any distribution I’ve used, either. I’m trying to take a stab at it though, and I’m rather stuck.

  2. Attempted solution

    1. So I invoked dolphin as the superuser:

      su -c 'dolphin'
      

    2. And changed users to sambashares:


    3. However, reloading ./usershares with su -c dolphin again demonstrates that somehow either this configuration is not being saved, or is being undone when saved:


Created samba and sambashares
Added $USER to them


rokejulianlockhart@RQN6C6:~> hostname -d
Home
rokejulianlockhart@RQN6C6:~>

rokejulianlockhart > Home
users > sambashares

image

image

image


If I don’t touch the

Domain or Workgroup

input form, that error doesn’t occur, and it saves, but changing users to sambashares just reverts it to users.

man smb.conf says:

USERSHARES
       Starting with Samba version 3.0.23 the capability for non-root users to add, modify, and delete their own share definitions has been added. This capability is called
       usershares and is controlled by a set of parameters in the [global] section of the smb.conf. The relevant parameters are :

       usershare allow guests
           Controls if usershares can permit guest access.

       usershare max shares
           Maximum number of user defined shares allowed.

       usershare owner only
           If set only directories owned by the sharing user can be shared.

       usershare path
           Points to the directory containing the user defined share definitions. The filesystem permissions on this directory control who can create user defined shares.

       usershare prefix allow list
           Comma-separated list of absolute pathnames restricting what directories can be shared. Only directories below the pathnames in this list are permitted.

       usershare prefix deny list
           Comma-separated list of absolute pathnames restricting what directories can be shared. Directories below the pathnames in this list are prohibited.

       usershare template share
           Names a pre-existing share used as a template for creating new usershares. All other share parameters not specified in the user defined share definition are copied from
           this named share.

       To allow members of the UNIX group foo to create user defined shares, create the directory to contain the share definitions as follows:

       Become root:

           mkdir /usr/local/samba/lib/usershares
           chgrp foo /usr/local/samba/lib/usershares
           chmod 1770 /usr/local/samba/lib/usershares

       Then add the parameters

                usershare path = /usr/local/samba/lib/usershares
                usershare max shares = 10 # (or the desired number of shares)

       to the global section of your smb.conf. Members of the group foo may then manipulate the user defined shares using the following commands.

       net usershare add sharename path [comment] [acl] [guest_ok=[y|n]]
           To create or modify (overwrite) a user defined share.

       net usershare delete sharename
           To delete a user defined share.

       net usershare list wildcard-sharename
           To list user defined shares.

       net usershare info wildcard-sharename
           To print information about user defined shares.

I don’t know whether /usr/local/samba/lib/usershares is mandatory or if you can use /var/lib/samba/usershares as well.