2

I'm unable to map client username to server username when I mount a QNAP storage on Ubuntu client with NFSv4 (I don't want to use the UID correspondence). In my case neither the UID and the username are equal in both the client and the server.

SERVER (QNAP):

I've enabled NFSv4 sharing, then I've configured a shared directory(shared_dir) with:

- Host/IP/Network = <client IP addr>
- Permissions = r/w
- Squash option = NO_ROOT_SQUASH

I've modified the file /sys/module/nfs/parameters/nfs4_disable_idmapping from 'Y' to 'N' (according to what I read on other forum answers).

I've rebooted the QNAP

I HAVEN'T modified the file /etc/idmapd.conf that currently is like this:

[General]

Verbosity = 9
Pipefs-Directory = /var/lib/nfs/rpc_pipefs
Domain = localdomain  


[Mapping]

Nobody-User = guest
Nobody-Group = guest

CLIENT (Ubuntu 16.04):

nfs-common was already installed, so as for the server I wrote 'N' in /sys/module/nfs/parameters/nfs4_disable_idmapping.

In addition I've modified the file /etc/idmapd.conf like this:

[General]

Verbosity = 0
Pipefs-Directory = /run/rpc_pipefs
# set your own domain here, if id differs from FQDN minus hostname
Domain = localdomain

[Mapping]

Nobody-User = nobody
Nobody-Group = nogroup

[Translation]
   Method=static
[Static]
   jameswhite@<QNAP IP addr> = james

Then I've performed the restart with service nfs-idmapd restart (I don't know why it ask me to authenticate for org.freedesktop.systemd1.manage-units, but I think this is not relevant for my problem)

Finally I've mounted the QNAP with:

sudo mount -v -t nfs4  <QNAP IP addr>:/shared_dir /mnt/shared_dir
4
  • As far as I know mapping is only possible with gss authenticated users, which means kerberos.
    – Thomas
    Feb 14, 2018 at 18:42
  • notice, that for server control file is /sys/module/nfsd/parameters/nfs4_disable_idmapping, e.g nfsd vs. nfs
    – kofemann
    Feb 15, 2018 at 10:53
  • @Thomas I make a research on what you are saying and I found something that support your thought: link1 link2. But other tutorials or manuals I read before do not assert such thing. Feb 15, 2018 at 18:55
  • @kofemann in your opinion is it enough to change it to make server idmapping work or do you agree with Thomas thought? However I'll try to change it. Feb 15, 2018 at 18:55

0

You must log in to answer this question.

Browse other questions tagged .