3

i have samba server where every user of domain can write and delete files. but i want to setup following permissions on this share.

everyone can create files or folder in this share. all other user have only read and execute access on the folder they should not delete the folder which has been created by other users(only owner should able to delete this folder)

2 Answers 2

3

Assuming that you have configured your /etc/samba/smb.conf file to allow "everyone" appropriate access to your share, you can use the following parameters to control file/directory access:

create mask = 0755

Similar to the numeric format used by chmod, a "create mask" of 0755 will allow files created by your users to have full access to their own files. Everyone else will only have read and execute access, but not write access. Note that the default is 0744, which allows full control for the owner, but only read access for everyone else.

directory mask = 0755

While "create mask" only works for files, "directory mask" applies the same logic to directories. Of course the particular setting of 0755 (full control for owner, read+execute for group and others) is the default.

Although dated, this link offers a more-detailed description of these options, as well as a breakdown of the meanings behind the numeric values (should you require that).

0

Using create mask = 0755 and directory mask = 0755 will work only for the files within sub-directory.

let say, we have a shared director /share for all member in a group. The /share has created with 775 Unix permission (if we use 755 then only owner can create/delete file).

smb.conf
[Share]
path = /share
read only = No
valid users = +group
create mask = 0755
directory mask = 0755

with above configuration, all immediate files and directories will able to delete by group member, and other in a sub-directory will not able to delete by group.

I solved this problem by using sticky bit chmod +t /share.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .