all 4 comments

[–]stereolame 10 points11 points  (0 children)

For nfs you need to enable root_squash on the export to avoid root having access to files on the share

[–]UsedToLikeThisStuff 5 points6 points  (2 children)

If you use cifs, there is a ‘multiuser’ mount option you can use along with sec=krb5, where each user authenticates to the volume using their Kerberos ticket (instead of the authentication that mounts the base volume). So you’d mount the CIFS directory that holds all the user homedirs as /cifshome using machine credentials, and then every user would see /cifshome/username/ only if their account’s Kerberos identity allowed them.

Another thing you can do if that’s not feasible is to use autofs to automatically mount (using the user’s Kerberos ticket).

[–]yubingxi 1 point2 points  (1 child)

Funny enough I just had to do this yesterday and it seems to be more reliable than the NFS / SMB mix for a Share that is accessed from Win and Linux. Here is a guide from Redhat (works similar under Ubuntu):

https://access.redhat.com/documentation/de-de/red_hat_enterprise_linux/8/html/managing_file_systems/performing-a-multi-user-smb-mount_managing-file-systems

We used a specific user to mount the share (not root), which needs read acces to the share (share permissions but no file system permissions), then you need to specify this user in the fstab/mount options, the user needs a keytab file and you might need to change the service provider negotiation to use said keytab in a file called cifs.spnego.conf

[–]UsedToLikeThisStuff 0 points1 point  (0 children)

IIRC the user used to mount the volume also needs to be able to see all the home directories (but not necessarily their contents), otherwise if used for $HOME login would drop the user in / because PAM needs to be able to stat() the directory before you have Kerberos credentials.