xref: /freebsd/usr.sbin/mountd/exports.5 (revision 8e6b01171e30297084bb0b4457c4183c2746aacc)
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.\" 3. All advertising materials mentioning features or use of this software
13.\"    must display the following acknowledgement:
14.\"	This product includes software developed by the University of
15.\"	California, Berkeley and its contributors.
16.\" 4. Neither the name of the University nor the names of its contributors
17.\"    may be used to endorse or promote products derived from this software
18.\"    without specific prior written permission.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\"     @(#)exports.5	8.2 (Berkeley) 1/28/94
33.\"
34.Dd January 28, 1994
35.Dt EXPORTS 5
36.Os
37.Sh NAME
38.Nm exports
39.Nd define remote mount points for
40.Tn NFS
41mount requests
42.Sh SYNOPSIS
43.Nm exports
44.Sh DESCRIPTION
45The
46.Nm exports
47file specifies remote mount points for the
48.Tn NFS
49mount protocol per the
50.Tn NFS
51server specification; see
52.%T "Network File System Protocol Specification \\*(tNRFC\\*(sP 1094, Appendix A"
53and
54.%T "NFS: Network File System Version 3 Specification, Appendix I" .
55.Pp
56Each line in the file
57(other than comment lines that begin with a #)
58specifies the mount point(s) and export flags within one local server
59filesystem for one or more hosts.
60A host may be specified only once for each local filesystem on the
61server and there may be only one default entry for each server
62filesystem that applies to all other hosts.
63The latter exports the filesystem to the ``world'' and should
64be used only when the filesystem contains public information.
65.Pp
66In a mount entry,
67the first field(s) specify the directory path(s) within a server filesystem
68that can be mounted on by the corresponding client(s).
69There are two forms of this specification.
70The first is to list all mount points as absolute
71directory paths separated by whitespace.
72The second is to specify the pathname of the root of the filesystem
73followed by the
74.Fl alldirs
75flag;
76this form allows the host(s) to mount at any point within the filesystem,
77including regular files if the ``-r'' option is used on mountd.
78The pathnames must not have any symbolic links in them and should not have
79any "." or ".." components.
80Mount points for a filesystem may appear on multiple lines each with
81different sets of hosts and export options.
82.Pp
83The second component of a line specifies how the filesystem is to be
84exported to the host set.
85The option flags specify whether the filesystem
86is exported read-only or read-write and how the client uid is mapped to
87user credentials on the server.
88.Pp
89Export options are specified as follows:
90.Pp
91.Sm off
92.Fl maproot No = Sy user
93.Sm on
94The credential of the specified user is used for remote access by root.
95The credential includes all the groups to which the user is a member
96on the local machine (see
97.Xr id 1 ).
98The user may be specified by name or number.
99.Pp
100.Sm off
101.Fl maproot No = Sy user:group1:group2:...
102.Sm on
103The colon separated list is used to specify the precise credential
104to be used for remote access by root.
105The elements of the list may be either names or numbers.
106Note that user: should be used to distinguish a credential containing
107no groups from a complete credential for that user.
108.Pp
109.Sm off
110.Fl mapall No = Sy user
111.Sm on
112or
113.Sm off
114.Fl mapall No = Sy user:group1:group2:...
115.Sm on
116specifies a mapping for all client uids (including root)
117using the same semantics as
118.Fl maproot .
119.Pp
120The option
121.Fl r
122is a synonym for
123.Fl maproot
124in an effort to be backward compatible with older export file formats.
125.Pp
126In the absence of
127.Fl maproot
128and
129.Fl mapall
130options, remote accesses by root will result in using a credential of -2:-2.
131All other users will be mapped to their remote credential.
132If a
133.Fl maproot
134option is given,
135remote access by root will be mapped to that credential instead of -2:-2.
136If a
137.Fl mapall
138option is given,
139all users (including root) will be mapped to that credential in
140place of their own.
141.Pp
142The
143.Fl kerb
144option specifies that the Kerberos authentication server should be
145used to authenticate and map client credentials.
146This requires that the kernel be built with the NFSKERB option.
147.Pp
148The
149.Fl ro
150option specifies that the filesystem should be exported read-only
151(default read/write).
152The option
153.Fl o
154is a synonym for
155.Fl ro
156in an effort to be backward compatible with older export file formats.
157.Pp
158The third component of a line specifies the host set to which the line applies.
159The set may be specified in three ways.
160The first way is to list the host name(s) separated by white space.
161(Standard internet ``dot'' addresses may be used in place of names.)
162The second way is to specify a ``netgroup'' as defined in the netgroup file (see
163.Xr netgroup 5 ).
164The third way is to specify an internet subnetwork using a network and
165network mask that is defined as the set of all hosts with addresses within
166the subnetwork.
167This latter approach requires less overhead within the
168kernel and is recommended for cases where the export line refers to a
169large number of clients within an administrative subnet.
170.Pp
171The first two cases are specified by simply listing the name(s) separated
172by whitespace.
173All names are checked to see if they are ``netgroup'' names
174first and are assumed to be hostnames otherwise.
175Using the full domain specification for a hostname can normally
176circumvent the problem of a host that has the same name as a netgroup.
177The third case is specified by the flag
178.Sm off
179.Fl network No = Sy netname
180.Sm on
181and optionally
182.Sm off
183.Fl mask No = Sy netmask .
184.Sm on
185If the mask is not specified, it will default to the mask for that network
186class (A, B or C; see
187.Xr inet 5 ).
188.Pp
189For example:
190.Bd -literal -offset indent
191/usr /usr/local -maproot=0:10 friends
192/usr -maproot=daemon grumpy.cis.uoguelph.ca 131.104.48.16
193/usr -ro -mapall=nobody
194/u -maproot=bin: -network 131.104.48 -mask 255.255.255.0
195/u2 -maproot=root friends
196/u2 -alldirs -kerb -network cis-net -mask cis-mask
197.Ed
198.Pp
199Given that
200.Sy /usr ,
201.Sy /u
202and
203.Sy /u2
204are
205local filesystem mount points, the above example specifies the following:
206.Sy /usr
207is exported to hosts
208.Em friends
209where friends is specified in the netgroup file
210with users mapped to their remote credentials and
211root mapped to uid 0 and group 10.
212It is exported read-write and the hosts in ``friends'' can mount either /usr
213or /usr/local.
214It is exported to
215.Em 131.104.48.16
216and
217.Em grumpy.cis.uoguelph.ca
218with users mapped to their remote credentials and
219root mapped to the user and groups associated with ``daemon'';
220it is exported to the rest of the world as read-only with
221all users mapped to the user and groups associated with ``nobody''.
222.Pp
223.Sy /u
224is exported to all hosts on the subnetwork
225.Em 131.104.48
226with root mapped to the uid for ``bin'' and with no group access.
227.Pp
228.Sy /u2
229is exported to the hosts in ``friends'' with root mapped to uid and groups
230associated with ``root'';
231it is exported to all hosts on network ``cis-net'' allowing mounts at any
232directory within /u2 and mapping all uids to credentials for the principal
233that is authenticated by a Kerberos ticket.
234.Sh FILES
235.Bl -tag -width /etc/exports -compact
236.It Pa /etc/exports
237The default remote mount-point file.
238.El
239.Sh SEE ALSO
240.Xr netgroup 5 ,
241.Xr mountd 8 ,
242.Xr nfsd 8 ,
243.Xr showmount 8
244.Sh BUGS
245The export options are tied to the local mount points in the kernel and
246must be non-contradictory for any exported subdirectory of the local
247server mount point.
248It is recommended that all exported directories within the same server
249filesystem be specified on adjacent lines going down the tree.
250You cannot specify a hostname that is also the name of a netgroup.
251Specifying the full domain specification for a hostname can normally
252circumvent the problem.
253