Ubuntu – samba share create and delete permissions

samba

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)

Best Answer

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

Related Question