0

I have the following setup: There is a Debian 10 PC with user A (uid: 1000, gid: 1000) and want to mount a NFS share provided by a server running TrueNAS (12.0-U8.1), which is owned by user B (uid: 1006, gid: 1008). I have to use NFS since this share is used by rsnapshot which needs both soft and hard links. Both machines are within the same LAN. I found this forum entry, but I do not understand how concretly to mount the share.

What precisely do I have to write to

  • /etc/fstab
  • /etc/idmapd.conf
  • the mount command
  • any other config file?

With the following settings I can mount the share, but not modify.

/etc/fstab:

server:/mnt/pool/backup /mnt/server/backup nfs vers=4,addr=10.0.0.X,clientaddr=10.0.0.Y,noauto,rw,_netdev,users 0 0

/etc/idmapd.conf:

[General]
   Verbosity = 0
   Pipefs-Directory = /run/rpc_pipefs
   # set your own domain here, if it differs from FQDN minus hostname
   Domain = dom

[Mapping]
   Nobody-User = nfsnobody
   Nobody-Group = nfsnogroup

[Translation]
   Method = static

[Static]
   B@server.dom = A

mount command:

/sbin/mount.nfs -v -o uid=1006,gid=1008 server:/mnt/pool/backup /mnt/server/backup

The IP addresses are statically assigned by the router.

1 Answers1

0

As kerberos is not involved NFS will use AUTH_SYS, which means that server will use uid and gids send by the client. There are no ways to tell client to change the ids on the flight (unless you create on the client a user with uid/gid 1006/1008). The idmapd is involved only when kerberos is used or then GETATTR call returns sting principals as files owner and owner_group.

To fix you issue you have to option: create matching user or force server to map client host to given uid/gid combination. On a regular NFS server you should update /etc/exports file as following:

/data 10.0.0.Y(rw,squash_all,anonuid=1006,anongid=1008)

TrueNAS probably have similar options.

kofemann
  • 4,626
  • 1
  • 25
  • 30