Results 1 to 4 of 4

Thread: sharing samba users

  1. #1

    sharing samba users

    How can I assign multiple users to a samba share? So let's say i have a share /var/www/stuff that I need to have ownership to www-data user but also to allow certain samba users to have write access as well. So let's say I have samba users, Bill, Ben, Jill, Lily, to /var/www/stuff I need to have www-data to have ownership of it but also to have Bill and Jill to be able to access it as well. Can this be done? If so, how?

  2. #2
    Join Date
    Nov 2008
    Metro Boston
    Kubuntu Development Release

    Re: sharing samba users

    One trick I've used in the past is to run Samba with the "force user" and "force group" options. This tells Samba to use a specific user or group for all file transactions at the operating system level regardless of the identities of the logged-in users. I used this for a company which wanted to limit its accounting system to a specific group of users. In this case we didn't care which user wrote a specific file to the system (the software handled that) and wanted to insure all of them could access every file.
    If you ask for help, do not abandon your request. Please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  3. #3
    Join Date
    Mar 2007

    Re: sharing samba users

    Create a group, make sure all users are in it then make sure you force group permissions.
    There are probably a bunch of ways to accomplish this depending on your needs.

  4. #4
    Join Date
    Sep 2011
    Behind you!
    Ubuntu 20.04 Focal Fossa

    Re: sharing samba users

    I would utilize groups. Users can be in multiple groups. You can have "grp_users" assigned to the share for full read/write capability which allows all users to connect to the share and then limit permissions at the file/folder level. Here is a very simplified overview.

    Example of Group (users):
    grp_users (jon, joe, mary, jane)
    grp_providers (jon, joe, jane)
    grp_accounting (mary)
    grp_nurse (joe, jane)
    grp_doc (jon)
    Folder structure (owner of folder):
    share (grp_users)
     |--> providers (grp_providers)
     |--> accouting (grp_accounting)
     |--> users (grp_users)
         |--> jon (jon)
         |--> joe (joe)
         |--> mary (mary)
         |--> jane (jane)
    Last edited by LHammonds; January 14th, 2021 at 05:28 AM.

Tags for this Thread


Posting Permissions

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