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

        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.



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).


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?

  • 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 – Keyne Viana Sep 3 '10 at 14:09

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


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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