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.

I'm using ubuntu server 10 and I have this configuration in my smb.conf:

[www]
        comment = Web files
        path = /var/www
        browsable = yes
        writeable = yes
        create mask = 0775
        directory mask = 0775
        valid users = @developers

When I connect trough MAC OSX machine and create a file or directory the permissions are set with 755.

Why?

share|improve this question

3 Answers 3

The "create mask" simply means that samba users are allowed to modify those permissions up to the mask, meaning if you set it to 777, then the user can modify all bits. This is not the same as unix file masks. Your setting is 0775, meaning that users can modify the permissions on User (rwx), Group (rwx) and Other (rw). This doesn't mean that the files will be created with those permissions, just that the user can use those permissions. To force a set of permissions, use something like:

security mask = 0550
force security mode = 0550
directory security mask = 0550
force directory security mode = 0550

What permissions were you trying to achieve btw?

share|improve this answer
    
I don't think so. When accessing through windows machines the permissions are set 775 for new files and directories. The problem is only when accessing through macosx. After a while I figure it out setting this global variable: unix extensions = off discussions.apple.com/thread.jspa?messageID=7349655 –  Telephone Sep 3 '10 at 14:09
up vote 0 down vote accepted

After a while I figure it out setting this global variable: unix extensions = off

http://discussions.apple.com/thread.jspa?messageID=7349655

share|improve this answer

How this works appears to change depending on whether you connected to the share using a "cifs://" or "smb://" URL (i.e. whether the location you type in to the Finder's "Connect to server" dialog begins with "cifs" or with "smb").

If you connect using a "cifs://" URL, then OS X will attempt to use the "UNIX extensions" described in other answers here, and files copied or moved to the share will retain the permissions they had on the source drive, no matter what the various permission masks/modes settings are for the share. I think this is probably due to a bug in Samba (I'm using 3.5.6 from Debian Squeeze - 2:3.5.6~dfsg-3squeeze8 if anyone is interested).

If however you connect using an "smb://" URL, the UNIX extensions will not be used, and the permissions will be dictated by the following settings for files:

force create mode create mask security mask force security mode

and these for directories:

force directory mode directory mask directory security mask force directory security mode

Oh, and don't forget:

map hidden map archive map system

There may be more that I've forgotten, but these are the most common. See the manpage for smb.conf for details of how all these settings work.

You can use the "unix extensions" setting to disable all connections, whether made using cifs:// or smb:// URLS, to behave as the more basic smb:// connections usually do. The advantages of using the UNIX extensions are include that things like links (symbolic or hard) may work. Unfortunately this is a global setting, and can't be set per-share (at least with the Samba version I have here).

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.