Score:1

How to export shares so that users don't create file as root

bd flag

I am trying to export home directories from my NAS to ubuntu clients - the server is a TrueNAS Scale, which is Debian based. Kerberos works, so users get the proper tickets to authenticate to the server.

My main goal is that users can mount their home dirs off the server.

I have a share called home on the server with one directory per user. The home directory is owned by root, and the subdirectories are owned by the users. However, if I don't use maproot nor mapall, even if I manage to mount the share, the user can't write anything to his folder if mounting /home/folder.

If I use maproot=root, the user mounts it, but everything he writes is saved as root. I am lost here, but it seems there might be a problem with the id mapping. The uid/gid of the files are the same across server and client, the right names showing, etc. This makes me believe that the mapping is correct - however, when using maproot=root, why I end up having access to folders that don't belong to me, and why everything I create with that user is owned by root?

How I can properly export this so that I get root squashed, as well as that the users only get access to their own directories?

user1686 avatar
fr flag
Assuming Kerberos is actually being used, there should be _no_ "map" options needed for this to work, rather than adding more and more options. Is the initial mount done by root or by the user? Was your client machine's krb5.keytab accidentally left world-readable? When a user tries to access the mount for the first time, does the client's machine rpc.gssd show any activity, and does a ticket for nfs/yournas show up in their personal ticket cache (klist)?
bd flag
Thanks @user1686. It seems that the problem was idmapd.conf that didn't have a "Local-Realms" option configured correctly.
Score:0
bd flag

The problem was that /etc/idmapd.conf didn't have a Local-Realms configured, which was necessary since the domain of the client isn't the same as the server.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.