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 447c7fb079SRuslan Ermilov.Nm 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 531252c1bbSRuslan Ermilov.%T "Network File System Protocol Specification" , 541252c1bbSRuslan ErmilovRFC1094, Appendix A and 551252c1bbSRuslan Ermilov.%T "NFS: Network File System Version 3 Specification" , 561252c1bbSRuslan ErmilovAppendix I. 578fae3551SRodney W. Grimes.Pp 588fae3551SRodney W. GrimesEach line in the file 598fae3551SRodney W. Grimes(other than comment lines that begin with a #) 608fae3551SRodney W. Grimesspecifies the mount point(s) and export flags within one local server 618fae3551SRodney W. Grimesfilesystem for one or more hosts. 626060f586SDima DorfmanA long line may be split over several lines by ending all but the 63a03e46ecSRuslan Ermilovlast line with a backslash 64a03e46ecSRuslan Ermilov.Pq Ql \e . 658fae3551SRodney W. GrimesA host may be specified only once for each local filesystem on the 668fae3551SRodney W. Grimesserver and there may be only one default entry for each server 678fae3551SRodney W. Grimesfilesystem that applies to all other hosts. 688fae3551SRodney W. GrimesThe latter exports the filesystem to the ``world'' and should 698fae3551SRodney W. Grimesbe used only when the filesystem contains public information. 708fae3551SRodney W. Grimes.Pp 718fae3551SRodney W. GrimesIn a mount entry, 728fae3551SRodney W. Grimesthe first field(s) specify the directory path(s) within a server filesystem 738fae3551SRodney W. Grimesthat can be mounted on by the corresponding client(s). 748fae3551SRodney W. GrimesThere are two forms of this specification. 758fae3551SRodney W. GrimesThe first is to list all mount points as absolute 768fae3551SRodney W. Grimesdirectory paths separated by whitespace. 778fae3551SRodney W. GrimesThe second is to specify the pathname of the root of the filesystem 788fae3551SRodney W. Grimesfollowed by the 798fae3551SRodney W. Grimes.Fl alldirs 808fae3551SRodney W. Grimesflag; 81a62dc406SDoug Rabsonthis form allows the host(s) to mount at any point within the filesystem, 8287564113SPeter Wemmincluding regular files if the 8387564113SPeter Wemm.Fl r 8491d299f5SKris Kennawayoption is used on 8591d299f5SKris Kennaway.Xr mountd 8 . 868fae3551SRodney W. GrimesThe pathnames must not have any symbolic links in them and should not have 878fae3551SRodney W. Grimesany "." or ".." components. 888fae3551SRodney W. GrimesMount points for a filesystem may appear on multiple lines each with 898fae3551SRodney W. Grimesdifferent sets of hosts and export options. 908fae3551SRodney W. Grimes.Pp 918fae3551SRodney W. GrimesThe second component of a line specifies how the filesystem is to be 928fae3551SRodney W. Grimesexported to the host set. 938fae3551SRodney W. GrimesThe option flags specify whether the filesystem 948fae3551SRodney W. Grimesis exported read-only or read-write and how the client uid is mapped to 958fae3551SRodney W. Grimesuser credentials on the server. 968fae3551SRodney W. Grimes.Pp 978fae3551SRodney W. GrimesExport options are specified as follows: 988fae3551SRodney W. Grimes.Pp 998fae3551SRodney W. Grimes.Sm off 1008fae3551SRodney W. Grimes.Fl maproot No = Sy user 1018fae3551SRodney W. Grimes.Sm on 1028fae3551SRodney W. GrimesThe credential of the specified user is used for remote access by root. 1038fae3551SRodney W. GrimesThe credential includes all the groups to which the user is a member 1048fae3551SRodney W. Grimeson the local machine (see 1058fae3551SRodney W. Grimes.Xr id 1 ) . 1068fae3551SRodney W. GrimesThe user may be specified by name or number. 1078fae3551SRodney W. Grimes.Pp 1088fae3551SRodney W. Grimes.Sm off 1098fae3551SRodney W. Grimes.Fl maproot No = Sy user:group1:group2:... 1108fae3551SRodney W. Grimes.Sm on 1118fae3551SRodney W. GrimesThe colon separated list is used to specify the precise credential 1128fae3551SRodney W. Grimesto be used for remote access by root. 1138fae3551SRodney W. GrimesThe elements of the list may be either names or numbers. 1148fae3551SRodney W. GrimesNote that user: should be used to distinguish a credential containing 1158fae3551SRodney W. Grimesno groups from a complete credential for that user. 1168fae3551SRodney W. Grimes.Pp 1178fae3551SRodney W. Grimes.Sm off 1188fae3551SRodney W. Grimes.Fl mapall No = Sy user 1198fae3551SRodney W. Grimes.Sm on 1208fae3551SRodney W. Grimesor 1218fae3551SRodney W. Grimes.Sm off 1228fae3551SRodney W. Grimes.Fl mapall No = Sy user:group1:group2:... 1238fae3551SRodney W. Grimes.Sm on 1248fae3551SRodney W. Grimesspecifies a mapping for all client uids (including root) 1258fae3551SRodney W. Grimesusing the same semantics as 1268fae3551SRodney W. Grimes.Fl maproot . 1278fae3551SRodney W. Grimes.Pp 1288fae3551SRodney W. GrimesThe option 1298fae3551SRodney W. Grimes.Fl r 1308fae3551SRodney W. Grimesis a synonym for 1318fae3551SRodney W. Grimes.Fl maproot 1328fae3551SRodney W. Grimesin an effort to be backward compatible with older export file formats. 1338fae3551SRodney W. Grimes.Pp 1348fae3551SRodney W. GrimesIn the absence of 1358fae3551SRodney W. Grimes.Fl maproot 1368fae3551SRodney W. Grimesand 1378fae3551SRodney W. Grimes.Fl mapall 1388fae3551SRodney W. Grimesoptions, remote accesses by root will result in using a credential of -2:-2. 1398fae3551SRodney W. GrimesAll other users will be mapped to their remote credential. 1408fae3551SRodney W. GrimesIf a 1418fae3551SRodney W. Grimes.Fl maproot 1428fae3551SRodney W. Grimesoption is given, 1438fae3551SRodney W. Grimesremote access by root will be mapped to that credential instead of -2:-2. 1448fae3551SRodney W. GrimesIf a 1458fae3551SRodney W. Grimes.Fl mapall 1468fae3551SRodney W. Grimesoption is given, 1478fae3551SRodney W. Grimesall users (including root) will be mapped to that credential in 1488fae3551SRodney W. Grimesplace of their own. 1498fae3551SRodney W. Grimes.Pp 1508fae3551SRodney W. GrimesThe 1518fae3551SRodney W. Grimes.Fl kerb 1528fae3551SRodney W. Grimesoption specifies that the Kerberos authentication server should be 1538fae3551SRodney W. Grimesused to authenticate and map client credentials. 15487564113SPeter WemmThis option requires that the kernel be built with the NFSKERB option. 155acaf1e1fSSheldon HearnThe use of this option will prevent the kernel from compiling 156acaf1e1fSSheldon Hearnunless calls to the appropriate Kerberos encryption routines 157acaf1e1fSSheldon Hearnare provided in the NFS source. 1588fae3551SRodney W. Grimes.Pp 1598fae3551SRodney W. GrimesThe 1608fae3551SRodney W. Grimes.Fl ro 1618fae3551SRodney W. Grimesoption specifies that the filesystem should be exported read-only 1628fae3551SRodney W. Grimes(default read/write). 1638fae3551SRodney W. GrimesThe option 1648fae3551SRodney W. Grimes.Fl o 1658fae3551SRodney W. Grimesis a synonym for 1668fae3551SRodney W. Grimes.Fl ro 1678fae3551SRodney W. Grimesin an effort to be backward compatible with older export file formats. 1688fae3551SRodney W. Grimes.Pp 16974853402SPhilippe Charnier.Tn WebNFS 17074853402SPhilippe Charnierexports strictly according to the spec (RFC 2054 and RFC 2055) can 171cb3923e0SDoug Rabsonbe done with the 172cb3923e0SDoug Rabson.Fl public 173f63f700eSSheldon Hearnflag. 174f63f700eSSheldon HearnHowever, this flag in itself allows r/w access to all files in 175f63f700eSSheldon Hearnthe filesystem, not requiring reserved ports and not remapping uids. 176f63f700eSSheldon HearnIt 177cb3923e0SDoug Rabsonis only provided to conform to the spec, and should normally not be used. 17874853402SPhilippe CharnierFor a 17974853402SPhilippe Charnier.Tn WebNFS 18074853402SPhilippe Charnierexport, 181cb3923e0SDoug Rabsonuse the 182cb3923e0SDoug Rabson.Fl webnfs 183cb3923e0SDoug Rabsonflag, which implies 184cb3923e0SDoug Rabson.Fl public , 185cb3923e0SDoug Rabson.Sm off 186cb3923e0SDoug Rabson.Fl mapall No = Sy nobody 187cb3923e0SDoug Rabson.Sm on 188cb3923e0SDoug Rabsonand 189cb3923e0SDoug Rabson.Fl ro . 190cb3923e0SDoug Rabson.Pp 191cb3923e0SDoug RabsonA 192cb3923e0SDoug Rabson.Sm off 193cb3923e0SDoug Rabson.Fl index No = Sy file 19474853402SPhilippe Charnier.Sm on 195cb3923e0SDoug Rabsonoption can be used to specify a file whose handle will be returned if 19674853402SPhilippe Charniera directory is looked up using the public filehandle ( 197d0353b83SRuslan Ermilov.Tn WebNFS ) . 198f63f700eSSheldon HearnThis is to mimic the behavior of URLs. 199f63f700eSSheldon HearnIf no 200cb3923e0SDoug Rabson.Fl index 201cb3923e0SDoug Rabsonoption is specified, a directory filehandle will be returned as usual. 202cb3923e0SDoug RabsonThe 203cb3923e0SDoug Rabson.Fl index 204cb3923e0SDoug Rabsonoption only makes sense in combination with the 205cb3923e0SDoug Rabson.Fl public 206cb3923e0SDoug Rabsonor 207cb3923e0SDoug Rabson.Fl webnfs 208cb3923e0SDoug Rabsonflags. 209cb3923e0SDoug Rabson.Pp 2108fae3551SRodney W. GrimesThe third component of a line specifies the host set to which the line applies. 2118fae3551SRodney W. GrimesThe set may be specified in three ways. 2128fae3551SRodney W. GrimesThe first way is to list the host name(s) separated by white space. 21374853402SPhilippe Charnier(Standard Internet ``dot'' addresses may be used in place of names.) 2148fae3551SRodney W. GrimesThe second way is to specify a ``netgroup'' as defined in the netgroup file (see 2158fae3551SRodney W. Grimes.Xr netgroup 5 ) . 21674853402SPhilippe CharnierThe third way is to specify an Internet subnetwork using a network and 2178fae3551SRodney W. Grimesnetwork mask that is defined as the set of all hosts with addresses within 2188fae3551SRodney W. Grimesthe subnetwork. 2198fae3551SRodney W. GrimesThis latter approach requires less overhead within the 2208fae3551SRodney W. Grimeskernel and is recommended for cases where the export line refers to a 2218fae3551SRodney W. Grimeslarge number of clients within an administrative subnet. 2228fae3551SRodney W. Grimes.Pp 2238fae3551SRodney W. GrimesThe first two cases are specified by simply listing the name(s) separated 2248fae3551SRodney W. Grimesby whitespace. 2258fae3551SRodney W. GrimesAll names are checked to see if they are ``netgroup'' names 2268fae3551SRodney W. Grimesfirst and are assumed to be hostnames otherwise. 2278fae3551SRodney W. GrimesUsing the full domain specification for a hostname can normally 2288fae3551SRodney W. Grimescircumvent the problem of a host that has the same name as a netgroup. 2298fae3551SRodney W. GrimesThe third case is specified by the flag 2308fae3551SRodney W. Grimes.Sm off 2318fae3551SRodney W. Grimes.Fl network No = Sy netname 2328fae3551SRodney W. Grimes.Sm on 2338fae3551SRodney W. Grimesand optionally 2348fae3551SRodney W. Grimes.Sm off 2358fae3551SRodney W. Grimes.Fl mask No = Sy netmask . 2368fae3551SRodney W. Grimes.Sm on 2378fae3551SRodney W. GrimesIf the mask is not specified, it will default to the mask for that network 2388fae3551SRodney W. Grimesclass (A, B or C; see 239906c1e27SMike Pritchard.Xr inet 4 ) . 2408fae3551SRodney W. Grimes.Pp 2418fae3551SRodney W. GrimesFor example: 2428fae3551SRodney W. Grimes.Bd -literal -offset indent 2438fae3551SRodney W. Grimes/usr /usr/local -maproot=0:10 friends 2448fae3551SRodney W. Grimes/usr -maproot=daemon grumpy.cis.uoguelph.ca 131.104.48.16 2458fae3551SRodney W. Grimes/usr -ro -mapall=nobody 2468fae3551SRodney W. Grimes/u -maproot=bin: -network 131.104.48 -mask 255.255.255.0 2478fae3551SRodney W. Grimes/u2 -maproot=root friends 2488fae3551SRodney W. Grimes/u2 -alldirs -kerb -network cis-net -mask cis-mask 2498fae3551SRodney W. Grimes.Ed 2508fae3551SRodney W. Grimes.Pp 2518fae3551SRodney W. GrimesGiven that 2528fae3551SRodney W. Grimes.Sy /usr , 2538fae3551SRodney W. Grimes.Sy /u 2548fae3551SRodney W. Grimesand 2558fae3551SRodney W. Grimes.Sy /u2 2568fae3551SRodney W. Grimesare 2578fae3551SRodney W. Grimeslocal filesystem mount points, the above example specifies the following: 2588fae3551SRodney W. Grimes.Sy /usr 2598fae3551SRodney W. Grimesis exported to hosts 2608fae3551SRodney W. Grimes.Em friends 2618fae3551SRodney W. Grimeswhere friends is specified in the netgroup file 2628fae3551SRodney W. Grimeswith users mapped to their remote credentials and 2638fae3551SRodney W. Grimesroot mapped to uid 0 and group 10. 2648fae3551SRodney W. GrimesIt is exported read-write and the hosts in ``friends'' can mount either /usr 2658fae3551SRodney W. Grimesor /usr/local. 2668fae3551SRodney W. GrimesIt is exported to 2678fae3551SRodney W. Grimes.Em 131.104.48.16 2688fae3551SRodney W. Grimesand 2698fae3551SRodney W. Grimes.Em grumpy.cis.uoguelph.ca 2708fae3551SRodney W. Grimeswith users mapped to their remote credentials and 2718fae3551SRodney W. Grimesroot mapped to the user and groups associated with ``daemon''; 2728fae3551SRodney W. Grimesit is exported to the rest of the world as read-only with 2738fae3551SRodney W. Grimesall users mapped to the user and groups associated with ``nobody''. 2748fae3551SRodney W. Grimes.Pp 2758fae3551SRodney W. Grimes.Sy /u 2768fae3551SRodney W. Grimesis exported to all hosts on the subnetwork 2778fae3551SRodney W. Grimes.Em 131.104.48 2788fae3551SRodney W. Grimeswith root mapped to the uid for ``bin'' and with no group access. 2798fae3551SRodney W. Grimes.Pp 2808fae3551SRodney W. Grimes.Sy /u2 2818fae3551SRodney W. Grimesis exported to the hosts in ``friends'' with root mapped to uid and groups 2828fae3551SRodney W. Grimesassociated with ``root''; 2838fae3551SRodney W. Grimesit is exported to all hosts on network ``cis-net'' allowing mounts at any 2848fae3551SRodney W. Grimesdirectory within /u2 and mapping all uids to credentials for the principal 2858fae3551SRodney W. Grimesthat is authenticated by a Kerberos ticket. 2862f47c461SSheldon Hearn.Pp 2872f47c461SSheldon HearnThe 2882f47c461SSheldon Hearn.Xr mountd 8 2892f47c461SSheldon Hearnutility can be made to re-read the 2902f47c461SSheldon Hearn.Nm 2912f47c461SSheldon Hearnfile by sending it a hangup signal as follows: 2927c7fb079SRuslan Ermilov.Bd -literal -offset indent 2932f47c461SSheldon Hearnkill -s HUP `cat /var/run/mountd.pid` 2942f47c461SSheldon Hearn.Ed 2952f47c461SSheldon Hearn.Pp 2962f47c461SSheldon HearnAfter sending the 2972f47c461SSheldon Hearn.Dv SIGHUP , 2982f47c461SSheldon Hearncheck the 2992f47c461SSheldon Hearn.Xr syslogd 8 3002f47c461SSheldon Hearnoutput to see whether 3012f47c461SSheldon Hearn.Xr mountd 8 3022f47c461SSheldon Hearnlogged any parsing errors in the 3032f47c461SSheldon Hearn.Nm 3042f47c461SSheldon Hearnfile. 3058fae3551SRodney W. Grimes.Sh FILES 3068fae3551SRodney W. Grimes.Bl -tag -width /etc/exports -compact 3078fae3551SRodney W. Grimes.It Pa /etc/exports 30874853402SPhilippe Charnierthe default remote mount-point file 3098fae3551SRodney W. Grimes.El 3108fae3551SRodney W. Grimes.Sh SEE ALSO 3118fae3551SRodney W. Grimes.Xr netgroup 5 , 3128fae3551SRodney W. Grimes.Xr mountd 8 , 3138fae3551SRodney W. Grimes.Xr nfsd 8 , 3148fae3551SRodney W. Grimes.Xr showmount 8 3158fae3551SRodney W. Grimes.Sh BUGS 3168fae3551SRodney W. GrimesThe export options are tied to the local mount points in the kernel and 3178fae3551SRodney W. Grimesmust be non-contradictory for any exported subdirectory of the local 3188fae3551SRodney W. Grimesserver mount point. 3198fae3551SRodney W. GrimesIt is recommended that all exported directories within the same server 3208fae3551SRodney W. Grimesfilesystem be specified on adjacent lines going down the tree. 3218fae3551SRodney W. GrimesYou cannot specify a hostname that is also the name of a netgroup. 3228fae3551SRodney W. GrimesSpecifying the full domain specification for a hostname can normally 3238fae3551SRodney W. Grimescircumvent the problem. 324