I have a question/confusion regarding forcing inherited permissions on Linux (namely CentOS 6)
1 x CentOS File Server
2 x CentOS NFS Clients
Lots x Windows Samba Clients
The file share is /srv/share shared with both Samba and NFS local permissions are as follows:h
drwxrwx---. 2 root sharegroup 4.0K Oct 22 14:41 share
All UIDs/GIDs unified through Active Directory, the primary group for all users is 'sharegroup'.
NFS client mounted in fstab as:
tst-lnx03:/srv/share /mnt/share nfs defaults 0 0
Windows box through UNC path:
What I Would Like:
Anything written/created in the /srv/share folder regardless of whether it came through NFS or Samba to be say 770 root sharegroup.
What I Have Tried:
I have tried using ACLs:
setfacl -m d:u:root:rwx,d:g:"sharegroup":rwx,d:other:--- share
With the result:
ls -lah -rwxrwx---+ 1 testuser11 sharegroup 0 Oct 22 14:25 tu12-smb-win -rw-rw----+ 1 testuser2 sharegroup 0 Oct 22 14:23 tu2-local-local -rw-r-----+ 1 testuser4 sharegroup 0 Oct 22 14:24 tu4-NFS-lnx04
I have tried using sticky bits:
chmod 2770 share
With the result:
ls -lah -rwxr--r-- 1 testuser11 k8 sharegroup 0 Oct 22 14:38 tu12-smb-win -rw-r--r-- 1 testuser2 k8 sharegroup 0 Oct 22 14:38 tu2-local-local -rw-r--r-- 1 testuser4 k8 sharegroup 0 Oct 22 14:38 tu4-NFS-lnx04
Looks like setfacl is the winner but am slightly confused by the output, why does the sticky bit version add in a random other read and strip the write off group?
I think I can attribute the NFS created file being different due to the default umask of 0022 but not the other changes. I would have expected the windows created and the locally created files to match for permisions too.
Can anyone explain what's happening in each case? I'm a little perplexed. If you need anything more from me just shout and I'll put it up.