That's already how NFS works. It's how NFS has worked since day one.
By default, NFS simply reports the current UID to the server (-o sec=sys
), and the server just blindly trusts the client to not lie. If you want more security than that, you will need to set up Kerberos with sec=krb5i
.
A similar multi-user mode is available for SMB (cifs) as well – you can enable it by mounting the share with the -o multiuser
mount option.
Because SMB authentication isn't UID-based, each user will need to load their own credentials using cifscreds add
before they're allowed to access the mount. You can set up pam_cifscreds
to make this more automatic (storing the users' login passwords) or, again, run Kerberos.
(Nearly the same Kerberos setup can be used for both NFS and SMB.)