xref: /freebsd/usr.sbin/mountd/exports.5 (revision 2f47c46197c0bca4880c781ab906ce6b7ca09dbe)
18fae3551SRodney W. Grimes.\" Copyright (c) 1989, 1991, 1993
28fae3551SRodney W. Grimes.\"	The Regents of the University of California.  All rights reserved.
38fae3551SRodney W. Grimes.\"
48fae3551SRodney W. Grimes.\" Redistribution and use in source and binary forms, with or without
58fae3551SRodney W. Grimes.\" modification, are permitted provided that the following conditions
68fae3551SRodney W. Grimes.\" are met:
78fae3551SRodney W. Grimes.\" 1. Redistributions of source code must retain the above copyright
88fae3551SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer.
98fae3551SRodney W. Grimes.\" 2. Redistributions in binary form must reproduce the above copyright
108fae3551SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer in the
118fae3551SRodney W. Grimes.\"    documentation and/or other materials provided with the distribution.
128fae3551SRodney W. Grimes.\" 3. All advertising materials mentioning features or use of this software
138fae3551SRodney W. Grimes.\"    must display the following acknowledgement:
148fae3551SRodney W. Grimes.\"	This product includes software developed by the University of
158fae3551SRodney W. Grimes.\"	California, Berkeley and its contributors.
168fae3551SRodney W. Grimes.\" 4. Neither the name of the University nor the names of its contributors
178fae3551SRodney W. Grimes.\"    may be used to endorse or promote products derived from this software
188fae3551SRodney W. Grimes.\"    without specific prior written permission.
198fae3551SRodney W. Grimes.\"
208fae3551SRodney W. Grimes.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
218fae3551SRodney W. Grimes.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
228fae3551SRodney W. Grimes.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
238fae3551SRodney W. Grimes.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
248fae3551SRodney W. Grimes.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
258fae3551SRodney W. Grimes.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
268fae3551SRodney W. Grimes.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
278fae3551SRodney W. Grimes.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
288fae3551SRodney W. Grimes.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
298fae3551SRodney W. Grimes.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
308fae3551SRodney W. Grimes.\" SUCH DAMAGE.
318fae3551SRodney W. Grimes.\"
3287564113SPeter Wemm.\"     @(#)exports.5	8.3 (Berkeley) 3/29/95
337f3dea24SPeter Wemm.\" $FreeBSD$
348fae3551SRodney W. Grimes.\"
3587564113SPeter Wemm.Dd March 29, 1995
368fae3551SRodney W. Grimes.Dt EXPORTS 5
378fae3551SRodney W. Grimes.Os
388fae3551SRodney W. Grimes.Sh NAME
398fae3551SRodney W. Grimes.Nm exports
408fae3551SRodney W. Grimes.Nd define remote mount points for
418fae3551SRodney W. Grimes.Tn NFS
428fae3551SRodney W. Grimesmount requests
438fae3551SRodney W. Grimes.Sh SYNOPSIS
448fae3551SRodney W. Grimes.Nm exports
458fae3551SRodney W. Grimes.Sh DESCRIPTION
468fae3551SRodney W. GrimesThe
4774853402SPhilippe Charnier.Nm
488fae3551SRodney W. Grimesfile specifies remote mount points for the
498fae3551SRodney W. Grimes.Tn NFS
508fae3551SRodney W. Grimesmount protocol per the
518fae3551SRodney W. Grimes.Tn NFS
528fae3551SRodney W. Grimesserver specification; see
53a62dc406SDoug Rabson.%T "Network File System Protocol Specification \\*(tNRFC\\*(sP 1094, Appendix A"
54a62dc406SDoug Rabsonand
55a62dc406SDoug Rabson.%T "NFS: Network File System Version 3 Specification, Appendix I" .
568fae3551SRodney W. Grimes.Pp
578fae3551SRodney W. GrimesEach line in the file
588fae3551SRodney W. Grimes(other than comment lines that begin with a #)
598fae3551SRodney W. Grimesspecifies the mount point(s) and export flags within one local server
608fae3551SRodney W. Grimesfilesystem for one or more hosts.
618fae3551SRodney W. GrimesA host may be specified only once for each local filesystem on the
628fae3551SRodney W. Grimesserver and there may be only one default entry for each server
638fae3551SRodney W. Grimesfilesystem that applies to all other hosts.
648fae3551SRodney W. GrimesThe latter exports the filesystem to the ``world'' and should
658fae3551SRodney W. Grimesbe used only when the filesystem contains public information.
668fae3551SRodney W. Grimes.Pp
678fae3551SRodney W. GrimesIn a mount entry,
688fae3551SRodney W. Grimesthe first field(s) specify the directory path(s) within a server filesystem
698fae3551SRodney W. Grimesthat can be mounted on by the corresponding client(s).
708fae3551SRodney W. GrimesThere are two forms of this specification.
718fae3551SRodney W. GrimesThe first is to list all mount points as absolute
728fae3551SRodney W. Grimesdirectory paths separated by whitespace.
738fae3551SRodney W. GrimesThe second is to specify the pathname of the root of the filesystem
748fae3551SRodney W. Grimesfollowed by the
758fae3551SRodney W. Grimes.Fl alldirs
768fae3551SRodney W. Grimesflag;
77a62dc406SDoug Rabsonthis form allows the host(s) to mount at any point within the filesystem,
7887564113SPeter Wemmincluding regular files if the
7987564113SPeter Wemm.Fl r
8091d299f5SKris Kennawayoption is used on
8191d299f5SKris Kennaway.Xr mountd 8 .
828fae3551SRodney W. GrimesThe pathnames must not have any symbolic links in them and should not have
838fae3551SRodney W. Grimesany "." or ".." components.
848fae3551SRodney W. GrimesMount points for a filesystem may appear on multiple lines each with
858fae3551SRodney W. Grimesdifferent sets of hosts and export options.
868fae3551SRodney W. Grimes.Pp
878fae3551SRodney W. GrimesThe second component of a line specifies how the filesystem is to be
888fae3551SRodney W. Grimesexported to the host set.
898fae3551SRodney W. GrimesThe option flags specify whether the filesystem
908fae3551SRodney W. Grimesis exported read-only or read-write and how the client uid is mapped to
918fae3551SRodney W. Grimesuser credentials on the server.
928fae3551SRodney W. Grimes.Pp
938fae3551SRodney W. GrimesExport options are specified as follows:
948fae3551SRodney W. Grimes.Pp
958fae3551SRodney W. Grimes.Sm off
968fae3551SRodney W. Grimes.Fl maproot No = Sy user
978fae3551SRodney W. Grimes.Sm on
988fae3551SRodney W. GrimesThe credential of the specified user is used for remote access by root.
998fae3551SRodney W. GrimesThe credential includes all the groups to which the user is a member
1008fae3551SRodney W. Grimeson the local machine (see
1018fae3551SRodney W. Grimes.Xr id 1 ).
1028fae3551SRodney W. GrimesThe user may be specified by name or number.
1038fae3551SRodney W. Grimes.Pp
1048fae3551SRodney W. Grimes.Sm off
1058fae3551SRodney W. Grimes.Fl maproot No = Sy user:group1:group2:...
1068fae3551SRodney W. Grimes.Sm on
1078fae3551SRodney W. GrimesThe colon separated list is used to specify the precise credential
1088fae3551SRodney W. Grimesto be used for remote access by root.
1098fae3551SRodney W. GrimesThe elements of the list may be either names or numbers.
1108fae3551SRodney W. GrimesNote that user: should be used to distinguish a credential containing
1118fae3551SRodney W. Grimesno groups from a complete credential for that user.
1128fae3551SRodney W. Grimes.Pp
1138fae3551SRodney W. Grimes.Sm off
1148fae3551SRodney W. Grimes.Fl mapall No = Sy user
1158fae3551SRodney W. Grimes.Sm on
1168fae3551SRodney W. Grimesor
1178fae3551SRodney W. Grimes.Sm off
1188fae3551SRodney W. Grimes.Fl mapall No = Sy user:group1:group2:...
1198fae3551SRodney W. Grimes.Sm on
1208fae3551SRodney W. Grimesspecifies a mapping for all client uids (including root)
1218fae3551SRodney W. Grimesusing the same semantics as
1228fae3551SRodney W. Grimes.Fl maproot .
1238fae3551SRodney W. Grimes.Pp
1248fae3551SRodney W. GrimesThe option
1258fae3551SRodney W. Grimes.Fl r
1268fae3551SRodney W. Grimesis a synonym for
1278fae3551SRodney W. Grimes.Fl maproot
1288fae3551SRodney W. Grimesin an effort to be backward compatible with older export file formats.
1298fae3551SRodney W. Grimes.Pp
1308fae3551SRodney W. GrimesIn the absence of
1318fae3551SRodney W. Grimes.Fl maproot
1328fae3551SRodney W. Grimesand
1338fae3551SRodney W. Grimes.Fl mapall
1348fae3551SRodney W. Grimesoptions, remote accesses by root will result in using a credential of -2:-2.
1358fae3551SRodney W. GrimesAll other users will be mapped to their remote credential.
1368fae3551SRodney W. GrimesIf a
1378fae3551SRodney W. Grimes.Fl maproot
1388fae3551SRodney W. Grimesoption is given,
1398fae3551SRodney W. Grimesremote access by root will be mapped to that credential instead of -2:-2.
1408fae3551SRodney W. GrimesIf a
1418fae3551SRodney W. Grimes.Fl mapall
1428fae3551SRodney W. Grimesoption is given,
1438fae3551SRodney W. Grimesall users (including root) will be mapped to that credential in
1448fae3551SRodney W. Grimesplace of their own.
1458fae3551SRodney W. Grimes.Pp
1468fae3551SRodney W. GrimesThe
1478fae3551SRodney W. Grimes.Fl kerb
1488fae3551SRodney W. Grimesoption specifies that the Kerberos authentication server should be
1498fae3551SRodney W. Grimesused to authenticate and map client credentials.
15087564113SPeter WemmThis option requires that the kernel be built with the NFSKERB option.
1518fae3551SRodney W. Grimes.Pp
1528fae3551SRodney W. GrimesThe
1538fae3551SRodney W. Grimes.Fl ro
1548fae3551SRodney W. Grimesoption specifies that the filesystem should be exported read-only
1558fae3551SRodney W. Grimes(default read/write).
1568fae3551SRodney W. GrimesThe option
1578fae3551SRodney W. Grimes.Fl o
1588fae3551SRodney W. Grimesis a synonym for
1598fae3551SRodney W. Grimes.Fl ro
1608fae3551SRodney W. Grimesin an effort to be backward compatible with older export file formats.
1618fae3551SRodney W. Grimes.Pp
16274853402SPhilippe Charnier.Tn WebNFS
16374853402SPhilippe Charnierexports strictly according to the spec (RFC 2054 and RFC 2055) can
164cb3923e0SDoug Rabsonbe done with the
165cb3923e0SDoug Rabson.Fl public
166f63f700eSSheldon Hearnflag.
167f63f700eSSheldon HearnHowever, this flag in itself allows r/w access to all files in
168f63f700eSSheldon Hearnthe filesystem, not requiring reserved ports and not remapping uids.
169f63f700eSSheldon HearnIt
170cb3923e0SDoug Rabsonis only provided to conform to the spec, and should normally not be used.
17174853402SPhilippe CharnierFor a
17274853402SPhilippe Charnier.Tn WebNFS
17374853402SPhilippe Charnierexport,
174cb3923e0SDoug Rabsonuse the
175cb3923e0SDoug Rabson.Fl webnfs
176cb3923e0SDoug Rabsonflag, which implies
177cb3923e0SDoug Rabson.Fl public ,
178cb3923e0SDoug Rabson.Sm off
179cb3923e0SDoug Rabson.Fl mapall No = Sy nobody
180cb3923e0SDoug Rabson.Sm on
181cb3923e0SDoug Rabsonand
182cb3923e0SDoug Rabson.Fl ro .
183cb3923e0SDoug Rabson.Pp
184cb3923e0SDoug RabsonA
185cb3923e0SDoug Rabson.Sm off
186cb3923e0SDoug Rabson.Fl index No = Sy file
18774853402SPhilippe Charnier.Sm on
188cb3923e0SDoug Rabsonoption can be used to specify a file whose handle will be returned if
18974853402SPhilippe Charniera directory is looked up using the public filehandle (
19074853402SPhilippe Charnier.Tn WebNFS Ns ).
191f63f700eSSheldon HearnThis is to mimic the behavior of URLs.
192f63f700eSSheldon HearnIf no
193cb3923e0SDoug Rabson.Fl index
194cb3923e0SDoug Rabsonoption is specified, a directory filehandle will be returned as usual.
195cb3923e0SDoug RabsonThe
196cb3923e0SDoug Rabson.Fl index
197cb3923e0SDoug Rabsonoption only makes sense in combination with the
198cb3923e0SDoug Rabson.Fl public
199cb3923e0SDoug Rabsonor
200cb3923e0SDoug Rabson.Fl webnfs
201cb3923e0SDoug Rabsonflags.
202cb3923e0SDoug Rabson.Pp
2038fae3551SRodney W. GrimesThe third component of a line specifies the host set to which the line applies.
2048fae3551SRodney W. GrimesThe set may be specified in three ways.
2058fae3551SRodney W. GrimesThe first way is to list the host name(s) separated by white space.
20674853402SPhilippe Charnier(Standard Internet ``dot'' addresses may be used in place of names.)
2078fae3551SRodney W. GrimesThe second way is to specify a ``netgroup'' as defined in the netgroup file (see
2088fae3551SRodney W. Grimes.Xr netgroup 5 ).
20974853402SPhilippe CharnierThe third way is to specify an Internet subnetwork using a network and
2108fae3551SRodney W. Grimesnetwork mask that is defined as the set of all hosts with addresses within
2118fae3551SRodney W. Grimesthe subnetwork.
2128fae3551SRodney W. GrimesThis latter approach requires less overhead within the
2138fae3551SRodney W. Grimeskernel and is recommended for cases where the export line refers to a
2148fae3551SRodney W. Grimeslarge number of clients within an administrative subnet.
2158fae3551SRodney W. Grimes.Pp
2168fae3551SRodney W. GrimesThe first two cases are specified by simply listing the name(s) separated
2178fae3551SRodney W. Grimesby whitespace.
2188fae3551SRodney W. GrimesAll names are checked to see if they are ``netgroup'' names
2198fae3551SRodney W. Grimesfirst and are assumed to be hostnames otherwise.
2208fae3551SRodney W. GrimesUsing the full domain specification for a hostname can normally
2218fae3551SRodney W. Grimescircumvent the problem of a host that has the same name as a netgroup.
2228fae3551SRodney W. GrimesThe third case is specified by the flag
2238fae3551SRodney W. Grimes.Sm off
2248fae3551SRodney W. Grimes.Fl network No = Sy netname
2258fae3551SRodney W. Grimes.Sm on
2268fae3551SRodney W. Grimesand optionally
2278fae3551SRodney W. Grimes.Sm off
2288fae3551SRodney W. Grimes.Fl mask No = Sy netmask .
2298fae3551SRodney W. Grimes.Sm on
2308fae3551SRodney W. GrimesIf the mask is not specified, it will default to the mask for that network
2318fae3551SRodney W. Grimesclass (A, B or C; see
232906c1e27SMike Pritchard.Xr inet 4 ).
2338fae3551SRodney W. Grimes.Pp
2348fae3551SRodney W. GrimesFor example:
2358fae3551SRodney W. Grimes.Bd -literal -offset indent
2368fae3551SRodney W. Grimes/usr /usr/local -maproot=0:10 friends
2378fae3551SRodney W. Grimes/usr -maproot=daemon grumpy.cis.uoguelph.ca 131.104.48.16
2388fae3551SRodney W. Grimes/usr -ro -mapall=nobody
2398fae3551SRodney W. Grimes/u -maproot=bin: -network 131.104.48 -mask 255.255.255.0
2408fae3551SRodney W. Grimes/u2 -maproot=root friends
2418fae3551SRodney W. Grimes/u2 -alldirs -kerb -network cis-net -mask cis-mask
2428fae3551SRodney W. Grimes.Ed
2438fae3551SRodney W. Grimes.Pp
2448fae3551SRodney W. GrimesGiven that
2458fae3551SRodney W. Grimes.Sy /usr ,
2468fae3551SRodney W. Grimes.Sy /u
2478fae3551SRodney W. Grimesand
2488fae3551SRodney W. Grimes.Sy /u2
2498fae3551SRodney W. Grimesare
2508fae3551SRodney W. Grimeslocal filesystem mount points, the above example specifies the following:
2518fae3551SRodney W. Grimes.Sy /usr
2528fae3551SRodney W. Grimesis exported to hosts
2538fae3551SRodney W. Grimes.Em friends
2548fae3551SRodney W. Grimeswhere friends is specified in the netgroup file
2558fae3551SRodney W. Grimeswith users mapped to their remote credentials and
2568fae3551SRodney W. Grimesroot mapped to uid 0 and group 10.
2578fae3551SRodney W. GrimesIt is exported read-write and the hosts in ``friends'' can mount either /usr
2588fae3551SRodney W. Grimesor /usr/local.
2598fae3551SRodney W. GrimesIt is exported to
2608fae3551SRodney W. Grimes.Em 131.104.48.16
2618fae3551SRodney W. Grimesand
2628fae3551SRodney W. Grimes.Em grumpy.cis.uoguelph.ca
2638fae3551SRodney W. Grimeswith users mapped to their remote credentials and
2648fae3551SRodney W. Grimesroot mapped to the user and groups associated with ``daemon'';
2658fae3551SRodney W. Grimesit is exported to the rest of the world as read-only with
2668fae3551SRodney W. Grimesall users mapped to the user and groups associated with ``nobody''.
2678fae3551SRodney W. Grimes.Pp
2688fae3551SRodney W. Grimes.Sy /u
2698fae3551SRodney W. Grimesis exported to all hosts on the subnetwork
2708fae3551SRodney W. Grimes.Em 131.104.48
2718fae3551SRodney W. Grimeswith root mapped to the uid for ``bin'' and with no group access.
2728fae3551SRodney W. Grimes.Pp
2738fae3551SRodney W. Grimes.Sy /u2
2748fae3551SRodney W. Grimesis exported to the hosts in ``friends'' with root mapped to uid and groups
2758fae3551SRodney W. Grimesassociated with ``root'';
2768fae3551SRodney W. Grimesit is exported to all hosts on network ``cis-net'' allowing mounts at any
2778fae3551SRodney W. Grimesdirectory within /u2 and mapping all uids to credentials for the principal
2788fae3551SRodney W. Grimesthat is authenticated by a Kerberos ticket.
2792f47c461SSheldon Hearn.Pp
2802f47c461SSheldon HearnThe
2812f47c461SSheldon Hearn.Xr mountd 8
2822f47c461SSheldon Hearnutility can be made to re-read the
2832f47c461SSheldon Hearn.Nm
2842f47c461SSheldon Hearnfile by sending it a hangup signal as follows:
2852f47c461SSheldon Hearn.Bd -literal -offset indet
2862f47c461SSheldon Hearnkill -s HUP `cat /var/run/mountd.pid`
2872f47c461SSheldon Hearn.Ed
2882f47c461SSheldon Hearn.Pp
2892f47c461SSheldon HearnAfter sending the
2902f47c461SSheldon Hearn.Dv SIGHUP ,
2912f47c461SSheldon Hearncheck the
2922f47c461SSheldon Hearn.Xr syslogd 8
2932f47c461SSheldon Hearnoutput to see whether
2942f47c461SSheldon Hearn.Xr mountd 8
2952f47c461SSheldon Hearnlogged any parsing errors in the
2962f47c461SSheldon Hearn.Nm
2972f47c461SSheldon Hearnfile.
2988fae3551SRodney W. Grimes.Sh FILES
2998fae3551SRodney W. Grimes.Bl -tag -width /etc/exports -compact
3008fae3551SRodney W. Grimes.It Pa /etc/exports
30174853402SPhilippe Charnierthe default remote mount-point file
3028fae3551SRodney W. Grimes.El
3038fae3551SRodney W. Grimes.Sh SEE ALSO
3048fae3551SRodney W. Grimes.Xr netgroup 5 ,
3058fae3551SRodney W. Grimes.Xr mountd 8 ,
3068fae3551SRodney W. Grimes.Xr nfsd 8 ,
3078fae3551SRodney W. Grimes.Xr showmount 8
3088fae3551SRodney W. Grimes.Sh BUGS
3098fae3551SRodney W. GrimesThe export options are tied to the local mount points in the kernel and
3108fae3551SRodney W. Grimesmust be non-contradictory for any exported subdirectory of the local
3118fae3551SRodney W. Grimesserver mount point.
3128fae3551SRodney W. GrimesIt is recommended that all exported directories within the same server
3138fae3551SRodney W. Grimesfilesystem be specified on adjacent lines going down the tree.
3148fae3551SRodney W. GrimesYou cannot specify a hostname that is also the name of a netgroup.
3158fae3551SRodney W. GrimesSpecifying the full domain specification for a hostname can normally
3168fae3551SRodney W. Grimescircumvent the problem.
317