Debian Codegraph @

upstream/debian-unstable/man8/mountd.8

raw
1 .\"@(#)rpc.mountd.8"
2 .\"
3 .\" Copyright (C) 1999 Olaf Kirch <[email protected]>
4 .\" Modified by Paul Clements, 2004.
5 .\"
6 .TH rpc.mountd 8 "31 Dec 2009"
7 .SH NAME
8 rpc.mountd \- NFS mount daemon
9 .SH SYNOPSIS
10 .BI "/usr/sbin/rpc.mountd [" options "]"
11 .SH DESCRIPTION
12 The
13 .B rpc.mountd
14 daemon implements the server side of the NFS MOUNT protocol,
15 an NFS side protocol used by NFS version 2 [RFC1094] and NFS version 3 [RFC1813].
16 It also responds to requests from the Linux kernel to authenticate
17 clients and provides details of access permissions.
18 .PP
19 The NFS server
20 .RI ( nfsd )
21 maintains a cache of authentication and authorization information which
22 is used to identify the source of each request, and then what access
23 permissions that source has to any local filesystem. When required
24 information is not found in the cache, the server sends a request to
25 .B mountd
26 to fill in the missing information. Mountd uses a table of information
27 stored in
28 .B /var/lib/nfs/etab
29 and maintained by
30 .BR exportfs (8),
31 possibly based on the contents of
32 .BR exports (5),
33 to respond to each request.
34 .SS Mounting exported NFS File Systems
35 The NFS MOUNT protocol has several procedures.
36 The most important of these are
37 MNT (mount an export) and
38 UMNT (unmount an export).
39 .PP
40 A MNT request has two arguments: an explicit argument that
41 contains the pathname of the root directory of the export to be mounted,
42 and an implicit argument that is the sender's IP address.
43 .PP
44 When receiving a MNT request from an NFS client,
45 .B rpc.mountd
46 checks both the pathname and the sender's IP address against its export table.
47 If the sender is permitted to access the requested export,
48 .B rpc.mountd
49 returns an NFS file handle for the export's root directory to the client.
50 The client can then use the root file handle and NFS LOOKUP requests
51 to navigate the directory structure of the export.
52 .SS The rmtab File
53 The
54 .B rpc.mountd
55 daemon registers every successful MNT request by adding an entry to the
56 .I /var/lib/nfs/rmtab
57 file.
58 When receiving a UMNT request from an NFS client,
59 .B rpc.mountd
60 simply removes the matching entry from
61 .IR /var/lib/nfs/rmtab ,
62 as long as the access control list for that export allows that sender
63 to access the export.
64 .PP
65 Clients can discover the list of file systems an NFS server is
66 currently exporting, or the list of other clients that have mounted
67 its exports, by using the
68 .BR showmount (8)
69 command.
70 .BR showmount (8)
71 uses other procedures in the NFS MOUNT protocol to report information
72 about the server's exported file systems.
73 .PP
74 Note, however, that there is little to guarantee that the contents of
75 .I /var/lib/nfs/rmtab
76 are accurate.
77 A client may continue accessing an export even after invoking UMNT.
78 If the client reboots without sending a UMNT request, stale entries
79 remain for that client in
80 .IR /var/lib/nfs/rmtab .
81 .SS Mounting File Systems with NFSv4
82 Version 4 (and later) of NFS does not use a separate NFS MOUNT
83 protocol. Instead mounting is performed using regular NFS requests
84 handled by the NFS server in the Linux kernel
85 .RI ( nfsd ).
86 Consequently
87 .I /var/lib/nfs/rmtab
88 is not updated to reflect any NFSv4 activity.
89 .SH OPTIONS
90 .TP
91 .B \-d kind " or " \-\-debug kind
92 Turn on debugging. Valid kinds are: all, auth, call, general and parse.
93 .TP
94 .BR \-l " or " \-\-log\-auth
95 Enable logging of responses to authentication and access requests from
96 nfsd. Each response is then cached by the kernel for 30 minutes (or as set by
97 .B \-\-ttl
98 below), and will be refreshed after 15 minutes (half the ttl time) if
99 the relevant client remains active.
100 Note that
101 .B -l
102 is equivalent to
103 .B "-d auth"
104 and so can be enabled in
105 .B /etc/nfs.conf
106 with
107 .B "\[dq]debug = auth\[dq]"
108 in the
109 .B "[mountd]"
110 section.
111 .IP
112 .B rpc.mountd
113 will always log authentication responses to MOUNT requests when NFSv3 is
114 used, but to get similar logs for NFSv4, this option is required.
115 .TP
116 .BR \-i " or " \-\-cache\-use\-ipaddr
117 Normally each client IP address is matched against each host identifier
118 (name, wildcard, netgroup etc) found in
119 .B /etc/exports
120 and a combined identity is formed from all matching identifiers.
121 Often many clients will map to the same combined identity so performing
122 this mapping reduces the number of distinct access details that the
123 kernel needs to store.
124 Specifying the
125 .B \-i
126 option suppresses this mapping so that access to each filesystem is
127 requested and cached separately for each client IP address. Doing this
128 can increase the burden of updating the cache slightly, but can make the
129 log messages produced by the
130 .B -l
131 option easier to read.
132 .TP
133 .B \-T " or " \-\-ttl
134 Provide a time-to-live (TTL) for cached information given to the kernel.
135 The kernel will normally request an update if the information is needed
136 after half of this time has expired. Increasing the provided number,
137 which is in seconds, reduces the rate of cache update requests, and this
138 is particularly noticeable when these requests are logged with
139 .BR \-l .
140 However increasing also means that changes to hostname to address
141 mappings can take longer to be noticed.
142 The default TTL is 1800 (30 minutes).
143 .TP
144 .B \-F " or " \-\-foreground
145 Run in foreground (do not daemonize)
146 .TP
147 .B \-h " or " \-\-help
148 Display usage message.
149 .TP
150 .B \-o num " or " \-\-descriptors num
151 Set the limit of the number of open file descriptors to num. The
152 default is to leave the limit unchanged.
153 .TP
154 .B \-N mountd-version " or " \-\-no-nfs-version mountd-version
155 This option can be used to request that
156 .B rpc.mountd
157 do not offer certain versions of NFS. The current version of
158 .B rpc.mountd
159 can support both NFS version 2, 3 and 4. If the
160 either one of these version should not be offered,
161 .B rpc.mountd
162 must be invoked with the option
163 .B "\-\-no-nfs-version <vers>" .
164 .TP
165 .B \-n " or " \-\-no-tcp
166 Don't advertise TCP for mount.
167 .TP
168 .B \-p num " or " \-P num " or " \-\-port num
169 Specifies the port number used for RPC listener sockets.
170 If this option is not specified,
171 .B rpc.mountd
172 will try to consult
173 .IR /etc/services ,
174 if gets port succeed, set the same port for all listener socket,
175 otherwise chooses a random ephemeral port for each listener socket.
176 .IP
177 This option can be used to fix the port value of
178 .BR rpc.mountd 's
179 listeners when NFS MOUNT requests must traverse a firewall
180 between clients and servers.
181 .TP
182 .B \-H " prog or " \-\-ha-callout prog
183 Specify a high availability callout program.
184 This program receives callouts for all MOUNT and UNMOUNT requests.
185 This allows
186 .B rpc.mountd
187 to be used in a High Availability NFS (HA-NFS) environment.
188 .IP
189 The callout program is run with 4 arguments.
190 The first is
191 .B mount
192 or
193 .B unmount
194 depending on the reason for the callout.
195 The second will be the name of the client performing the mount.
196 The third will be the path that the client is mounting.
197 The last is the number of concurrent mounts that we believe the client
198 has of that path.
199 .IP
200 This callout is not needed with 2.6 and later kernels.
201 Instead, mount the nfsd filesystem on
202 .IR /proc/fs/nfsd .
203 .TP
204 .BI "\-s," "" " \-\-state\-directory\-path " directory
205 Specify a directory in which to place state information (etab and rmtab).
206 If this option is not specified the default of
207 .I /var/lib/nfs
208 is used.
209 .TP
210 .BI "\-r," "" " \-\-reverse\-lookup"
211 .B rpc.mountd
212 tracks IP addresses in the
213 .I rmtab
214 file. When a DUMP request is made (by
215 someone running
216 .BR "showmount -a" ,
217 for instance), it returns IP addresses instead
218 of hostnames by default. This option causes
219 .B rpc.mountd
220 to perform a reverse lookup on each IP address and return that hostname instead.
221 Enabling this can have a substantial negative effect on performance
222 in some situations.
223 .TP
224 .BR "\-t N" " or " "\-\-num\-threads=N " or " \-\-num\-threads N "
225 This option specifies the number of worker threads that rpc.mountd
226 spawns. The default is 1 thread, which is probably enough. More
227 threads are usually only needed for NFS servers which need to handle
228 mount storms of hundreds of NFS mounts in a few seconds, or when
229 your DNS server is slow or unreliable.
230 .TP
231 .B \-u " or " \-\-no-udp
232 Don't advertise UDP for mounting
233 .TP
234 .B \-V version " or " \-\-nfs-version version
235 This option can be used to request that
236 .B rpc.mountd
237 offer certain versions of NFS. The current version of
238 .B rpc.mountd
239 can support both NFS version 2 and the newer version 3.
240 .TP
241 .B \-v " or " \-\-version
242 Print the version of
243 .B rpc.mountd
244 and exit.
245 .TP
246 .B \-c " or " \-\-apply-root-cred
247 When mountd is asked to allow a NFSv3 mount to a subdirectory of the
248 exported directory, then it will check if the user asking to mount has
249 lookup rights to the directories below that exported directory. When
250 performing the check, mountd will apply any root squash or all squash
251 rules that were specified for that client.
252
253 Performing lookup checks as the user requires that the mountd daemon
254 be run as root or that it be given CAP_SETUID and CAP_SETGID privileges
255 so that it can change its own effective user and effective group settings.
256 When troubleshooting, please also note that LSM frameworks such as SELinux
257 can sometimes prevent the daemon from changing the effective user/groups
258 despite the capability settings.
259
260 In earlier versions of mountd, the same checks were performed using the
261 mountd daemon's root privileges, meaning that it could authorise access
262 to directories that are not normally accessible to the user requesting
263 to mount them. This option enables that legacy behaviour.
264
265 .BR Note:
266 If there is a need to provide access to specific subdirectories that
267 are not normally accessible to a client, it is always possible to add
268 export entries that explicitly grant such access. That ability does
269 not depend on this option being enabled.
270
271 .TP
272 .B \-g " or " \-\-manage-gids
273 Accept requests from the kernel to map user id numbers into lists of
274 group id numbers for use in access control. An NFS request will
275 normally (except when using Kerberos or other cryptographic
276 authentication) contains a user-id and a list of group-ids. Due to a
277 limitation in the NFS protocol, at most 16 groups ids can be listed.
278 If you use the
279 .B \-g
280 flag, then the list of group ids received from the client will be
281 replaced by a list of group ids determined by an appropriate lookup on
282 the server. Note that the 'primary' group id is not affected so a
283 .B newgroup
284 command on the client will still be effective. This function requires
285 a Linux Kernel with version at least 2.6.21.
286
287 .TP
288 .B \-L " or " \-\-no-netlink
289 Disable the use of netlink for kernel communication and force the use
290 of the legacy
291 .I /proc/net/rpc
292 interfaces instead. This can be useful for debugging or working around
293 kernel netlink issues.
294
295 .SH CONFIGURATION FILE
296 Many of the options that can be set on the command line can also be
297 controlled through values set in the
298 .B [mountd]
299 or, in some cases, the
300 .B [nfsd]
301 sections of the
302 .I /etc/nfs.conf
303 configuration file.
304 Values recognized in the
305 .B [mountd]
306 section include
307 .BR manage-gids ,
308 .BR no\-netlink ,
309 .BR cache\-use\-ipaddr ,
310 .BR descriptors ,
311 .BR port ,
312 .BR threads ,
313 .BR ttl ,
314 .BR reverse-lookup ", and"
315 .BR state-directory-path ,
316 .B ha-callout
317 which each have the same effect as the option with the same name.
318
319 The values recognized in the
320 .B [nfsd]
321 section include
322 .BR TCP ,
323 .BR UDP ,
324 .BR vers3 ", and"
325 .B vers4
326 which each have the same meaning as given by
327 .BR rpc.nfsd (8).
328
329 .SH TCP_WRAPPERS SUPPORT
330 You can protect your
331 .B rpc.mountd
332 listeners using the
333 .B tcp_wrapper
334 library or
335 .BR iptables (8).
336 .PP
337 Note that the
338 .B tcp_wrapper
339 library supports only IPv4 networking.
340 .PP
341 Add the hostnames of NFS peers that are allowed to access
342 .B rpc.mountd
343 to
344 .IR /etc/hosts.allow .
345 Use the daemon name
346 .B mountd
347 even if the
348 .B rpc.mountd
349 binary has a different name.
350 .PP
351 Hostnames used in either access file will be ignored when
352 they can not be resolved into IP addresses.
353 For further information see the
354 .BR tcpd (8)
355 and
356 .BR hosts_access (5)
357 man pages.
358 .SS IPv6 and TI-RPC support
359 TI-RPC is a pre-requisite for supporting NFS on IPv6.
360 If TI-RPC support is built into
361 .BR rpc.mountd ,
362 it attempts to start listeners on network transports marked 'visible' in
363 .IR /etc/netconfig .
364 As long as at least one network transport listener starts successfully,
365 .B rpc.mountd
366 will operate.
367 .SH FILES
368 .TP 2.5i
369 .I /etc/exports
370 input file for
371 .BR exportfs ,
372 listing exports, export options, and access control lists
373 .TP 2.5i
374 .I /var/lib/nfs/rmtab
375 table of clients accessing server's exports
376 .SH SEE ALSO
377 .BR exportfs (8),
378 .BR exports (5),
379 .BR showmount (8),
380 .BR rpc.nfsd (8),
381 .BR rpc.rquotad (8),
382 .BR nfs (5),
383 .BR nfs.conf (5),
384 .BR tcpd (8),
385 .BR hosts_access (5),
386 .BR iptables (8),
387 .BR netconfig (5)
388 .sp
389 RFC 1094 - "NFS: Network File System Protocol Specification"
390 .br
391 RFC 1813 - "NFS Version 3 Protocol Specification"
392 .br
393 RFC 7530 - "Network File System (NFS) Version 4 Protocol"
394 .br
395 RFC 8881 - "Network File System (NFS) Version 4 Minor Version 1 Protocol"
396 .SH AUTHOR
397 Olaf Kirch, H. J. Lu, G. Allan Morris III, and a host of others.