I am trying to setup a little home network using Linux as the File Server and have run into a bit of problems w.r.t. to folder permissions that I can't seem to solve. The setup:
- An Ubuntu 14.04 Linux File Server with Samba configured.
- A couple of Windows 7 client machines.
Every person in the house has been given a username/password to the Linux File Server and they can login to the server using SSH/Putty/whatever fine.
Samba on the Linux File Server has been configured to share out a couple directories in writable mode to Windows, and all the client machines can see this and read and write files. As an example, lets say that /media/data/photos is shared out as \fs01\photos. All Windows users can write to this photos directory and it works great. They can make sub-directories, put pictures, whatever, everything works.
The issue is that I want these shares (and all the directories beneath them) to be a free for all. Any user should be able to edit/rename/move/copy/delete any file from these folders. The problem arises when one user tries to move/organize/remove/rename files created by other users. So lets say that user A creates /media/data/photos/2014NewYearsEve and user B decides that it really should have been /media/data/photos/2014/NewYearsEve instead. In the way that I've set it up right now, I keep getting permission errors.
I understand that by default in Linux, the user that created the file is the owner of the file, so I get where the errors are coming from, and I know how to correct it manually (chown and chmod, and then any user can manipulate the files fine). But since the shares (e.g. /media/data/photos) are "common", I want the permissions to automatically reflect this when the file and directories are created. Coming from a Windows background (this is my first real Linux setup), I am quite confused on how to fix this.
Here is what I have tried (based on a whole bunch of articles on the internet, stackexchange and stuff):
I changed the group of the directory /media/data/photos to "nogroup" (sudo chown nobody:nogroup /media/data/photos) I set the setgid flag on the /media/data/photos directory (sudo chmod g+s /media/data/photos).
After this, files that are put in the shares seem to get the right group assignment (ls -l shows nogroup for the new files and subdirectories). But the execute right necessary (I think its necessary right?) to move files seem to be missing from the group (the permission in ls -l is -rwxrw-rw- for files and drwxr-sr-x+ for directories).
How do I get Linux to automatically add the x bit for the group for both files and directories? Or maybe more generally, how do I make the shares free-for-alls?