]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.sbin/mountd/exports.5
This commit was generated by cvs2svn to compensate for changes in r172958,
[FreeBSD/FreeBSD.git] / usr.sbin / mountd / exports.5
1 .\" Copyright (c) 1989, 1991, 1993
2 .\"     The Regents of the University of California.  All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\" 4. Neither the name of the University nor the names of its contributors
13 .\"    may be used to endorse or promote products derived from this software
14 .\"    without specific prior written permission.
15 .\"
16 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 .\" SUCH DAMAGE.
27 .\"
28 .\"     @(#)exports.5   8.3 (Berkeley) 3/29/95
29 .\" $FreeBSD$
30 .\"
31 .Dd March 29, 1995
32 .Dt EXPORTS 5
33 .Os
34 .Sh NAME
35 .Nm exports
36 .Nd define remote mount points for
37 .Tn NFS
38 mount requests
39 .Sh SYNOPSIS
40 .Nm
41 .Sh DESCRIPTION
42 The
43 .Nm
44 file specifies remote mount points for the
45 .Tn NFS
46 mount protocol per the
47 .Tn NFS
48 server specification; see
49 .%T "Network File System Protocol Specification" ,
50 RFC1094, Appendix A and
51 .%T "NFS: Network File System Version 3 Specification" ,
52 Appendix I.
53 .Pp
54 Each line in the file
55 (other than comment lines that begin with a #)
56 specifies the mount point(s) and export flags within one local server
57 file system for one or more hosts.
58 A long line may be split over several lines by ending all but the
59 last line with a backslash
60 .Pq Ql \e .
61 A host may be specified only once for each local file system on the
62 server and there may be only one default entry for each server
63 file system that applies to all other hosts.
64 The latter exports the file system to the ``world'' and should
65 be used only when the file system contains public information.
66 .Pp
67 In a mount entry,
68 the first field(s) specify the directory path(s) within a server file system
69 that can be mounted on by the corresponding client(s).
70 There are two forms of this specification.
71 The first is to list all mount points as absolute
72 directory paths separated by whitespace.
73 The second is to specify the pathname of the root of the file system
74 followed by the
75 .Fl alldirs
76 flag;
77 this form allows the host(s) to mount at any point within the file system,
78 including regular files if the
79 .Fl r
80 option is used on
81 .Xr mountd 8 .
82 The pathnames must not have any symbolic links in them and should not have
83 any "." or ".." components.
84 Mount points for a file system may appear on multiple lines each with
85 different sets of hosts and export options.
86 .Pp
87 The second component of a line specifies how the file system is to be
88 exported to the host set.
89 The option flags specify whether the file system
90 is exported read-only or read-write and how the client uid is mapped to
91 user credentials on the server.
92 .Pp
93 Export options are specified as follows:
94 .Pp
95 .Sm off
96 .Fl maproot No = Sy user
97 .Sm on
98 The credential of the specified user is used for remote access by root.
99 The credential includes all the groups to which the user is a member
100 on the local machine (see
101 .Xr id 1 ) .
102 The user may be specified by name or number.
103 .Pp
104 .Sm off
105 .Fl maproot No = Sy user:group1:group2:...
106 .Sm on
107 The colon separated list is used to specify the precise credential
108 to be used for remote access by root.
109 The elements of the list may be either names or numbers.
110 Note that user: should be used to distinguish a credential containing
111 no groups from a complete credential for that user.
112 .Pp
113 .Sm off
114 .Fl mapall No = Sy user
115 .Sm on
116 or
117 .Sm off
118 .Fl mapall No = Sy user:group1:group2:...
119 .Sm on
120 specifies a mapping for all client uids (including root)
121 using the same semantics as
122 .Fl maproot .
123 .Pp
124 The option
125 .Fl r
126 is a synonym for
127 .Fl maproot
128 in an effort to be backward compatible with older export file formats.
129 .Pp
130 In the absence of
131 .Fl maproot
132 and
133 .Fl mapall
134 options, remote accesses by root will result in using a credential of -2:-2.
135 All other users will be mapped to their remote credential.
136 If a
137 .Fl maproot
138 option is given,
139 remote access by root will be mapped to that credential instead of -2:-2.
140 If a
141 .Fl mapall
142 option is given,
143 all users (including root) will be mapped to that credential in
144 place of their own.
145 .Pp
146 The
147 .Fl ro
148 option specifies that the file system should be exported read-only
149 (default read/write).
150 The option
151 .Fl o
152 is a synonym for
153 .Fl ro
154 in an effort to be backward compatible with older export file formats.
155 .Pp
156 .Tn WebNFS
157 exports strictly according to the spec (RFC 2054 and RFC 2055) can
158 be done with the
159 .Fl public
160 flag.
161 However, this flag in itself allows r/w access to all files in
162 the file system, not requiring reserved ports and not remapping uids.
163 It
164 is only provided to conform to the spec, and should normally not be used.
165 For a
166 .Tn WebNFS
167 export,
168 use the
169 .Fl webnfs
170 flag, which implies
171 .Fl public ,
172 .Sm off
173 .Fl mapall No = Sy nobody
174 .Sm on
175 and
176 .Fl ro .
177 Note that only one file system can be
178 .Tn WebNFS
179 exported on a server.
180 .Pp
181 A
182 .Sm off
183 .Fl index No = Pa file
184 .Sm on
185 option can be used to specify a file whose handle will be returned if
186 a directory is looked up using the public filehandle
187 .Pq Tn WebNFS .
188 This is to mimic the behavior of URLs.
189 If no
190 .Fl index
191 option is specified, a directory filehandle will be returned as usual.
192 The
193 .Fl index
194 option only makes sense in combination with the
195 .Fl public
196 or
197 .Fl webnfs
198 flags.
199 .Pp
200 Specifying the
201 .Fl quiet
202 option will inhibit some of the syslog diagnostics for bad lines in
203 .Pa /etc/exports .
204 This can be useful to avoid annoying error messages for known possible
205 problems (see
206 .Sx EXAMPLES
207 below).
208 .Pp
209 The third component of a line specifies the host set to which the line applies.
210 The set may be specified in three ways.
211 The first way is to list the host name(s) separated by white space.
212 (Standard Internet ``dot'' addresses may be used in place of names.)
213 The second way is to specify a ``netgroup'' as defined in the netgroup file (see
214 .Xr netgroup 5 ) .
215 The third way is to specify an Internet subnetwork using a network and
216 network mask that is defined as the set of all hosts with addresses within
217 the subnetwork.
218 This latter approach requires less overhead within the
219 kernel and is recommended for cases where the export line refers to a
220 large number of clients within an administrative subnet.
221 .Pp
222 The first two cases are specified by simply listing the name(s) separated
223 by whitespace.
224 All names are checked to see if they are ``netgroup'' names
225 first and are assumed to be hostnames otherwise.
226 Using the full domain specification for a hostname can normally
227 circumvent the problem of a host that has the same name as a netgroup.
228 The third case is specified by the flag
229 .Sm off
230 .Fl network No = Sy netname
231 .Sm on
232 and optionally
233 .Sm off
234 .Fl mask No = Sy netmask .
235 .Sm on
236 If the mask is not specified, it will default to the mask for that network
237 class (A, B or C; see
238 .Xr inet 4 ) .
239 See the
240 .Sx EXAMPLES
241 section below.
242 .Pp
243 The
244 .Xr mountd 8
245 utility can be made to re-read the
246 .Nm
247 file by sending it a hangup signal as follows:
248 .Bd -literal -offset indent
249 kill -s HUP `cat /var/run/mountd.pid`
250 .Ed
251 .Pp
252 After sending the
253 .Dv SIGHUP ,
254 check the
255 .Xr syslogd 8
256 output to see whether
257 .Xr mountd 8
258 logged any parsing errors in the
259 .Nm
260 file.
261 .Sh FILES
262 .Bl -tag -width /etc/exports -compact
263 .It Pa /etc/exports
264 the default remote mount-point file
265 .El
266 .Sh EXAMPLES
267 .Bd -literal -offset indent
268 /usr /usr/local -maproot=0:10 friends
269 /usr -maproot=daemon grumpy.cis.uoguelph.ca 131.104.48.16
270 /usr -ro -mapall=nobody
271 /u -maproot=bin: -network 131.104.48 -mask 255.255.255.0
272 /u2 -maproot=root friends
273 /u2 -alldirs -network cis-net -mask cis-mask
274 /cdrom -alldirs,quiet,ro -network 192.168.33.0 -mask 255.255.255.0
275 .Ed
276 .Pp
277 Given that
278 .Pa /usr ,
279 .Pa /u
280 and
281 .Pa /u2
282 are
283 local file system mount points, the above example specifies the following:
284 .Pp
285 .Pa /usr
286 is exported to hosts
287 .Em friends
288 where friends is specified in the netgroup file
289 with users mapped to their remote credentials and
290 root mapped to uid 0 and group 10.
291 It is exported read-write and the hosts in ``friends'' can mount either /usr
292 or /usr/local.
293 It is exported to
294 .Em 131.104.48.16
295 and
296 .Em grumpy.cis.uoguelph.ca
297 with users mapped to their remote credentials and
298 root mapped to the user and groups associated with ``daemon'';
299 it is exported to the rest of the world as read-only with
300 all users mapped to the user and groups associated with ``nobody''.
301 .Pp
302 .Pa /u
303 is exported to all hosts on the subnetwork
304 .Em 131.104.48
305 with root mapped to the uid for ``bin'' and with no group access.
306 .Pp
307 .Pa /u2
308 is exported to the hosts in ``friends'' with root mapped to uid and groups
309 associated with ``root'';
310 it is exported to all hosts on network ``cis-net'' allowing mounts at any
311 directory within /u2.
312 .Pp
313 The file system rooted at
314 .Pa /cdrom
315 will exported read-only to the entire network 192.168.33.0/24, including
316 all its subdirectories.
317 Since
318 .Pa /cdrom
319 is the conventional mountpoint for a CD-ROM device, this export will
320 fail if no CD-ROM medium is currently mounted there since that line
321 would then attempt to export a subdirectory of the root file system
322 with the
323 .Fl alldirs
324 option which is not allowed.
325 The
326 .Fl quiet
327 option will then suppress the error message for this condition that
328 would normally be syslogged.
329 As soon as an actual CD-ROM is going to be mounted,
330 .Xr mount 8
331 will notify
332 .Xr mountd 8
333 about this situation, and the
334 .Pa /cdrom
335 file system will be exported as intended.
336 Note that without using the
337 .Fl alldirs
338 option, the export would always succeed.
339 While there is no CD-ROM medium mounted under
340 .Pa /cdrom ,
341 it would export the (normally empty) directory
342 .Pa /cdrom
343 of the root file system instead.
344 .Sh SEE ALSO
345 .Xr netgroup 5 ,
346 .Xr mountd 8 ,
347 .Xr nfsd 8 ,
348 .Xr showmount 8
349 .Sh BUGS
350 The export options are tied to the local mount points in the kernel and
351 must be non-contradictory for any exported subdirectory of the local
352 server mount point.
353 It is recommended that all exported directories within the same server
354 file system be specified on adjacent lines going down the tree.
355 You cannot specify a hostname that is also the name of a netgroup.
356 Specifying the full domain specification for a hostname can normally
357 circumvent the problem.