I'm setting up a home file server on a Debian 13 virtual machine running under Proxmox. Samba is already installed, and the two Windows clients on my network can connect and modify files through a mapped drive. I also have two Linux clients that need access to the same shared directory.
For the Linux systems, I tried exporting `/data01/shared` through NFS and mounting it from `/etc/fstab`:
`/data01/shared 192.x.y.z/23(rw,sync,no_subtree_check)`
`192.x.y.z1:/data01/shared /home//shared-drive nfs rw,defaults,_netdev,nofail 0 0`
The mount works when I set the shared directory to `chmod 777`, but I know that is not a sensible long-term permission model. What is the recommended way to configure ownership, groups, and permissions for this kind of mixed Windows/Linux home file server? Should I keep using NFS for the Linux clients, or would it be simpler and safer to use Samba for all clients?
3 Answers
NFS still uses ordinary Linux ownership and permission bits, so I’d avoid `777`. On the server, create a dedicated group for the share, make it the directory’s group, and enable setgid inheritance:
`sudo groupadd shared`
`sudo chown root:shared /data01/shared`
`sudo chmod 2770 /data01/shared`
Then add the appropriate users to that group. The setgid bit makes newly created files and directories inherit the shared group.
One important NFS detail is that it uses numeric UIDs and GIDs, not usernames. If the same person has UID 1000 on one Linux machine and UID 1001 on another, the permissions may not line up. Either keep the IDs consistent, use centralized identity management, or deliberately map the IDs. I wouldn’t use `anongid` unless you specifically intend to access the export through anonymous or mapped identities.
Since Samba is already working for the Windows clients, using Samba for the Linux clients too may be the easiest home setup. It avoids maintaining two permission models and lets every client use the same share.
Changing the directory to `777` removes the permission boundary rather than solving the ownership problem. For a small home network, a dedicated group with `2770` or a similar group-writable mode is usually enough. Also consider default ACLs if different users need predictable access to every newly created file. Whatever protocol you choose, keep regular backups because neither NFS nor Samba protects against accidental deletion or ransomware.
I’d seriously consider using Samba for all four clients instead of exporting the same directory through both NFS and Samba. A single protocol gives you one access-control model and avoids confusing ownership behavior when Windows and Linux clients modify the same files.
For a Samba share, server-side Unix permissions still matter, but Samba can preserve Windows-style ACLs with settings such as `vfs objects = acl_xattr`, configured appropriately in `smb.conf`. Make sure you understand how the Samba ACLs and underlying filesystem permissions interact, and test access with separate user accounts before moving important data.
Is there a specific problem with using both NFS and Samba for the same directory, provided the permissions are configured carefully?

That makes sense. I understand now that matching usernames is not enough if the numeric UIDs and GIDs differ. I was considering `anongid` after creating the group, but I’ll look more carefully at consistent IDs or using Samba everywhere first.