Results 1 to 3 of 3

Thread: Samba share per user

  1. #1
    Join Date
    Aug 2011
    Beans
    16

    Samba share per user

    Hello.
    Is it possible to configure samba to automatically create shares for each (system) user (//server/userShare)? Do I have to create custom script which creates share for user and (somehow) inject it into system to listen user creation events (after useradd or adduser)?
    Best regards, Dawid.

  2. #2
    Join Date
    Dec 2009
    Beans
    5,375

    Re: Samba share per user

    There already is such a thing in smb.conf - it's just commented out.

    Uncommented it looks something like this:
    [homes]
    comment = Home Directories
    valid users = %S
    read only = No
    create mask = 0700
    directory mask = 0700
    browseable = No
    It doesn't work like a normal samba share though. It's not a browseable share ( you will notice there is no path in the share definition). The Linux client would access the share by name:
    Code:
    smb://server/user-name
    When he does it will create a samba share "on-the-fly" of his corresponding home directory on the server.

    You can also set this up so that you don't have to have a home directory by setting up a separate directory say .. /home/Samba-Servername. Then have the [homes] share specify that parent directory:
    [homes]
    comment = Home Directories
    path = /home/Samba-Servername/%S
    valid users = %S
    read only = No
    create mask = 0700
    directory mask = 0700
    browseable = No
    You would then have to create sub-directories named for every remote user ... /home/Samba-Servername/morbius, etc ...
    EDIT: you would also have to change ownership of the named subdirectory.
    Last edited by Morbius1; January 27th, 2012 at 10:09 PM.

  3. #3
    Join Date
    Aug 2011
    Beans
    16

    Re: Samba share per user

    Hey.
    Thanks for the replay. It is working like a charm
    Best regards, Dawid.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •