📄 exports.5
字号:
.\" Copyright (c) 1989, 1991, 1993.\" The Regents of the University of California. All rights reserved..\".\" Redistribution and use in source and binary forms, with or without.\" modification, are permitted provided that the following conditions.\" are met:.\" 1. Redistributions of source code must retain the above copyright.\" notice, this list of conditions and the following disclaimer..\" 2. Redistributions in binary form must reproduce the above copyright.\" notice, this list of conditions and the following disclaimer in the.\" documentation and/or other materials provided with the distribution..\" 3. All advertising materials mentioning features or use of this software.\" must display the following acknowledgement:.\" This product includes software developed by the University of.\" California, Berkeley and its contributors..\" 4. Neither the name of the University nor the names of its contributors.\" may be used to endorse or promote products derived from this software.\" without specific prior written permission..\".\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION).\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF.\" SUCH DAMAGE..\".\" @(#)exports.5 8.2 (Berkeley) 1/28/94.\".Dd January 28, 1994.Dt EXPORTS 5.Os.Sh NAME.Nm exports.Nd define remote mount points for.Tn NFSmount requests.Sh SYNOPSIS.Nm exports.Sh DESCRIPTIONThe.Nm exportsfile specifies remote mount points for the.Tn NFSmount protocol per the.Tn NFSserver specification; see.%T "Network File System Protocol Specification \\*(tNRFC\\*(sP 1094, Appendix A" ..PpEach line in the file(other than comment lines that begin with a #)specifies the mount point(s) and export flags within one local serverfilesystem for one or more hosts.A host may be specified only once for each local filesystem on theserver and there may be only one default entry for each serverfilesystem that applies to all other hosts.The latter exports the filesystem to the ``world'' and shouldbe used only when the filesystem contains public information..PpIn a mount entry,the first field(s) specify the directory path(s) within a server filesystemthat can be mounted on by the corresponding client(s).There are two forms of this specification.The first is to list all mount points as absolutedirectory paths separated by whitespace.The second is to specify the pathname of the root of the filesystemfollowed by the.Fl alldirsflag;this form allows the host(s) to mount any directory within the filesystem.The pathnames must not have any symbolic links in them and should not haveany "." or ".." components.Mount points for a filesystem may appear on multiple lines each withdifferent sets of hosts and export options..PpThe second component of a line specifies how the filesystem is to beexported to the host set.The option flags specify whether the filesystemis exported read-only or read-write and how the client uid is mapped touser credentials on the server..PpExport options are specified as follows:.Pp.Sm off.Fl maproot No = Sy user.Sm onThe credential of the specified user is used for remote access by root.The credential includes all the groups to which the user is a memberon the local machine (see.Xr id 1 ).The user may be specified by name or number..Pp.Sm off.Fl maproot No = Sy user:group1:group2:....Sm onThe colon separated list is used to specify the precise credentialto be used for remote access by root.The elements of the list may be either names or numbers.Note that user: should be used to distinguish a credential containingno groups from a complete credential for that user..Pp.Sm off.Fl mapall No = Sy user.Sm onor.Sm off.Fl mapall No = Sy user:group1:group2:....Sm onspecifies a mapping for all client uids (including root)using the same semantics as.Fl maproot ..PpThe option.Fl ris a synonym for.Fl maprootin an effort to be backward compatible with older export file formats..PpIn the absence of.Fl maprootand.Fl mapalloptions, remote accesses by root will result in using a credential of -2:-2.All other users will be mapped to their remote credential.If a.Fl maprootoption is given,remote access by root will be mapped to that credential instead of -2:-2.If a.Fl mapalloption is given,all users (including root) will be mapped to that credential inplace of their own..PpThe.Fl kerboption specifies that the Kerberos authentication server should beused to authenticate and map client credentials.(Note that this is NOT Sun NFS compatible andis supported for TCP transport only.).PpThe.Fl rooption specifies that the filesystem should be exported read-only(default read/write).The option.Fl ois a synonym for.Fl roin an effort to be backward compatible with older export file formats..PpThe third component of a line specifies the host set to which the line applies.The set may be specified in three ways.The first way is to list the host name(s) separated by white space.(Standard internet ``dot'' addresses may be used in place of names.)The second way is to specify a ``netgroup'' as defined in the netgroup file (see.Xr netgroup 5 ).The third way is to specify an internet subnetwork using a network andnetwork mask that is defined as the set of all hosts with addresses withinthe subnetwork.This latter approach requires less overhead within thekernel and is recommended for cases where the export line refers to alarge number of clients within an administrative subnet..PpThe first two cases are specified by simply listing the name(s) separatedby whitespace.All names are checked to see if they are ``netgroup'' namesfirst and are assumed to be hostnames otherwise.Using the full domain specification for a hostname can normallycircumvent the problem of a host that has the same name as a netgroup.The third case is specified by the flag.Sm off.Fl network No = Sy netname.Sm onand optionally.Sm off.Fl mask No = Sy netmask ..Sm onIf the mask is not specified, it will default to the mask for that networkclass (A, B or C; see.Xr inet 5 )..PpFor example:.Bd -literal -offset indent/usr /usr/local -maproot=0:10 friends/usr -maproot=daemon grumpy.cis.uoguelph.ca 131.104.48.16/usr -ro -mapall=nobody/u -maproot=bin: -network 131.104.48 -mask 255.255.255.0/u2 -maproot=root friends/u2 -alldirs -kerb -network cis-net -mask cis-mask.Ed.PpGiven that.Sy /usr ,.Sy /uand.Sy /u2arelocal filesystem mount points, the above example specifies the following:.Sy /usris exported to hosts.Em friendswhere friends is specified in the netgroup filewith users mapped to their remote credentials androot mapped to uid 0 and group 10.It is exported read-write and the hosts in ``friends'' can mount either /usror /usr/local.It is exported to.Em 131.104.48.16and.Em grumpy.cis.uoguelph.cawith users mapped to their remote credentials androot mapped to the user and groups associated with ``daemon'';it is exported to the rest of the world as read-only withall users mapped to the user and groups associated with ``nobody''..Pp.Sy /uis exported to all hosts on the subnetwork.Em 131.104.48with root mapped to the uid for ``bin'' and with no group access..Pp.Sy /u2is exported to the hosts in ``friends'' with root mapped to uid and groupsassociated with ``root'';it is exported to all hosts on network ``cis-net'' allowing mounts at anydirectory within /u2 and mapping all uids to credentials for the principalthat is authenticated by a Kerberos ticket..Sh FILES.Bl -tag -width /etc/exports -compact.It Pa /etc/exportsThe default remote mount-point file..El.Sh SEE ALSO.Xr netgroup 5 ,.Xr mountd 8 ,.Xr nfsd 8 ,.Xr showmount 8.Sh BUGSThe export options are tied to the local mount points in the kernel andmust be non-contradictory for any exported subdirectory of the localserver mount point.It is recommended that all exported directories within the same serverfilesystem be specified on adjacent lines going down the tree.You cannot specify a hostname that is also the name of a netgroup.Specifying the full domain specification for a hostname can normallycircumvent the problem.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -