Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Samba default file create mode for certain shares 1

Status
Not open for further replies.

shadedecho

Programmer
Oct 4, 2002
336
US
Ok, I am trying to get it so that certain users who login to certain Samba shares on my linux (rh6.1) server will by default be creating files with "0775" permissions. Right now, what is occuring is that new (or overwrited) files are given 764 permissions.

I should also mention that I successfully changed the directory permissions, meaning the permissions for when a user creates a directory in a share. I set that to "2775", so that it would have the sticky bit set, so that even in sub directories that a user creates, the files in that folder will by default get the group of the directory its in... this allows all our login users to be creating "collaborate-friendly".

So, in /etc/smb.conf, I saw where I could put those two configs in, on a per share basis.

here's what I have

[web]
comment = Web Root
path = /home/httpd/html
write list = {...}
read only = No
guest ok = No
create mode = 0775
directory mode = 2775

the {...} in write list actually contains a comma-delimited list of users we have in that share, as well as the @webgroup which specifies that all those people in that group are included (I assume, anyway).

I also tried changing "create mode" to "create mask", it had no effect.

Any ideas on what I can do to get around this? I want all files created (through a samba connection) by users of a share to default to 0775 permission. Thanks!
 
Be aware that after samba has finished processing its permissions, it will then process the "servers normal" permissions as in Unix file permissions.

It is a bit detailed to go into but you "can" use force create mode that will force mode bits on when files are created under the share, use it like:

force create mode = 0755

Which will mean that created files will have "at least" a mode of 0755 (RWXR-XR-X) but will be overridden by higher directives.

So check OS level perm's on directory and try force create mode.

I hope this helps

Good Luck
Laurie.
 
hey, awesome, "force create mode = 0775" worked! Thanks!

Can you tell me, what was it that might have been overriding that before without the "force" in there? I didn't set up this linux server, I am new to administering it, so I'm trying to figure out a lot of ins and outs of it. Any thoughts on where I might check for something that would have been defaulting something non-standard like 764?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top