Debian Codegraph @

upstream/debian-trixie/man8/gssd.8

raw
1 .\"
2 .\" rpc.gssd(8)
3 .\"
4 .\" Copyright (C) 2003 J. Bruce Fields <[email protected]>
5 .\"
6 .TH rpc.gssd 8 "20 Feb 2013"
7 .SH NAME
8 rpc.gssd \- RPCSEC_GSS daemon
9 .SH SYNOPSIS
10 .B rpc.gssd
11 .RB [ \-DfMnlvrHC ]
12 .RB [ \-k
13 .IR keytab ]
14 .RB [ \-p
15 .IR pipefsdir ]
16 .RB [ \-d
17 .IR ccachedir ]
18 .RB [ \-t
19 .IR timeout ]
20 .RB [ \-T
21 .IR timeout ]
22 .RB [ \-U
23 .IR timeout ]
24 .RB [ \-R
25 .IR realm ]
26 .SH INTRODUCTION
27 The RPCSEC_GSS protocol, defined in RFC 5403, is used to provide
28 strong security for RPC-based protocols such as NFS.
29 .P
30 Before exchanging RPC requests using RPCSEC_GSS, an RPC client must
31 establish a GSS
32 .IR "security context" .
33 A security context is shared state on each
34 end of a network transport that enables GSS-API security services.
35 .P
36 Security contexts are established using
37 .IR "security credentials" .
38 A credential grants temporary access to a secure network service,
39 much as a railway ticket grants temporary access to use a rail service.
40 .P
41 A user typically obtains a credential by providing a password to the
42 .BR kinit (1)
43 command, or via a PAM library at login time.
44 A credential acquired with a
45 .I user principal
46 is known as a
47 .I user credential
48 (see
49 .BR kerberos (1)
50 for more on principals).
51 .P
52 Certain operations require a credential that
53 represents no particular user
54 or
55 represents the host itself.
56 This kind of credential is called a
57 .IR "machine credential" .
58 .P
59 A host establishes its machine credential using a
60 .I "service principal"
61 whose encrypted password is stored in a local file known as a
62 .IR keytab .
63 A machine credential remains effective
64 without user intervention
65 as long as the host can renew it.
66 .P
67 Once obtained, credentials are typically stored in local temporary files
68 with well-known pathnames.
69 .SH DESCRIPTION
70 To establish GSS security contexts using these credential files,
71 the Linux kernel RPC client depends on a userspace daemon called
72 .BR rpc.gssd .
73 The
74 .B rpc.gssd
75 daemon uses the rpc_pipefs filesystem to communicate with the kernel.
76 .SS User Credentials
77 When a user authenticates using a command such as
78 .BR kinit (1),
79 the resulting credential is stored in a file with a well-known name
80 constructed using the user's UID.
81 .P
82 To interact with an NFS server
83 on behalf of a particular Kerberos-authenticated user,
84 the Linux kernel RPC client requests that
85 .B rpc.gssd
86 initialize a security context with the credential
87 in that user's credential file.
88 .P
89 Typically, credential files are placed in
90 .IR /tmp .
91 However,
92 .B rpc.gssd
93 can search for credential files in more than one directory.
94 See the description of the
95 .B -d
96 option for details.
97 .SS Machine Credentials
98 .B rpc.gssd
99 searches the default keytab,
100 .IR /etc/krb5.keytab ,
101 in the following order for a principal and password to use
102 when establishing the machine credential.
103 For the search, rpc.gssd replaces <hostname> and <REALM> with the local
104 system's hostname and Kerberos realm.
105 .sp
106 <HOSTNAME>$@<REALM>
107 .br
108 root/<hostname>@<REALM>
109 .br
110 nfs/<hostname>@<REALM>
111 .br
112 host/<hostname>@<REALM>
113 .br
114 root/<anyname>@<REALM>
115 .br
116 nfs/<anyname>@<REALM>
117 .br
118 host/<anyname>@<REALM>
119 .sp
120 rpc.gssd selects one of the <anyname> entries if it does not find
121 a service principal matching the local hostname,
122 e.g. if DHCP assigns the local hostname dynamically.
123 The <anyname> facility enables the use of the same keytab on multiple systems.
124 However, using the same service principal to establish a machine credential
125 on multiple hosts can create unwanted security exposures
126 and is therefore not recommended.
127 .P
128 Note that <HOSTNAME>$@<REALM> is a user principal
129 that enables Kerberized NFS when the local system is joined
130 to an Active Directory domain using Samba.
131 The keytab provides the password for this principal.
132 .P
133 You can specify a different keytab by using the
134 .B -k
135 option if
136 .I /etc/krb5.keytab
137 does not exist or does not provide one of these principals.
138 .SS Credentials for UID 0
139 UID 0 is a special case.
140 By default
141 .B rpc.gssd
142 uses the system's machine credentials for UID 0 accesses
143 that require GSS authentication.
144 This limits the privileges of the root user
145 when accessing network resources that require authentication.
146 .P
147 Specify the
148 .B -n
149 option when starting
150 .B rpc.gssd
151 if you'd like to force the root user to obtain a user credential
152 rather than use the local system's machine credential.
153 .P
154 When
155 .B -n
156 is specified,
157 the kernel continues to request a GSS context established
158 with a machine credential for NFSv4 operations,
159 such as SETCLIENTID or RENEW, that manage state.
160 If
161 .B rpc.gssd
162 cannot obtain a machine credential (say, the local system has
163 no keytab), NFSv4 operations that require machine credentials will fail.
164 .SS Encryption types
165 A realm administrator can choose to add keys encoded in a number of different
166 encryption types to the local system's keytab.
167 For instance, a host/ principal might have keys for the
168 .BR aes256-cts-hmac-sha1-96 ,
169 .BR aes128-cts-hmac-sha1-96 ,
170 .BR des3-cbc-sha1 ", and"
171 .BR arcfour-hmac " encryption types."
172 This permits
173 .B rpc.gssd
174 to choose an appropriate encryption type that the target NFS server
175 supports.
176 .P
177 These encryption types are stronger than legacy single-DES encryption types.
178 To interoperate in environments where servers support
179 only weak encryption types,
180 you can restrict your client to use only single-DES encryption types
181 by specifying the
182 .B -l
183 option when starting
184 .BR rpc.gssd .
185 .SH OPTIONS
186 .TP
187 .B \-D
188 The server name passed to GSSAPI for authentication is normally the
189 name exactly as requested. e.g. for NFS
190 it is the server name in the "servername:/path" mount request. Only if this
191 servername appears to be an IP address (IPv4 or IPv6) or an
192 unqualified name (no dots) will a reverse DNS lookup
193 will be performed to get the canoncial server name.
194
195 If
196 .B \-D
197 is present, a reverse DNS lookup will
198 .I always
199 be used, even if the server name looks like a canonical name. So it
200 is needed if partially qualified, or non canonical names are regularly
201 used.
202
203 Using
204 .B \-D
205 can introduce a security vulnerability, so it is recommended that
206 .B \-D
207 not be used, and that canonical names always be used when requesting
208 services.
209 .TP
210 .B -f
211 Runs
212 .B rpc.gssd
213 in the foreground and sends output to stderr (as opposed to syslogd)
214 .TP
215 .B -n
216 When specified, UID 0 is forced to obtain user credentials
217 which are used instead of the local system's machine credentials.
218 .TP
219 .BI "-k " keytab
220 Tells
221 .B rpc.gssd
222 to use the keys found in
223 .I keytab
224 to obtain machine credentials.
225 The default value is
226 .IR /etc/krb5.keytab .
227 .TP
228 .B -l
229 When specified, restricts
230 .B rpc.gssd
231 to sessions to weak encryption types such as
232 .BR des-cbc-crc .
233 This option is available only when the local system's Kerberos library
234 supports settable encryption types.
235 .TP
236 .BI "-p " path
237 Tells
238 .B rpc.gssd
239 where to look for the rpc_pipefs filesystem. The default value is
240 .IR /var/lib/nfs/rpc_pipefs .
241 .TP
242 .BI "-d " search-path
243 This option specifies a colon separated list of directories that
244 .B rpc.gssd
245 searches for credential files. The default value is
246 .IR /tmp:/run/user/%U .
247 The literal sequence "%U" can be specified to substitue the UID
248 of the user for whom credentials are being searched.
249 .TP
250 .B -M
251 By default, machine credentials are stored in files in the first
252 directory in the credential directory search path (see the
253 .B -d
254 option). When
255 .B -M
256 is set,
257 .B rpc.gssd
258 stores machine credentials in memory instead.
259 .TP
260 .B -v
261 Increases the verbosity of the output (can be specified multiple times).
262 .TP
263 .B -r
264 If the RPCSEC_GSS library supports setting debug level,
265 increases the verbosity of the output (can be specified multiple times).
266 .TP
267 .BI "-R " realm
268 Kerberos tickets from this
269 .I realm
270 will be preferred when scanning available credentials cache files to be
271 used to create a context. By default, the default realm, as configured
272 in the Kerberos configuration file, is preferred.
273 .TP
274 .BI "-t " timeout
275 Timeout, in seconds, for kernel GSS contexts. This option allows you to force
276 new kernel contexts to be negotiated after
277 .I timeout
278 seconds, which allows changing Kerberos tickets and identities frequently.
279 The default is no explicit timeout, which means the kernel context will live
280 the lifetime of the Kerberos service ticket used in its creation.
281 .TP
282 .BI "-T " timeout
283 Timeout, in seconds, to create an RPC connection with a server while
284 establishing an authenticated gss context for a user.
285 The default timeout is set to 5 seconds.
286 If you get messages like "WARNING: can't create tcp rpc_clnt to server
287 %servername% for user with uid %uid%: RPC: Remote system error -
288 Connection timed out", you should consider an increase of this timeout.
289 .TP
290 .BI "-U " timeout
291 Timeout, in seconds, for upcall threads. Threads executing longer than
292 .I timeout
293 seconds will cause an error message to be logged. The default
294 .I timeout
295 is 30 seconds. The minimum is 5 seconds. The maximum is 600 seconds.
296 .TP
297 .B -C
298 In addition to logging an error message for threads that have timed out,
299 the thread will be canceled and an error of -ETIMEDOUT will be reported
300 to the kernel.
301 .TP
302 .B -H
303 Avoids setting $HOME to "/". This allows rpc.gssd to read per user k5identity
304 files versus trying to read /.k5identity for each user.
305
306 If
307 .B \-H
308 is not set, rpc.gssd will use the first match found in
309 /var/kerberos/krb5/user/$EUID/client.keytab and will not use a principal based on
310 host and/or service parameters listed in $HOME/.k5identity.
311 .SH CONFIGURATION FILE
312 Many of the options that can be set on the command line can also be
313 controlled through values set in the
314 .B [gssd]
315 section of the
316 .I /etc/nfs.conf
317 configuration file. Values recognized include:
318 .TP
319 .B verbosity
320 Value which is equivalent to the number of
321 .BR -v .
322 .TP
323 .B rpc-verbosity
324 Value which is equivalent to the number of
325 .BR -r .
326 .TP
327 .B use-memcache
328 A Boolean flag equivalent to
329 .BR -M .
330 .TP
331 .B use-machine-creds
332 A Boolean flag. Setting to
333 .B false
334 is equivalent to giving the
335 .B -n
336 flag.
337 .TP
338 .B avoid-dns
339 Setting to
340 .B false
341 is equivalent to providing the
342 .B -D
343 flag.
344 .TP
345 .B limit-to-legacy-enctypes
346 Equivalent to
347 .BR -l .
348 .TP
349 .B allowed-enctypes
350 Allows you to restrict
351 .B rpc.gssd
352 to using a subset of the encryption types permitted by the kernel and the krb5
353 libraries. This is useful if you need to interoperate with an NFS server that
354 does not have support for the newer SHA2 and Camellia encryption types, for
355 example. This configuration file option does not have an equivalent
356 command-line option.
357 .TP
358 .B context-timeout
359 Equivalent to
360 .BR -t .
361 .TP
362 .B rpc-timeout
363 Equivalent to
364 .BR -T .
365 .TP
366 .B keytab-file
367 Equivalent to
368 .BR -k .
369 .TP
370 .BR cred-cache-directory
371 Equivalent to
372 .BR -d .
373 .TP
374 .B preferred-realm
375 Equivalent to
376 .BR -R .
377 .TP
378 .B upcall-timeout
379 Equivalent to
380 .BR -U .
381 .TP
382 .B cancel-timed-out-upcalls
383 Setting to
384 .B true
385 is equivalent to providing the
386 .B -C
387 flag.
388 .TP
389 .B set-home
390 Setting to
391 .B false
392 is equivalent to providing the
393 .B -H
394 flag.
395 .TP
396 .B use-gss-proxy
397 Setting this to 1 allows
398 .BR gssproxy (8)
399 to intercept GSSAPI calls and service them on behalf of
400 .BR rpc.gssd ,
401 enabling certain features such as keytab-based client initiation.
402 Note that this is unrelated to the functionality that
403 .BR gssproxy (8)
404 provides on behalf of the NFS server. For more information, see
405 .BR https://github.com/gssapi/gssproxy/blob/main/docs/NFS.md#nfs-client .
406 .P
407 In addtion, the following value is recognized from the
408 .B [general]
409 section:
410 .TP
411 .B pipefs-directory
412 Equivalent to
413 .BR -p .
414
415 .SH SEE ALSO
416 .BR rpc.svcgssd (8),
417 .BR kerberos (1),
418 .BR kinit (1),
419 .BR krb5.conf (5),
420 .BR gssproxy (8)
421 .SH AUTHORS
422 .br
423 Dug Song <[email protected]>
424 .br
425 Andy Adamson <[email protected]>
426 .br
427 Marius Aamodt Eriksen <[email protected]>
428 .br
429 J. Bruce Fields <[email protected]>