Secure NFS File Share Problem
Subsystems (2)
Hello,
I have an LDAP based network with several Cent OS 4 file servers and many Fedora Core 2 client machines. I want to set up NFS on one of them in the following configuration and I can't seem to make it work.
I have the following directory structure and I want to lock it down:
/public
/public/sales
/public/operations
/public/hr
/public/acct
Basically I want each department to be able to access only their files. I also want all files that are created in these directories to be able to be modified by everyone in the respective group. I currently have this setup functional with samba, but since my clients are now all linux based, I would like to use nfs. Here is an example from my smb.conf that accomplishes what I want:
[acct]
comment = Accounting Administration Share
writable = yes
path = /public/acct
sync always = yes
valid users = @acct
force group = acct
create mode = 0660
directory mode = 0770
public = no
browseable = no
Is there a way to do this with nfs? My /etc/exports on the server looks like this:
/public/acct 192.168.2.0/255.255.255.0(rw,sync,all_squash,anonuid=510,anongid=601)
This works in that all files are created as the same user and can be modified by anyone, but access is not limited to the acct group. When I change the entry to
/public/acct @acct(rw,sync,all_squash,anonuid=510,anongid=601)
It then denies access to anyone not in the acct posix group in LDAP, but whenever a user creates a file in the share, it is owned by that user with their primary group with permissions of 0644. My anonymous uid and gid are ignored! Now access to the files is restricted to the acct group, but the files are only able to be modified by their owner. I could change the umask to 002 on all of my clients, but then this opens up security problems elsewhere, most notably in one's home directory.
Any help with this would be appreciated.
Thanks,
Mason Sanders