I have a directory on a linux server, where my user owns all the files, and only a certain directory is world-writable. All other directories are read-only for guests. The idea is that anyone should be able to do anything they want inside the world-writable directory, but there's one problem: I can't alter guest-created files with my own UNIX user afterwards.

I just can't figure out what kind of UNIX permissions and/or samba settings would allow the same kind of behavior that I have in a similarly configured windows share. On the windows machine, I can set the world-writable directory on the share to have write permissions for "Everyone", and everyone can then do anything they want inside that directory, locally or by accessing the share as a guest. How do I get this same functionality on the linux server? Currently files written by guests can only be altered by UNIX users nobody and root.

Here is my smb.conf:

unix charset = iso8859-15
interfaces =
bind interfaces only = yes
socket address =
name resolve order = host
read only = no
max open files = 32768
csc policy = disable
load printers = no
syslog = 0
map to guest = Bad user # This is horrible :)

browseable = no
create mask = 0600
security mask = 0600
directory mask = 0700
directory security mask = 0700

path = /storage
public = yes
create mask = 0644
security mask = 0644
directory mask = 0755
directory security mask = 0755
hide dot files = no

I have tried using default ACLs, but that didn't seem to help. Those have been very helpful in many other situations, but samba has so many permissions settings that seem to interfere somehow.


grs is right about the files.

path = /storage
public = yes
create mask = 0666 #(everybody: read+write)
security mask = 0666 #(everybody: read+write)
directory mask = 0777 #(everybody: list+modify+traverse)
directory security mask = 0777 #(everybody: list+modify+traverse)
hide dot files = no

You may want improve your understanding of Traditional Unix Permissions.


You need to fix [problem_share] create mask = 0666. More info: here.


I realize that my initial question was very poorly presented, and I deserved those newbie answers. But here's how I finally solved this problem:

I made all directories in /storage owned by my own UNIX user, with read-only permissions for others. Then I mounted /storage/upload on top of itself using FUSE bindfs "mirror" option. The exact command line is "bindfs --mirror=@staff,@users,nobody --create-for-user=myuser /storage/upload /storage/upload". Now user nobody, and users in the groups staff & users see the files in /storage/upload as their own, and can modify them as they see fit. But actually, all files are owned by my own UNIX user, and if I move a file outside of that directory, no other user can modify it anymore, it becomes read-only for them. This is a very clean solution IMO, and isn't tied to samba at all.

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.