I'm setting up kerberized NFSv4 for personal use
- manually configured NFS, KDC
- no nameservers (using
/etc/hostsinstead), no LDAP - same users on all machines (not necessarily the same id) and using id mapping for all security modes (
nfs4_disable_idmappingset to 'N')
I've got two machines, both running Ubuntu 20.04 LTS
arhiv.pecar(local address192.168.56.200) has the NFS server and the KDCclient.pecar(local address192.158.56.100) is the client
All plumbing seems to work and I can mount the share just fine, but
if the share is exported with
sec=sysserver
exportfs -voutput/srv/export <world>(rw,async,wdelay,no_root_squash,no_subtree_check,sec=sys,rw,secure,no_root_squash,no_all_squash)client
mountoutputarhiv.pecar:/srv/export on /mnt type nfs4 (rw,relatime,vers=4.2,rsize=131072,wsize=131072,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=krb5,clientaddr=192.168.56.100,local_lock=none,addr=192.168.56.200)- root has full read / write access
- other users can read / write files if sufficient privileges are set up
nfsidmapis active, listing files on the client properly translates usernames / groupschownfrom client is possible, and properly translates usernames / groups
Files are created under the uid/gid of the client, which means they are created with the wrong uid / gid on the server
It gets mapped to the wrong owner if the server happens to have a user with the same uid, otherwise the owner is
nobody:4294967294The effective user seems to be user specified by the clients uid.
I suppose this is a known drawback when using
sec=sysif the share is exported with
sec=krb5server
exportfs -voutput/srv/export <world>(rw,async,wdelay,no_root_squash,no_subtree_check,sec=krb5p:krb5,rw,secure,no_root_squash,no_all_squash)client
mountoutputarhiv.pecar:/srv/export on /mnt type nfs4 (rw,relatime,vers=4.2,rsize=131072,wsize=131072,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=192.168.56.100,local_lock=none,addr=192.168.56.200)- all users have read access, no user (including root) has write access on files / folders owned by them
- creating files in
o+wfolders will create them under the anonymous user (nobody:nogrouporanonuid:anongidif specified in exports entry) nfsidmapis active, listing files on the client properly translates usernames / groupschownfrom client fails withOperation not permitted.
The effective user seems to be the anonymous user.
I'm at a loss on what could be wrong here, so I'd appreciate the communities insight.
I can provide the relevant configuration files (/etc/hosts, /etc/krb5.conf, /etc/idmapd.conf, /etc/default/nfs-common, service, kernel module list) upon request.