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 intend to setup a samba share server that all user can write files to but they can not delete files was put in that folder.

Which configuration is suitable for me!

Thanks in advanced!

share|improve this question

2 Answers 2

As far as I know it isn't done with samba, but with linux. You should assign the sticky flag to the main share directory with chmod. For example, if you're sharing /home/foo you should execute "chmod +t /home/foo/".

Also I suggest to use the linux ACL system or the default creation mask in samba configuration to propagate automatically this behaviour to subdirectories.

share|improve this answer
    
Nefeli, I fear this isn't right. The effect of setting the sticky bit on a directory is to prevent anyone other than the creator from deleting files in that directory, even though the directory's permissions would otherwise permit it. I fear that is not what the OP wants! –  MadHatter Sep 27 '11 at 6:54
    
MadHatter, I think you can be right depending on the way the access is configured. As I understand they have a directory where a lot of people can read and write and the staff wants the files they put (the staff, not the users) to not be erased. I usually handle multiple user accesses with groups. If this is the way the samba server is configured, sticky bit should work as desired, isn't it? –  nefeli Sep 27 '11 at 7:12
    
I suspect samba can indeed be configured to allow writes but inhibit deletes, but what you wrote is "it isn't done with samba, but with linux. You should assign the sticky flag to the main share directory.", and I fear that that is simply wrong. –  MadHatter Sep 27 '11 at 9:48

The user needs to have the linux file system rwx permissions on the directory the file is in, to be able to delete files in the directory.

You can achieve this by default in a few different ways, for new files one method is the use of default create masks so all new files and folders will have the correct linux file system permissions.

share|improve this answer

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.