Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm almost ready to tear my hair off (At least i have a decent amount of it :P)

I built a Ubuntu 11.04 box at work for all the development team to work on it. Everything working fine so far but there is a small problem about default file permissions.

I've been searching for over 2h how to set the default permissions for files and folders when someone create something on the samba share.

So far, from my linux machine to the linux server through SMBFS, it works fine for directories and they are tabbed DRWXRWX--- which is what i want.

The files tho are not set to -RW-RW---- like i want. The darn group write never wants to light up.

I've tried a combination of all the possible configuration flags for create mode, create mask, force create mode force security mode, nothing works. So i finish by asking here.

Relevant config file section:

[homes]
comment = Home Directories
browseable = yes

# By default, the home directories are exported read-only. Change the
# next parameter to 'no' if you want to be able to write to them.
read only = no

# File creation mask is set to 0700 for security reasons. If you want to
# create files with group=rw permissions, set next parameter to 0775.
#   create mask = 0660
   create mode = 0660
#   force security mode = 0660
#   force create mode = 0660

# Directory creation mask is set to 0700 for security reasons. If you want to
# create dirs. with group=rw permissions, set next parameter to 0775.
#   directory mask = 0777
#   force directory security mode = 0770
#   force directory mode = 0770
   directory mode = 0770

valid users = %S
share|improve this question
    
An all too common problem. Used to know how to fix that too. –  Matt Sep 29 '11 at 12:03
    
Update, still not working, tried also to set inherit permissions and it still fails, i think i'll just drop the idea and force my developpers to chmod 777 the directories they want writable... –  Mathieu Dumoulin Sep 29 '11 at 12:48
add comment

2 Answers

It sounds like you may have already tried this combination but my samba shares are set up like this, and new files and directories are created with the correct permissions if that's any help:

[public]
comment = samba share
path = /path/to/my/share
browseable = yes
force group = smbuser
create mask = 0660
directory mask = 0660
share|improve this answer
    
Nope, tried it at least, but was pretty sure it wouldnt work. Thanks anyway... –  Mathieu Dumoulin Sep 29 '11 at 12:22
add comment

Use force create mode. All the bits set in force create mode will be forced on in every file created. This only affects file create -- if you want to prevent someone from turning any permission flags off after a file is created, use force security mode as well.

share|improve this answer
    
Tried it already, still doesn't work, but i've been reading something about Windows clients not sending the right permissions by default. For example, there seems to be something about the fact that windows sends group write permissions as readonly, so by default it will not map it on the linux server. But then i tried the force create mode and it still doesn't set the bits. Still trying this morning... –  Mathieu Dumoulin Sep 29 '11 at 12:45
    
To confirm, you set a bit in both force create mode and force security mode, and Samba created a file without that bit set? –  David Schwartz Sep 29 '11 at 12:48
    
Exactly, i tried setting everything to 777 in create mode, create mask, force create mode and force security mode and it still created the file as -RWXR-XR-X, can you believe that? –  Mathieu Dumoulin Sep 29 '11 at 12:49
    
No sorry mistake, retested it, it gives -RWXR-XRWX... what the hell is that. it gives write to world and not to group? –  Mathieu Dumoulin Sep 29 '11 at 12:51
    
I'm assuming that's a typo and you meant 0777. If you really entered 777 by mistake, that's your problem, since 777 = 01411 –  David Schwartz Sep 29 '11 at 12:55
show 7 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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