Looking at other questions, I've done the following:
chmod g+s MEDIA setfacl -R -d -m g::rwx MEDIA setfacl -R -d -m o::rwx MEDIA NOTE: MEDIA is a folder I'm looking to set up so that all files/folders added have the same user/group as the parent folder.
In this example MEDIA is owned by the user Bob and group SharedFiles. The goal is for newly created files/folders to retain this ownership (both Bob and SharedFiles:
MEDIA Bob SharedFiles MEDIA/NewFolder Bob Bob <BAD MEDIA/NewFolder Bob SharedFiles <GOOD If I create a subfolder whilst logged in as user 'Bob' that folder is owned by Bob:SharedFiles with [rwxrwxrwx] permissions (as intended). All Good!
If I login as Sue, the new folder becomes part of Sue:Sue with [rwxr-xr-x].
If I login from a different machine via a mounted drive in KDE (user Sue) the folder becomes part of Bob:Bob with [rwxr-xr-x].
Now both Bob and Sue are part of SharedFiles, where am I going wrong. I want all users in SharedFiles group to have RWX permissions and I want all files/folders created by users in SharedFiles group to have the same user/group as the parent folder, why does this only happen with the owner on the machine itself.
getfacl MEDIA/ returns
# file: MEDIA/ # owner: Bob # group: SharedFiles # flags: -s- user::rwx group::rwx other::rwx default:user::rwx default:group::rwx default:other::rwx samba.conf contains:
[MEDIA] read only = no locking = yes path = /mnt/local/int001/MEDIA guest ok = yes create mask = 0775 directory mask = 0775
MEDIAfolder from a remote machine? If so, which network filesystem protocol are you using to do so?uidof the creating process, and the file's owner cannot be changed by a non-superuser user, even if the user is the owner of the file. This means you can't give away your files. If there was a mechanism (say by setting the user suid bit on a directory), then this rule could be circumvented by two co-operating regular users. Thus you can't set up a directory so that a file created by a local user would end up being inherited from the directory.