Debian Codegraph @

upstream/debian-trixie/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 receivng 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 \-g " or " \-\-manage-gids
247 Accept requests from the kernel to map user id numbers into lists of
248 group id numbers for use in access control. An NFS request will
249 normally (except when using Kerberos or other cryptographic
250 authentication) contains a user-id and a list of group-ids. Due to a
251 limitation in the NFS protocol, at most 16 groups ids can be listed.
252 If you use the
253 .B \-g
254 flag, then the list of group ids received from the client will be
255 replaced by a list of group ids determined by an appropriate lookup on
256 the server. Note that the 'primary' group id is not affected so a
257 .B newgroup
258 command on the client will still be effective. This function requires
259 a Linux Kernel with version at least 2.6.21.
260
261 .SH CONFIGURATION FILE
262 Many of the options that can be set on the command line can also be
263 controlled through values set in the
264 .B [mountd]
265 or, in some cases, the
266 .B [nfsd]
267 sections of the
268 .I /etc/nfs.conf
269 configuration file.
270 Values recognized in the
271 .B [mountd]
272 section include
273 .BR manage-gids ,
274 .BR cache\-use\-ipaddr ,
275 .BR descriptors ,
276 .BR port ,
277 .BR threads ,
278 .BR ttl ,
279 .BR reverse-lookup ", and"
280 .BR state-directory-path ,
281 .B ha-callout
282 which each have the same effect as the option with the same name.
283
284 The values recognized in the
285 .B [nfsd]
286 section include
287 .BR TCP ,
288 .BR UDP ,
289 .BR vers3 ", and"
290 .B vers4
291 which each have the same meaning as given by
292 .BR rpc.nfsd (8).
293
294 .SH TCP_WRAPPERS SUPPORT
295 You can protect your
296 .B rpc.mountd
297 listeners using the
298 .B tcp_wrapper
299 library or
300 .BR iptables (8).
301 .PP
302 Note that the
303 .B tcp_wrapper
304 library supports only IPv4 networking.
305 .PP
306 Add the hostnames of NFS peers that are allowed to access
307 .B rpc.mountd
308 to
309 .IR /etc/hosts.allow .
310 Use the daemon name
311 .B mountd
312 even if the
313 .B rpc.mountd
314 binary has a different name.
315 .PP
316 Hostnames used in either access file will be ignored when
317 they can not be resolved into IP addresses.
318 For further information see the
319 .BR tcpd (8)
320 and
321 .BR hosts_access (5)
322 man pages.
323 .SS IPv6 and TI-RPC support
324 TI-RPC is a pre-requisite for supporting NFS on IPv6.
325 If TI-RPC support is built into
326 .BR rpc.mountd ,
327 it attempts to start listeners on network transports marked 'visible' in
328 .IR /etc/netconfig .
329 As long as at least one network transport listener starts successfully,
330 .B rpc.mountd
331 will operate.
332 .SH FILES
333 .TP 2.5i
334 .I /etc/exports
335 input file for
336 .BR exportfs ,
337 listing exports, export options, and access control lists
338 .TP 2.5i
339 .I /var/lib/nfs/rmtab
340 table of clients accessing server's exports
341 .SH SEE ALSO
342 .BR exportfs (8),
343 .BR exports (5),
344 .BR showmount (8),
345 .BR rpc.nfsd (8),
346 .BR rpc.rquotad (8),
347 .BR nfs (5),
348 .BR nfs.conf (5),
349 .BR tcpd (8),
350 .BR hosts_access (5),
351 .BR iptables (8),
352 .BR netconfig (5)
353 .sp
354 RFC 1094 - "NFS: Network File System Protocol Specification"
355 .br
356 RFC 1813 - "NFS Version 3 Protocol Specification"
357 .br
358 RFC 7530 - "Network File System (NFS) Version 4 Protocol"
359 .br
360 RFC 8881 - "Network File System (NFS) Version 4 Minor Version 1 Protocol"
361 .SH AUTHOR
362 Olaf Kirch, H. J. Lu, G. Allan Morris III, and a host of others.