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

Here's the relevant smb.conf section:

[someshare]
        path = /somewhere
        read only = No
        writeable = Yes
        guest ok = Yes
        create mask = 0777
        security mask = 0777
        directory mask = 0777
        force create mode = 0777
        directory security mask = 0777

Say user1 creates a directory on that share. It's permissions will be: drwxr-xr-x and the owner will be user1.

While user2 can access the directory created by user1, he receives a permission error when trying to create a file on that directory.

To me it seems weird that the permissions of the dir created by user1 aren't 777 as specified in smb.conf...

Edit: I forgot to mention a weird error that pops up in the client log when the permission is denied:

[2009/06/24 03:02:18,  0] smbd/trans2.c:unix_filetype(1130)
  unix_filetype: unknown filetype 0

What am I missing?

share|improve this question

3 Answers 3

up vote 2 down vote accepted

You're missing:

force directory mode = 0777

Also, you really want to use 0666 for force create mask. Probably no good reason to force the execute bits.

share|improve this answer
    
Yay, that solves the directory part. I removed all masks and I left only [force] create/directory modes to 0666 for create and 0777 for directory. However, files are being created with 0644. Any ideas why? –  Ivan Jun 24 '09 at 23:46
    
I found it: force security mode ... I thought that setting was only supposed to work for Windows clients... –  Ivan Jun 25 '09 at 0:43

I'm guessing that this is the permissions in smb.conf being used as a mask along with those specified in the user's profile, the two will get anded together rather than ored so if samba says 777 and the user's mask is 755 then you'll get 755 as a result.

The permission denied message that you see is simply agreeing with the permissions that you are seeing recorded against the files. The extra error message you see I'm not sure about though.

share|improve this answer
    
I tried setting the user's umask to 0000 for testing purposes, and samba still gives those user's permission 0644. I also tried setting the umask for root (well, not really root, rather for the admin user in Ubuntu), to no avail. –  Ivan Jun 24 '09 at 23:55

Changing permissions to 777 ALWAYS makes me nervous, even if this is a home project. Instead, add all your samba users to a group (like samba_user), then in smb.conf add the line:

force group = samba_user

Naturally, you must also chgrp all the necessary folders as well. Then you can set finer grained permissions, allow people to do their thing in other people's folders, and your server isn't turned into a free for all. Someone wants to have a private folder? Just change that folder's group from samba_user back to the user's private group.

share|improve this answer

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.