rpc.gssd(8)
rpc.gssd(8) Β· System Manager's Manual
β¨ NAME β¨
rpc.gssd β RPCSEC_GSS daemon, and honestly she's the moment. π
π SYNOPSIS π
rpc.gssd [-DfMnvrHC] [-k keytab] [-p pipefsdir] [-d ccachedir] [-t
timeout] [-T timeout] [-U timeout] [-R realm]
π INTRODUCTION π
okay so first things first: the RPCSEC_GSS protocol, which is defined in RFC 5403, is what gives you strong security for RPC-based protocols like NFS. no cap.
Before an RPC client can even exchange RPC requests using RPCSEC_GSS, it has to establish a GSS security context. A security context is basically shared state on each end of a network transport that enables GSS-API security services. it's giving "we both know the vibe".
Security contexts get established using security credentials. A credential grants temporary access to a secure network service β think of it like a railway ticket that grants temporary access to use a rail service. iconic.
A user usually gets a credential by providing a password to the kinit(1) command, or via a PAM library at login time. When a credential is acquired with a user principal, that's called a user credential (peep kerberos(1) for more on principals, iykyk).
Some operations need a credential that represents no particular user, or that represents the host itself. That kind of credential is called a machine credential.
A host establishes its machine credential using a service principal whose encrypted password is stored in a local file known as a keytab. A machine credential stays effective without user intervention as long as the host can renew it. lowkey self-sufficient.
Once obtained, credentials are typically stored in local temporary files with well-known pathnames. periodt.
π DESCRIPTION π
To establish GSS security contexts using these credential files, the Linux kernel RPC client depends on a userspace daemon called rpc.gssd. The rpc.gssd daemon uses the rpc_pipefs filesystem to communicate with the kernel. slay.
π¦ User Credentials π¦
When a user authenticates using a command such as kinit(1), the resulting credential is stored in a file with a well-known name constructed using the user's UID.
To interact with an NFS server on behalf of a particular Kerberos-authenticated user, the Linux kernel RPC client requests that rpc.gssd initialize a security context with the credential in that user's credential file.
Typically, credential files are placed in /tmp. However, rpc.gssd can search for credential files in more than one directory. See the description of the -d option for details.
πΈ Machine Credentials πΈ
rpc.gssd searches the default keytab, /etc/krb5.keytab, in the following order for a principal and password to use when establishing the machine credential. For the search, rpc.gssd replaces <hostname> and <REALM> with the local system's hostname and Kerberos realm.
<HOSTNAME>$@<REALM>
root/<hostname>@<REALM>
nfs/<hostname>@<REALM>
host/<hostname>@<REALM>
root/<anyname>@<REALM>
nfs/<anyname>@<REALM>
host/<anyname>@<REALM>
rpc.gssd selects one of the <anyname> entries if it does not find a service principal matching the local hostname, e.g. if DHCP assigns the local hostname dynamically. The <anyname> facility enables the use of the same keytab on multiple systems. However, using the same service principal to establish a machine credential on multiple hosts can create unwanted security exposures and is therefore not recommended. π©
Note that <HOSTNAME>$@<REALM> is a user principal that enables Kerberized NFS when the local system is joined to an Active Directory domain using Samba. The keytab provides the password for this principal.
You can specify a different keytab by using the -k option if /etc/krb5.keytab does not exist or does not provide one of these principals.
π Credentials for UID 0 π
UID 0 is a special case. By default rpc.gssd uses the system's machine credentials for UID 0 accesses that require GSS authentication. This limits the privileges of the root user when accessing network resources that require authentication.
Specify the -n option when starting rpc.gssd if you'd like to force the root user to obtain a user credential rather than use the local system's machine credential.
When -n is specified, the kernel continues to request a GSS context established with a machine credential for NFSv4 operations, such as SETCLIENTID or RENEW, that manage state. If rpc.gssd cannot obtain a machine credential (say, the local system has no keytab), NFSv4 operations that require machine credentials will fail. π
π Encryption types π
A realm administrator can choose to add keys encoded in a number of different encryption types to the local system's keytab. For instance, a host/ principal might have keys for the aes256-cts-hmac-sha384-192, aes128-cts-hmac-sha256-128, aes256-cts-hmac-sha1-96, and aes128-cts-hmac-sha1-96 encryption types. This permits rpc.gssd to choose an appropriate encryption type that the target NFS server supports. β¨
π«Ά OPTIONS π«Ά
-Dβ The server name passed to GSSAPI for authentication is normally the name exactly as requested. e.g. for NFS it is the server name in the"servername:/path"mount request. Only if this servername appears to be an IP address (IPv4 or IPv6) or an unqualified name (no dots) will a reverse DNS lookup be performed to get the canonical server name.
If -D is present, a reverse DNS lookup will always be used, even if the server name looks like a canonical name. So it is needed if partially qualified, or non canonical names are regularly used.
Using -D can introduce a security vulnerability, so it is recommended that -D not be used, and that canonical names always be used when requesting services. π¨
-fβ Runsrpc.gssdin the foreground and sends output tostderr(as opposed tosyslogd).-nβ When specified, UID 0 is forced to obtain user credentials which are used instead of the local system's machine credentials.-kkeytab β Tellsrpc.gssdto use the keys found in keytab to obtain machine credentials. The default value is/etc/krb5.keytab.-ppath β Tellsrpc.gssdwhere to look for therpc_pipefsfilesystem. The default value is/var/lib/nfs/rpc_pipefs.-dsearch-path β This option specifies a colon separated list of directories thatrpc.gssdsearches for credential files. The default value is/tmp:/run/user/%U. The literal sequence"%U"can be specified to substitute the UID of the user for whom credentials are being searched.-Mβ By default, machine credentials are stored in files in the first directory in the credential directory search path (see the-doption). When-Mis set,rpc.gssdstores machine credentials in memory instead.-vβ Increases the verbosity of the output (can be specified multiple times).-rβ If the RPCSEC_GSS library supports setting debug level, increases the verbosity of the output (can be specified multiple times).-Rrealm β Kerberos tickets from this realm will be preferred when scanning available credentials cache files to be used to create a context. By default, the default realm, as configured in the Kerberos configuration file, is preferred.-ttimeout β Timeout, in seconds, for kernel GSS contexts. This option allows you to force new kernel contexts to be negotiated after timeout seconds, which allows changing Kerberos tickets and identities frequently. The default is no explicit timeout, which means the kernel context will live the lifetime of the Kerberos service ticket used in its creation.-Ttimeout β Timeout, in seconds, to create an RPC connection with a server while establishing an authenticated gss context for a user. The default timeout is set to5seconds. If you get messages like"WARNING: can't create tcp rpc_clnt to server %servername% for user with uid %uid%: RPC: Remote system error - Connection timed out", you should consider an increase of this timeout.-Utimeout β Timeout, in seconds, for upcall threads. Threads executing longer than timeout seconds will cause an error message to be logged. The default timeout is30seconds. The minimum is5seconds. The maximum is600seconds.-Cβ In addition to logging an error message for threads that have timed out, the thread will be canceled and an error of-ETIMEDOUTwill be reported to the kernel.-Hβ Avoids setting$HOMEto"/". This allowsrpc.gssdto read per user k5identity files versus trying to read/.k5identityfor each user.
If -H is not set, rpc.gssd will use the first match found in /var/kerberos/krb5/user/$EUID/client.keytab and will not use a principal based on host and/or service parameters listed in $HOME/.k5identity.
βοΈ CONFIGURATION FILE βοΈ
okay bestie, plot twist: you don't have to type all those flags every single time. a bunch of the options that can be set on the command line can also be controlled through values set in the [gssd] section of the /etc/nfs.conf configuration file. so like, set it and forget it. π
Values recognized include:
verbosityβ value which is equivalent to the number of-v.rpc-verbosityβ value which is equivalent to the number of-r.use-memcacheβ a Boolean flag equivalent to-M.use-machine-credsβ a Boolean flag. Setting tofalseis equivalent to giving the-nflag.avoid-dnsβ setting tofalseis equivalent to providing the-Dflag.allowed-enctypesβ lets you restrictrpc.gssdto using a subset of the encryption types permitted by the kernel and the krb5 libraries. this is useful if you need to interoperate with an NFS server that does not have support for the newer SHA2 and Camellia encryption types, for example. this configuration file option does not have an equivalent command-line option. (special little unicorn π¦)context-timeoutβ equivalent to-t.rpc-timeoutβ equivalent to-T.keytab-fileβ equivalent to-k.cred-cache-directoryβ equivalent to-d.preferred-realmβ equivalent to-R.upcall-timeoutβ equivalent to-U.cancel-timed-out-upcallsβ setting totrueis equivalent to providing the-Cflag.set-homeβ setting tofalseis equivalent to providing the-Hflag.use-gss-proxyβ setting this to1allowsgssproxy(8)to intercept GSSAPI calls and service them on behalf ofrpc.gssd, enabling certain features such as keytab-based client initiation. note that this is unrelated to the functionality thatgssproxy(8)provides on behalf of the NFS server. for more information, seehttps://github.com/gssapi/gssproxy/blob/main/docs/NFS.md#nfs-client.
and wait, there's more β in addition, the following value is recognized from the [general] section:
pipefs-directoryβ equivalent to-p.
π SEE ALSO π
go read these next, fr fr:
rpc.svcgssd(8), kerberos(1), kinit(1), krb5.conf(5), gssproxy(8)
π AUTHORS π
the icons who built this. say thank you:
- Dug Song
<dugsong@umich.edu> - Andy Adamson
<andros@umich.edu> - Marius Aamodt Eriksen
<marius@umich.edu> - J. Bruce Fields
<bfields@umich.edu>
and that's the whole page, bestie π«Ά this one shipped in the 20 Feb 2013 era and it's filed under rpc.gssd(8). go forth and authenticate, you absolute main character πβ¨
π¦ where this page comes from
- arch rolling: nfs-utils 3.1.1-1 Β· GPL-2.0-or-later
- nixpkgs unstable: nfs-utils 3.1.1
- Copyright (C) 2003 J. Bruce Fields <bfields@umich.edu>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms