So I'm trying to set up a password protected samba share with permissions. And I believe I have set everything up decently correctly and the samba share works as intended.

But I'm having a slight problem regarding a local user accessing and using the same directory as the share. Anything the user creates will have it's primary group (another group than file-server-admin) as the owner of it and it'll be uneditable by any other users on the samba share even though force group is used. I understand that this is probably the intended way it's supposed to work but is there anyway to force group usage of a certain user inside a certain directory of a linux system or will I have to change the primary group of that user? Or is there any other solution?

I am using ubuntu server 20.04 if that will help

And this is the config for my samba share

  comment = file-server-share
  path = /mnt/omega
  valid users = @file-server-admin
  browsable = yes
  writable = yes
  read only = no
  force group = file-server-admin
  create mask = 0664
  force create mode = 0664
  directory mask = 0774
  force directory mask = 0774

1 Answer 1


Have you tried it with force user additionally?

If the force user parameter is also set the group specified in force group will override the primary group set in force user.

EDIT: Maybe this will help https://serverfault.com/a/445096/853288

  • Functionality wise this does seem to work, but now any file or directory created by any user will have the user owner of the force user specified, and I lose the information of who created the file. Also I think it won't work if another user on the local machine creates anything on the share, so I think I'm looking for a more robust solution Nov 7, 2021 at 23:19
  • Hmm.. can you set persmissions via the Windows GUI on the Share? There was an ACL with CREATOR_GROUP to force that behaviour. - Probabbly also via setfacl. But you have to know what to do :-)
    – user492934
    Nov 7, 2021 at 23:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .