File, directory and share access problems are common on the mailing list. The following are examples taken from the mailing list in recent times.
12.6.1 Users Cannot Write to a Public Share
" We are facing some troubles with file/directory permissions. I can log on the domain as admin user (root), and there's a public share on which everyone needs to have permission to create/modify files, but only root can change the file, no one else can. We need to constantly go to the server to chgrp -R users * and chown -R nobody * to allow others users to change the file ".
There are many ways to solve this problem and here are a few hints:
12.6.2 File Operations Done as root with force user Set
When you have a user in admin users , Samba will always do file operations for this user as root , even if force user has been set.
12.6.3 MS Word with Samba Changes Owner of File
Question: "When user B saves a word document that is owned by user A the updated file is now owned by user B. Why is Samba doing this? How do I fix this? "
Answer: Word does the following when you modify/change a Word document: MS Word creates a NEW document with a temporary name , Word then closes the old document and deletes it, Word then renames the new document to the original document name. There is no mechanism by which Samba can in any way know that the new document really should be owned by the owners of the original file. Samba has no way of knowing that the file will be renamed by MS Word. As far as Samba is able to tell, the file that gets created is a NEW file, not one that the application (Word) is updating.
There is a work-around to solve the permissions problem. That work-around involves understanding how you can manage file system behavior from within the smb.conf file, as well as understanding how UNIX file systems work. Set on the directory in which you are changing Word documents: chmod g+s 'directory_name' This ensures that all files will be created with the group that owns the directory. In smb.conf share declaration section set:
force create mode = 0660 force directory mode = 0770
These two settings will ensure that all directories and files that get created in the share will be read/writable by the owner and group set on the directory itself.