162945Sbostic.\" Copyright (c) 1989, 1991, 1993 262945Sbostic.\" The Regents of the University of California. All rights reserved. 344014Smckusick.\" 449641Scael.\" %sccs.include.redist.roff% 544014Smckusick.\" 6*68644Smckusick.\" @(#)exports.5 8.3 (Berkeley) 03/29/95 744014Smckusick.\" 849641Scael.Dd 949641Scael.Dt EXPORTS 5 1049641Scael.Os 1149641Scael.Sh NAME 1249641Scael.Nm exports 1349641Scael.Nd define remote mount points for 1449641Scael.Tn NFS 1549641Scaelmount requests 1649641Scael.Sh SYNOPSIS 1749641Scael.Nm exports 1849641Scael.Sh DESCRIPTION 1949641ScaelThe 2049641Scael.Nm exports 2153148Smckusickfile specifies remote mount points for the 2249641Scael.Tn NFS 2344014Smckusickmount protocol per the 2449641Scael.Tn NFS 2544014Smckusickserver specification; see 26*68644Smckusick.%T "Network File System Protocol Specification \\*(tNRFC\\*(sP 1094, Appendix A" 27*68644Smckusickand 28*68644Smckusick.%T "NFS: Network File System Version 3 Specification, Appendix I" . 2949641Scael.Pp 3051682SmckusickEach line in the file 3151682Smckusick(other than comment lines that begin with a #) 3253148Smckusickspecifies the mount point(s) and export flags within one local server 3353148Smckusickfilesystem for one or more hosts. 3453148SmckusickA host may be specified only once for each local filesystem on the 3553148Smckusickserver and there may be only one default entry for each server 3653148Smckusickfilesystem that applies to all other hosts. 3753148SmckusickThe latter exports the filesystem to the ``world'' and should 3853148Smckusickbe used only when the filesystem contains public information. 3949641Scael.Pp 4051682SmckusickIn a mount entry, 4153148Smckusickthe first field(s) specify the directory path(s) within a server filesystem 4253148Smckusickthat can be mounted on by the corresponding client(s). 4353148SmckusickThere are two forms of this specification. 4453148SmckusickThe first is to list all mount points as absolute 4553148Smckusickdirectory paths separated by whitespace. 4653148SmckusickThe second is to specify the pathname of the root of the filesystem 4753148Smckusickfollowed by the 4853148Smckusick.Fl alldirs 4953148Smckusickflag; 50*68644Smckusickthis form allows the host(s) to mount at any point within the filesystem, 51*68644Smckusickincluding regular files if the 52*68644Smckusick.Fl r 53*68644Smckusickoption is used on mountd. 5465940SbosticThe pathnames must not have any symbolic links in them and should not have 5565940Sbosticany "." or ".." components. 5653148SmckusickMount points for a filesystem may appear on multiple lines each with 5753148Smckusickdifferent sets of hosts and export options. 5851682Smckusick.Pp 5953148SmckusickThe second component of a line specifies how the filesystem is to be 6053148Smckusickexported to the host set. 6153148SmckusickThe option flags specify whether the filesystem 6253148Smckusickis exported read-only or read-write and how the client uid is mapped to 6353148Smckusickuser credentials on the server. 6453148Smckusick.Pp 6551682SmckusickExport options are specified as follows: 6651682Smckusick.Pp 6749641Scael.Sm off 6853148Smckusick.Fl maproot No = Sy user 6949641Scael.Sm on 7051682SmckusickThe credential of the specified user is used for remote access by root. 7151682SmckusickThe credential includes all the groups to which the user is a member 7251682Smckusickon the local machine (see 7351682Smckusick.Xr id 1 ). 7451682SmckusickThe user may be specified by name or number. 7551682Smckusick.Pp 7651682Smckusick.Sm off 7753148Smckusick.Fl maproot No = Sy user:group1:group2:... 7851682Smckusick.Sm on 7951682SmckusickThe colon separated list is used to specify the precise credential 8051682Smckusickto be used for remote access by root. 8151682SmckusickThe elements of the list may be either names or numbers. 8251682SmckusickNote that user: should be used to distinguish a credential containing 8351682Smckusickno groups from a complete credential for that user. 8451682Smckusick.Pp 8551682Smckusick.Sm off 8653148Smckusick.Fl mapall No = Sy user 8751682Smckusick.Sm on 8851682Smckusickor 8951682Smckusick.Sm off 9053148Smckusick.Fl mapall No = Sy user:group1:group2:... 9151682Smckusick.Sm on 9251682Smckusickspecifies a mapping for all client uids (including root) 9351682Smckusickusing the same semantics as 9453148Smckusick.Fl maproot . 9551682Smckusick.Pp 9649641ScaelThe option 9749641Scael.Fl r 9853148Smckusickis a synonym for 9953148Smckusick.Fl maproot 10044014Smckusickin an effort to be backward compatible with older export file formats. 10149641Scael.Pp 10251682SmckusickIn the absence of 10353148Smckusick.Fl maproot 10451682Smckusickand 10553148Smckusick.Fl mapall 10651682Smckusickoptions, remote accesses by root will result in using a credential of -2:-2. 10753148SmckusickAll other users will be mapped to their remote credential. 10851682SmckusickIf a 10953148Smckusick.Fl maproot 11051682Smckusickoption is given, 11153148Smckusickremote access by root will be mapped to that credential instead of -2:-2. 11251682SmckusickIf a 11353148Smckusick.Fl mapall 11451682Smckusickoption is given, 11553148Smckusickall users (including root) will be mapped to that credential in 11651682Smckusickplace of their own. 11751682Smckusick.Pp 11851682SmckusickThe 11951682Smckusick.Fl kerb 12051682Smckusickoption specifies that the Kerberos authentication server should be 12153148Smckusickused to authenticate and map client credentials. 122*68644SmckusickThis option requires that the kernel be built with the NFSKERB option. 12351682Smckusick.Pp 12451682SmckusickThe 12549641Scael.Fl ro 12653148Smckusickoption specifies that the filesystem should be exported read-only 12753148Smckusick(default read/write). 12849641ScaelThe option 12949641Scael.Fl o 13053148Smckusickis a synonym for 13149641Scael.Fl ro 13244014Smckusickin an effort to be backward compatible with older export file formats. 13349641Scael.Pp 13453148SmckusickThe third component of a line specifies the host set to which the line applies. 13553148SmckusickThe set may be specified in three ways. 13653148SmckusickThe first way is to list the host name(s) separated by white space. 13753148Smckusick(Standard internet ``dot'' addresses may be used in place of names.) 13853148SmckusickThe second way is to specify a ``netgroup'' as defined in the netgroup file (see 13953148Smckusick.Xr netgroup 5 ). 14053148SmckusickThe third way is to specify an internet subnetwork using a network and 14153148Smckusicknetwork mask that is defined as the set of all hosts with addresses within 14253148Smckusickthe subnetwork. 14353148SmckusickThis latter approach requires less overhead within the 14453148Smckusickkernel and is recommended for cases where the export line refers to a 14553148Smckusicklarge number of clients within an administrative subnet. 14653148Smckusick.Pp 14753148SmckusickThe first two cases are specified by simply listing the name(s) separated 14853148Smckusickby whitespace. 14953148SmckusickAll names are checked to see if they are ``netgroup'' names 15053148Smckusickfirst and are assumed to be hostnames otherwise. 15153148SmckusickUsing the full domain specification for a hostname can normally 15253148Smckusickcircumvent the problem of a host that has the same name as a netgroup. 15353148SmckusickThe third case is specified by the flag 15453148Smckusick.Sm off 15553148Smckusick.Fl network No = Sy netname 15653148Smckusick.Sm on 15753148Smckusickand optionally 15853148Smckusick.Sm off 15953148Smckusick.Fl mask No = Sy netmask . 16053148Smckusick.Sm on 16153148SmckusickIf the mask is not specified, it will default to the mask for that network 16253148Smckusickclass (A, B or C; see 16353148Smckusick.Xr inet 5 ). 16453148Smckusick.Pp 16544014SmckusickFor example: 16649641Scael.Bd -literal -offset indent 16753148Smckusick/usr /usr/local -maproot=0:10 friends 16853148Smckusick/usr -maproot=daemon grumpy.cis.uoguelph.ca 131.104.48.16 16953148Smckusick/usr -ro -mapall=nobody 17053148Smckusick/u -maproot=bin: -network 131.104.48 -mask 255.255.255.0 17153148Smckusick/u2 -maproot=root friends 17253148Smckusick/u2 -alldirs -kerb -network cis-net -mask cis-mask 17349641Scael.Ed 17449641Scael.Pp 17549641ScaelGiven that 17649641Scael.Sy /usr , 17749641Scael.Sy /u 17849641Scaeland 17949641Scael.Sy /u2 18049641Scaelare 18151682Smckusicklocal filesystem mount points, the above example specifies the following: 18249641Scael.Sy /usr 18349641Scaelis exported to hosts 18453148Smckusick.Em friends 18553148Smckusickwhere friends is specified in the netgroup file 18653148Smckusickwith users mapped to their remote credentials and 18753148Smckusickroot mapped to uid 0 and group 10. 18853148SmckusickIt is exported read-write and the hosts in ``friends'' can mount either /usr 18953148Smckusickor /usr/local. 19053148SmckusickIt is exported to 19153148Smckusick.Em 131.104.48.16 19249641Scaeland 19353148Smckusick.Em grumpy.cis.uoguelph.ca 19453148Smckusickwith users mapped to their remote credentials and 19551682Smckusickroot mapped to the user and groups associated with ``daemon''; 19651682Smckusickit is exported to the rest of the world as read-only with 19753148Smckusickall users mapped to the user and groups associated with ``nobody''. 19849641Scael.Pp 19949641Scael.Sy /u 20053148Smckusickis exported to all hosts on the subnetwork 20153148Smckusick.Em 131.104.48 20253148Smckusickwith root mapped to the uid for ``bin'' and with no group access. 20349641Scael.Pp 20449641Scael.Sy /u2 20553148Smckusickis exported to the hosts in ``friends'' with root mapped to uid and groups 20653148Smckusickassociated with ``root''; 20753148Smckusickit is exported to all hosts on network ``cis-net'' allowing mounts at any 20853148Smckusickdirectory within /u2 and mapping all uids to credentials for the principal 20953148Smckusickthat is authenticated by a Kerberos ticket. 21049641Scael.Sh FILES 21149641Scael.Bl -tag -width /etc/exports -compact 21249641Scael.It Pa /etc/exports 21351682SmckusickThe default remote mount-point file. 21449641Scael.El 21549641Scael.Sh SEE ALSO 21653148Smckusick.Xr netgroup 5 , 21749641Scael.Xr mountd 8 , 21849641Scael.Xr nfsd 8 , 21949641Scael.Xr showmount 8 22049641Scael.Sh BUGS 22151682SmckusickThe export options are tied to the local mount points in the kernel and 22251682Smckusickmust be non-contradictory for any exported subdirectory of the local 22351682Smckusickserver mount point. 22451682SmckusickIt is recommended that all exported directories within the same server 22551682Smckusickfilesystem be specified on adjacent lines going down the tree. 22653148SmckusickYou cannot specify a hostname that is also the name of a netgroup. 22753148SmckusickSpecifying the full domain specification for a hostname can normally 22853148Smckusickcircumvent the problem. 229