This question already has an answer here:

I would really appreciate any help you guys can give me with the problem im having. First of all, im pretty comfortable with command line but by no means an linux expert so I would appreciate some detail in any answers you give if possible. Thanks!!

I am trying to set up a file server running Ubuntu 14.04. I have a folder /files and within that I will be creating a few folders that will all be shared with different permissions. I have samba running and can access the shares from machines on my network. I have changed the the owner of the files directory to be my admin user and a new group I have created, for simplicity ill call it mygroup.

I have chown'd the /files directory to myuser:mygroup and then created new users in Ubuntu and added them to mygroup as there primary group. I have also chmod'd the files directory to 770 so that both my admin user and mygroup have full write access. I then have samba users for each group and allowed them access to my shares in samba (im using a GUI by the way but happy to get stuck in with command line if I have to).

All of this so far is good, my users can connect to the samba shares from both mac and windows and they can even create directories.

The problem is, if a user creates a new directory within the share, it is created with 755 permissions meaning that other users in mygroup can read and execute but cannot write to that directory.

I have read up about ACL and have run the following command against the /files directory:

setfacl -m "g:mygroup:rwx" /files/

Then if I run:

geftacl /files/ 

I can see group:mygroup:rwx in the list, and the same is true if I test the subfolders of /files. As far as I am aware, this should set the permissions for any new files being created within that directory to at least be x7x?

I have also seen within smb.conf the create mask and directory mask settings, I have tried changing these to be 0775 (and uncommented them) but it is still created with the same permissions.

Can anyone recommend anything else to try?

marked as duplicate by Eric Carvalho, Elder Geek, αғsнιη, v2r, Rohith Madhavan Dec 31 '14 at 9:01

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • @DavidEssery The link Requist provided is what you actually need. – JWilliamson Dec 10 '14 at 16:12

You want to change the users' umask

There is an answer describing it here.


$ umask 007

for each user.

  • Thanks cremefraiche!! That was what I was looking for. A little confusing at first because from looking at the results, it looks to not give execute permissions but i still seem to be able to open everythign so its looking good. FYI though it should be 007 because it works in reverse order, 770 would give other full access and deny user and group. Thanks very much for your help!!! – David Essery Dec 10 '14 at 17:17

Not the answer you're looking for? Browse other questions tagged or ask your own question.