Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

thanks

share|improve this question

3 Answers 3

up vote 2 down vote accepted

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

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

etc.

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

share|improve this answer
    
thanks buddy , it worked –  John May 17 '10 at 2:30

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.

share|improve this answer

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

So:

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

[shareme]
    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
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.