nfsidmap(8)
π nfsidmap(8) β the NFS idmapper upcall program π
okay bestie, sit down, hydrate, and let's talk about nfsidmap β it's a System Manager's Manual situation and honestly it's giving "quietly holding your entire NFSv4 mount together" energy. π«Ά
β¨ NAME β¨
nfsidmap β the NFS idmapper upcall program. literally that's her whole job title. π
πΈ SYNOPSIS πΈ
nfsidmap [-v] [-t timeout] key desc
nfsidmap [-v] [-c]
nfsidmap [-v] [-u|-g|-r user]
nfsidmap -d
nfsidmap -l
nfsidmap -h
six whole moods. pick your vibe. β
π¦ DESCRIPTION π¦
So. The NFSv4 protocol does NOT put your local system's UID and GID values on the wire as numbers, bestie. It sends them as strings that look like user@domain. And the whole process of translating from UID β string and string β UID? That's called "ID mapping." periodt.
The system gets the user part of that string by doing a password or group lookup. And where does the lookup mechanism live? It's configured in /etc/idmapd.conf. π
By default, the domain part of the string is just the system's DNS domain name. BUT β and this is the lowkey important part β you can also specify it in /etc/idmapd.conf if your system is multi-homed, or if your system's DNS domain name doesn't match the name of your system's Kerberos realm. π
When the domain is not specified in /etc/idmapd.conf, the local DNS server gets queried for the _nfsv4idmapdomain text record. If that record exists, that's what gets used as the domain. If the record doesn't exist, then the domain part of the DNS domain gets used. no cap. π§
Now the main character: the /usr/sbin/nfsidmap program performs translations on behalf of the kernel. The kernel uses the request-key mechanism to perform an upcall. So /usr/sbin/nfsidmap gets invoked by /sbin/request-key, does the translation, and initializes a key with the resulting information. Then the kernel caches the translation results in that key. teamwork! π
nfsidmap can also clear cached ID map results in the kernel, or revoke one particular key. And why do we care? Because an incorrect cached key can result in file and directory ownership reverting to "nobody" on NFSv4 mount points. which is... the villain origin story of your afternoon. π
Plus, the -d and -l options are there to help diagnose misconfigurations. They have no effect on the keyring containing ID mapping results β they're just here to snoop and tell you the truth. π
π OPTIONS π
-cβ Clear the keyring of all the keys. bye bye everything π-dβ Display the system's effective NFSv4 domain name on stdout.-g userβ Revoke the gid key of the given user.-hβ Display usage message.-lβ Display on stdout all keys currently in the keyring used to cache ID mapping results. Heads up bestie: these keys are visible only to the superuser. π-r userβ Revoke both the uid and gid key of the given user. both. at once. ruthless.-t timeoutβ Set the expiration timer, in seconds, on the key. The default is600seconds (10 mins). β°-u userβ Revoke the uid key of the given user.-vβ Increases the verbosity of the output to syslog (can be specified multiple times). say it louder for the syslog π’
π CONFIGURING π
Okay so here's the setup part, and it's not optional, it's necessary. The file /etc/request-key.conf will need to be modified so /sbin/request-key can properly direct the upcall. The following line should be added before a call to keyctl negate:
create id_resolver * * /usr/sbin/nfsidmap -t 600 %k %d
This will direct all id_resolver requests to the program /usr/sbin/nfsidmap. The -t 600 defines how many seconds into the future the key will expire. This is an optional parameter for /usr/sbin/nfsidmap and will default to 600 seconds when not specified. π«
The idmapper system uses four key descriptions:
uid:β Find the UID for the given usergid:β Find the GID for the given groupuser:β Find the user name for the given UIDgroup:β Find the group name for the given GID
You can choose to handle any of these individually, rather than using the generic upcall program. Iconic behavior honestly. So if you would like to use your own program for a uid lookup, then you would edit your request-key.conf so it looks similar to this:
create id_resolver uid:* * /some/other/program %k %d
create id_resolver * * /usr/sbin/nfsidmap %k %d
Notice that the new line was added above the line for the generic program. request-key will find the first matching line and run the corresponding program. In this case, /some/other/program will handle all uid lookups, and /usr/sbin/nfsidmap will handle gid, user, and group lookups. order matters, bestie, always. β
π FILES π
/etc/idmapd.confβ ID mapping configuration file/etc/request-key.confβ Request key configuration file
π SEE ALSO π
idmapd.conf(5), request-key(8)
π AUTHOR π
Bryan Schumaker, <bjschuma@netapp.com>
and that's the whole page, bestie!! π«Ά this one is from the System Manager's Manual, dated 1 October 2010, and it's the nfsidmap(8) manual page β go forth and map those IDs, you absolute legend. πβ¨ππ¦πΈ
π¦ where this page comes from
- alpine 3.22: nfs-utils-doc 2.6.4-r4 Β· GPL-2.0-only
- alpine 3.23: nfs-utils-doc 2.6.4-r6 Β· GPL-2.0-only
- alpine 3.24: nfs-utils-doc 2.6.4-r6 Β· GPL-2.0-only
- arch rolling: nfs-utils 3.1.1-1 Β· GPL-2.0-or-later
- centos-stream 10: nfs-utils 1:2.8.3-9.el10 Β· MIT and GPLv2 and GPLv2+ and BSD
- centos-stream 10: nfs-utils-coreos 1:2.8.3-9.el10 Β· MIT and GPLv2 and GPLv2+ and BSD
- centos-stream 10: nfsv4-client-utils 1:2.8.3-9.el10 Β· MIT and GPLv2 and GPLv2+ and BSD
- debian bookworm: nfs-common 1:2.6.2-4+deb12u1
- debian trixie: nfs-common 1:2.8.3-1
- fedora 43: nfs-utils 1:2.8.4-0.fc43 Β· LicenseRef-Callaway-MIT AND GPL-2.0-only AND GPL-2.0-or-later AND LicenseRef-Callaway-BSD
- fedora 43: nfs-utils 1:2.8.7-6.fc43 Β· LicenseRef-Callaway-MIT AND GPL-2.0-only AND GPL-2.0-or-later AND LicenseRef-Callaway-BSD
- fedora 43: nfs-utils-coreos 1:2.8.4-0.fc43 Β· LicenseRef-Callaway-MIT AND GPL-2.0-only AND GPL-2.0-or-later AND LicenseRef-Callaway-BSD
- fedora 43: nfs-utils-coreos 1:2.8.7-6.fc43 Β· LicenseRef-Callaway-MIT AND GPL-2.0-only AND GPL-2.0-or-later AND LicenseRef-Callaway-BSD
- fedora 43: nfsv4-client-utils 1:2.8.4-0.fc43 Β· LicenseRef-Callaway-MIT AND GPL-2.0-only AND GPL-2.0-or-later AND LicenseRef-Callaway-BSD
- fedora 43: nfsv4-client-utils 1:2.8.7-6.fc43 Β· LicenseRef-Callaway-MIT AND GPL-2.0-only AND GPL-2.0-or-later AND LicenseRef-Callaway-BSD
- fedora 44: nfsv4-client-utils 1:2.8.7-0.fc44 Β· GPL-2.0-only AND GPL-2.0-or-later AND BSD-3-Clause AND BSD-2-Clause AND (HPND-export-US-modify AND HPND-sell-variant) AND (GPL-2.0-only WITH Linux-syscall-note OR BSD-3-Clause)
- fedora 44: nfsv4-client-utils 1:2.8.7-7.fc44 Β· GPL-2.0-only AND GPL-2.0-or-later AND BSD-3-Clause AND BSD-2-Clause AND (HPND-export-US-modify AND HPND-sell-variant) AND (GPL-2.0-only WITH Linux-syscall-note OR BSD-3-Clause)
- nixos 26.05: nfs-utils 2.9.1
- nixpkgs unstable: nfs-utils 3.1.1
- opensuse-leap 16.0: nfs-client 2.8.2-160000.4.1 Β· GPL-2.0-or-later
- opensuse-leap 16.0: nfs-client 2.8.2-160000.4.1 Β· GPL-2.0-or-later
- opensuse-leap 16.0: nfs-client 2.8.2-160000.4.1 Β· GPL-2.0-or-later
- opensuse-leap 16.0: nfs-client 2.8.2-160000.4.1 Β· GPL-2.0-or-later
- ubuntu noble: nfs-common 1:2.6.4-3ubuntu5
- ubuntu noble: nfs-common 1:2.6.4-3ubuntu5.1
- ubuntu questing: nfs-common 1:2.8.3-1ubuntu3
- ubuntu resolute: nfs-common 1:2.8.5-1ubuntu1
- ubuntu stonking: nfs-common 1:2.9.1-1ubuntu1
- Copyright (C) 2010 Bryan Schumaker <bjschuma@netapp.com>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms