I have one Linux ext3 partition shared on network. Now when some one copy files from MAc , then other people can't change the file dute to permission problem.

Is there any way that ane new file which is copied will always have 777 permission

and some specific user as owner of file not the default user



add create mask = 0777 to the share definition, or to the global configuration, in /etc/samba/smb.conf for example:

    comment = open directory
    browseable = yes
    read only = no
    create mask = 0777
    directory mask = 0755
    path = /some/path/on/server


as for file ownership, there aren't any configuration settings for that, however, it seems who has ownership of the directory the file is created in will be the owner:group of the created file.

so, for the share in question, set the ownership:group to be what you want it to be, i.e.

chown john.users /some/path/on/server


See the Share Definition Access Controls section in the Samba manual. The create mask and related security options should allow you to set the file permissions as you've described.


I'm quite amazed, that nobody complained about permisions 777. Why do you need these insanely elevated permisions? Why do you need execute bit anyway?

Let's say, that everybody accessing files should have read&write permissions. These users will be in group rwsamba. And the exported folder will be /data


Create shared folder, change ownership and set sticky bit

mkdir /data
chown whoever:rwsamba /data
chmod 2770 /data

This will assure, that every new files and subdirectories in /data will belong to group rwsamba.

Configure samba to create files with 660 and directories with 2770 permisions

    comment = Share me
    browseable = yes
    read only = no
    create mask = 0660
    directory mask = 2770
    path = /data

Every user which will use samba has to belong to group rwsamba

And that should be all. New files and directories will have owner same as creator, group will be the rwsamba and everybody could read everything. Of course, being an owner gives me access to change permissions, so "skilled" user can mess with them. This can be fixed by telling samba to override owner of new files and directories:

force user = whoever

Your Answer

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