1994-05-26 06:35:07 +00:00
|
|
|
.\" 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.
|
|
|
|
.\" 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.
|
|
|
|
.\"
|
1997-03-11 12:43:45 +00:00
|
|
|
.\" @(#)exports.5 8.3 (Berkeley) 3/29/95
|
1999-08-28 00:22:10 +00:00
|
|
|
.\" $FreeBSD$
|
1994-05-26 06:35:07 +00:00
|
|
|
.\"
|
2012-12-25 22:34:43 +00:00
|
|
|
.Dd December 23, 2012
|
1994-05-26 06:35:07 +00:00
|
|
|
.Dt EXPORTS 5
|
|
|
|
.Os
|
|
|
|
.Sh NAME
|
|
|
|
.Nm exports
|
|
|
|
.Nd define remote mount points for
|
|
|
|
.Tn NFS
|
|
|
|
mount requests
|
|
|
|
.Sh SYNOPSIS
|
2000-11-20 16:52:27 +00:00
|
|
|
.Nm
|
1994-05-26 06:35:07 +00:00
|
|
|
.Sh DESCRIPTION
|
|
|
|
The
|
1998-07-15 06:21:41 +00:00
|
|
|
.Nm
|
1994-05-26 06:35:07 +00:00
|
|
|
file specifies remote mount points for the
|
|
|
|
.Tn NFS
|
|
|
|
mount protocol per the
|
|
|
|
.Tn NFS
|
|
|
|
server specification; see
|
2000-12-18 15:16:24 +00:00
|
|
|
.%T "Network File System Protocol Specification" ,
|
|
|
|
RFC1094, Appendix A and
|
|
|
|
.%T "NFS: Network File System Version 3 Specification" ,
|
|
|
|
Appendix I.
|
1994-05-26 06:35:07 +00:00
|
|
|
.Pp
|
|
|
|
Each line in the file
|
|
|
|
(other than comment lines that begin with a #)
|
|
|
|
specifies the mount point(s) and export flags within one local server
|
2009-05-27 22:02:54 +00:00
|
|
|
file system or the NFSv4 tree root for one or more hosts.
|
2001-07-02 23:59:06 +00:00
|
|
|
A long line may be split over several lines by ending all but the
|
2001-07-04 13:57:34 +00:00
|
|
|
last line with a backslash
|
|
|
|
.Pq Ql \e .
|
2009-05-27 22:02:54 +00:00
|
|
|
A host may be specified only once for each local file or the NFSv4 tree root on the
|
1994-05-26 06:35:07 +00:00
|
|
|
server and there may be only one default entry for each server
|
2002-12-12 17:26:04 +00:00
|
|
|
file system that applies to all other hosts.
|
2008-06-27 16:32:04 +00:00
|
|
|
The latter exports the file system to the
|
|
|
|
.Dq world
|
|
|
|
and should
|
2002-12-12 17:26:04 +00:00
|
|
|
be used only when the file system contains public information.
|
1994-05-26 06:35:07 +00:00
|
|
|
.Pp
|
|
|
|
In a mount entry,
|
2002-12-12 17:26:04 +00:00
|
|
|
the first field(s) specify the directory path(s) within a server file system
|
1994-05-26 06:35:07 +00:00
|
|
|
that can be mounted on by the corresponding client(s).
|
2009-05-27 22:02:54 +00:00
|
|
|
There are three forms of this specification.
|
1994-05-26 06:35:07 +00:00
|
|
|
The first is to list all mount points as absolute
|
|
|
|
directory paths separated by whitespace.
|
2011-07-12 14:04:36 +00:00
|
|
|
This list of directory paths should be considered an
|
2012-03-29 05:02:12 +00:00
|
|
|
.Dq administrative control ,
|
2011-07-12 14:04:36 +00:00
|
|
|
since it is only enforced by the
|
|
|
|
.Xr mountd 8
|
|
|
|
daemon and not the kernel.
|
|
|
|
As such, it only applies to NFSv2 and NFSv3 mounts and only
|
|
|
|
with respect to the client's use of the mount protocol.
|
2002-12-12 17:26:04 +00:00
|
|
|
The second is to specify the pathname of the root of the file system
|
1994-05-26 06:35:07 +00:00
|
|
|
followed by the
|
|
|
|
.Fl alldirs
|
|
|
|
flag;
|
2002-12-12 17:26:04 +00:00
|
|
|
this form allows the host(s) to mount at any point within the file system,
|
1997-03-11 12:43:45 +00:00
|
|
|
including regular files if the
|
|
|
|
.Fl r
|
1999-05-29 08:14:00 +00:00
|
|
|
option is used on
|
|
|
|
.Xr mountd 8 .
|
2011-07-12 14:04:36 +00:00
|
|
|
Because NFSv4 does not use the mount protocol,
|
|
|
|
the
|
2012-03-29 05:02:12 +00:00
|
|
|
.Dq administrative controls
|
2011-07-12 14:04:36 +00:00
|
|
|
are not applied.
|
|
|
|
Thus, all the above export line(s) should be considered to have the
|
|
|
|
.Fl alldirs
|
|
|
|
flag, even if the line is specified without it.
|
2009-05-27 22:02:54 +00:00
|
|
|
The third form has the string ``V4:'' followed by a single absolute path
|
2010-07-12 04:21:50 +00:00
|
|
|
name, to specify the NFSv4 tree root.
|
2011-07-12 14:04:36 +00:00
|
|
|
This line does not export any file system, but simply marks where the root
|
|
|
|
of the server's directory tree is for NFSv4 clients.
|
|
|
|
The exported file systems for NFSv4 are specified via the other lines
|
|
|
|
in the
|
2012-10-07 19:53:04 +00:00
|
|
|
.Nm
|
2011-07-12 14:04:36 +00:00
|
|
|
file in the same way as for NFSv2 and NFSv3.
|
1994-05-26 06:35:07 +00:00
|
|
|
The pathnames must not have any symbolic links in them and should not have
|
2008-06-27 16:32:04 +00:00
|
|
|
any
|
2008-06-30 08:29:02 +00:00
|
|
|
.Dq Pa \&.
|
2008-06-27 16:32:04 +00:00
|
|
|
or
|
2008-06-30 08:29:02 +00:00
|
|
|
.Dq Pa ..
|
2008-06-27 16:32:04 +00:00
|
|
|
components.
|
2002-12-12 17:26:04 +00:00
|
|
|
Mount points for a file system may appear on multiple lines each with
|
1994-05-26 06:35:07 +00:00
|
|
|
different sets of hosts and export options.
|
|
|
|
.Pp
|
2002-12-12 17:26:04 +00:00
|
|
|
The second component of a line specifies how the file system is to be
|
1994-05-26 06:35:07 +00:00
|
|
|
exported to the host set.
|
2002-12-12 17:26:04 +00:00
|
|
|
The option flags specify whether the file system
|
2008-06-30 08:29:02 +00:00
|
|
|
is exported read-only or read-write and how the client UID is mapped to
|
1994-05-26 06:35:07 +00:00
|
|
|
user credentials on the server.
|
2009-05-27 22:02:54 +00:00
|
|
|
For the NFSv4 tree root, the only option that can be specified in this
|
|
|
|
section is
|
|
|
|
.Fl sec .
|
1994-05-26 06:35:07 +00:00
|
|
|
.Pp
|
|
|
|
Export options are specified as follows:
|
|
|
|
.Pp
|
|
|
|
.Sm off
|
2008-07-01 19:54:02 +00:00
|
|
|
.Fl maproot Li = Sy user
|
1994-05-26 06:35:07 +00:00
|
|
|
.Sm on
|
|
|
|
The credential of the specified user is used for remote access by root.
|
|
|
|
The credential includes all the groups to which the user is a member
|
|
|
|
on the local machine (see
|
2001-01-16 09:15:57 +00:00
|
|
|
.Xr id 1 ) .
|
1994-05-26 06:35:07 +00:00
|
|
|
The user may be specified by name or number.
|
|
|
|
.Pp
|
|
|
|
.Sm off
|
2008-07-01 19:54:02 +00:00
|
|
|
.Fl maproot Li = Sy user:group1:group2:...
|
1994-05-26 06:35:07 +00:00
|
|
|
.Sm on
|
|
|
|
The colon separated list is used to specify the precise credential
|
|
|
|
to 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 containing
|
|
|
|
no groups from a complete credential for that user.
|
|
|
|
.Pp
|
|
|
|
.Sm off
|
2008-07-01 19:54:02 +00:00
|
|
|
.Fl mapall Li = Sy user
|
1994-05-26 06:35:07 +00:00
|
|
|
.Sm on
|
|
|
|
or
|
|
|
|
.Sm off
|
2008-07-01 19:54:02 +00:00
|
|
|
.Fl mapall Li = Sy user:group1:group2:...
|
1994-05-26 06:35:07 +00:00
|
|
|
.Sm on
|
2008-06-30 08:29:02 +00:00
|
|
|
specifies a mapping for all client UIDs (including root)
|
1994-05-26 06:35:07 +00:00
|
|
|
using the same semantics as
|
|
|
|
.Fl maproot .
|
|
|
|
.Pp
|
|
|
|
The option
|
|
|
|
.Fl r
|
|
|
|
is a synonym for
|
|
|
|
.Fl maproot
|
|
|
|
in an effort to be backward compatible with older export file formats.
|
|
|
|
.Pp
|
|
|
|
In the absence of
|
|
|
|
.Fl maproot
|
|
|
|
and
|
|
|
|
.Fl mapall
|
|
|
|
options, 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 maproot
|
|
|
|
option is given,
|
|
|
|
remote access by root will be mapped to that credential instead of -2:-2.
|
|
|
|
If a
|
|
|
|
.Fl mapall
|
|
|
|
option is given,
|
|
|
|
all users (including root) will be mapped to that credential in
|
|
|
|
place of their own.
|
|
|
|
.Pp
|
Implement support for RPCSEC_GSS authentication to both the NFS client
and server. This replaces the RPC implementation of the NFS client and
server with the newer RPC implementation originally developed
(actually ported from the userland sunrpc code) to support the NFS
Lock Manager. I have tested this code extensively and I believe it is
stable and that performance is at least equal to the legacy RPC
implementation.
The NFS code currently contains support for both the new RPC
implementation and the older legacy implementation inherited from the
original NFS codebase. The default is to use the new implementation -
add the NFS_LEGACYRPC option to fall back to the old code. When I
merge this support back to RELENG_7, I will probably change this so
that users have to 'opt in' to get the new code.
To use RPCSEC_GSS on either client or server, you must build a kernel
which includes the KGSSAPI option and the crypto device. On the
userland side, you must build at least a new libc, mountd, mount_nfs
and gssd. You must install new versions of /etc/rc.d/gssd and
/etc/rc.d/nfsd and add 'gssd_enable=YES' to /etc/rc.conf.
As long as gssd is running, you should be able to mount an NFS
filesystem from a server that requires RPCSEC_GSS authentication. The
mount itself can happen without any kerberos credentials but all
access to the filesystem will be denied unless the accessing user has
a valid ticket file in the standard place (/tmp/krb5cc_<uid>). There
is currently no support for situations where the ticket file is in a
different place, such as when the user logged in via SSH and has
delegated credentials from that login. This restriction is also
present in Solaris and Linux. In theory, we could improve this in
future, possibly using Brooks Davis' implementation of variant
symlinks.
Supporting RPCSEC_GSS on a server is nearly as simple. You must create
service creds for the server in the form 'nfs/<fqdn>@<REALM>' and
install them in /etc/krb5.keytab. The standard heimdal utility ktutil
makes this fairly easy. After the service creds have been created, you
can add a '-sec=krb5' option to /etc/exports and restart both mountd
and nfsd.
The only other difference an administrator should notice is that nfsd
doesn't fork to create service threads any more. In normal operation,
there will be two nfsd processes, one in userland waiting for TCP
connections and one in the kernel handling requests. The latter
process will create as many kthreads as required - these should be
visible via 'top -H'. The code has some support for varying the number
of service threads according to load but initially at least, nfsd uses
a fixed number of threads according to the value supplied to its '-n'
option.
Sponsored by: Isilon Systems
MFC after: 1 month
2008-11-03 10:38:00 +00:00
|
|
|
.Sm off
|
|
|
|
.Fl sec Li = Sy flavor1:flavor2...
|
|
|
|
.Sm on
|
|
|
|
specifies a colon separated list of acceptable security flavors to be
|
|
|
|
used for remote access.
|
|
|
|
Supported security flavors are sys, krb5, krb5i and krb5p.
|
|
|
|
If multiple flavors are listed, they should be ordered with the most
|
|
|
|
preferred flavor first.
|
|
|
|
If this option is not present,
|
|
|
|
the default security flavor list of just sys is used.
|
|
|
|
.Pp
|
1994-05-26 06:35:07 +00:00
|
|
|
The
|
|
|
|
.Fl ro
|
2002-12-12 17:26:04 +00:00
|
|
|
option specifies that the file system should be exported read-only
|
1994-05-26 06:35:07 +00:00
|
|
|
(default read/write).
|
|
|
|
The option
|
|
|
|
.Fl o
|
|
|
|
is a synonym for
|
|
|
|
.Fl ro
|
|
|
|
in an effort to be backward compatible with older export file formats.
|
|
|
|
.Pp
|
1998-07-15 06:21:41 +00:00
|
|
|
.Tn WebNFS
|
|
|
|
exports strictly according to the spec (RFC 2054 and RFC 2055) can
|
1997-07-16 09:27:53 +00:00
|
|
|
be done with the
|
|
|
|
.Fl public
|
2000-03-01 11:34:08 +00:00
|
|
|
flag.
|
|
|
|
However, this flag in itself allows r/w access to all files in
|
2008-06-30 08:29:02 +00:00
|
|
|
the file system, not requiring reserved ports and not remapping UIDs.
|
2000-03-01 11:34:08 +00:00
|
|
|
It
|
1997-07-16 09:27:53 +00:00
|
|
|
is only provided to conform to the spec, and should normally not be used.
|
1998-07-15 06:21:41 +00:00
|
|
|
For a
|
|
|
|
.Tn WebNFS
|
|
|
|
export,
|
1997-07-16 09:27:53 +00:00
|
|
|
use the
|
|
|
|
.Fl webnfs
|
|
|
|
flag, which implies
|
|
|
|
.Fl public ,
|
|
|
|
.Sm off
|
|
|
|
.Fl mapall No = Sy nobody
|
|
|
|
.Sm on
|
|
|
|
and
|
|
|
|
.Fl ro .
|
2004-03-27 14:23:25 +00:00
|
|
|
Note that only one file system can be
|
2004-03-22 21:05:57 +00:00
|
|
|
.Tn WebNFS
|
|
|
|
exported on a server.
|
1997-07-16 09:27:53 +00:00
|
|
|
.Pp
|
|
|
|
A
|
|
|
|
.Sm off
|
2006-01-29 08:44:05 +00:00
|
|
|
.Fl index No = Pa file
|
1998-07-15 06:21:41 +00:00
|
|
|
.Sm on
|
1997-07-16 09:27:53 +00:00
|
|
|
option can be used to specify a file whose handle will be returned if
|
2001-08-10 17:35:21 +00:00
|
|
|
a directory is looked up using the public filehandle
|
|
|
|
.Pq Tn WebNFS .
|
2000-03-01 11:34:08 +00:00
|
|
|
This is to mimic the behavior of URLs.
|
|
|
|
If no
|
1997-07-16 09:27:53 +00:00
|
|
|
.Fl index
|
|
|
|
option is specified, a directory filehandle will be returned as usual.
|
|
|
|
The
|
|
|
|
.Fl index
|
|
|
|
option only makes sense in combination with the
|
|
|
|
.Fl public
|
|
|
|
or
|
|
|
|
.Fl webnfs
|
|
|
|
flags.
|
|
|
|
.Pp
|
2002-07-18 20:52:17 +00:00
|
|
|
Specifying the
|
|
|
|
.Fl quiet
|
|
|
|
option will inhibit some of the syslog diagnostics for bad lines in
|
|
|
|
.Pa /etc/exports .
|
|
|
|
This can be useful to avoid annoying error messages for known possible
|
|
|
|
problems (see
|
|
|
|
.Sx EXAMPLES
|
|
|
|
below).
|
|
|
|
.Pp
|
1994-05-26 06:35:07 +00:00
|
|
|
The 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.
|
2008-06-27 16:32:04 +00:00
|
|
|
(Standard Internet
|
|
|
|
.Dq dot
|
|
|
|
addresses may be used in place of names.)
|
|
|
|
The second way is to specify a
|
|
|
|
.Dq netgroup
|
2008-06-30 08:29:02 +00:00
|
|
|
as defined in the
|
|
|
|
.Pa netgroup
|
|
|
|
file (see
|
2001-01-16 09:15:57 +00:00
|
|
|
.Xr netgroup 5 ) .
|
1998-07-15 06:21:41 +00:00
|
|
|
The third way is to specify an Internet subnetwork using a network and
|
1994-05-26 06:35:07 +00:00
|
|
|
network mask that is defined as the set of all hosts with addresses within
|
|
|
|
the subnetwork.
|
|
|
|
This latter approach requires less overhead within the
|
|
|
|
kernel and is recommended for cases where the export line refers to a
|
|
|
|
large number of clients within an administrative subnet.
|
|
|
|
.Pp
|
|
|
|
The first two cases are specified by simply listing the name(s) separated
|
|
|
|
by whitespace.
|
2008-06-27 16:32:04 +00:00
|
|
|
All names are checked to see if they are
|
|
|
|
.Dq netgroup
|
|
|
|
names
|
1994-05-26 06:35:07 +00:00
|
|
|
first and are assumed to be hostnames otherwise.
|
|
|
|
Using the full domain specification for a hostname can normally
|
|
|
|
circumvent the problem of a host that has the same name as a netgroup.
|
|
|
|
The third case is specified by the flag
|
|
|
|
.Sm off
|
2008-07-01 19:54:02 +00:00
|
|
|
.Fl network Li = Sy netname Op Li / Ar prefixlength
|
1994-05-26 06:35:07 +00:00
|
|
|
.Sm on
|
|
|
|
and optionally
|
|
|
|
.Sm off
|
|
|
|
.Fl mask No = Sy netmask .
|
|
|
|
.Sm on
|
2008-06-27 16:32:04 +00:00
|
|
|
The netmask may be specified either by attaching a
|
|
|
|
.Ar prefixlength
|
|
|
|
to the
|
|
|
|
.Fl network
|
|
|
|
option, or by using a separate
|
|
|
|
.Fl mask
|
|
|
|
option.
|
1994-05-26 06:35:07 +00:00
|
|
|
If the mask is not specified, it will default to the mask for that network
|
|
|
|
class (A, B or C; see
|
2001-01-16 09:15:57 +00:00
|
|
|
.Xr inet 4 ) .
|
2002-07-18 20:52:17 +00:00
|
|
|
See the
|
|
|
|
.Sx EXAMPLES
|
|
|
|
section below.
|
|
|
|
.Pp
|
2008-06-27 16:32:04 +00:00
|
|
|
Scoped IPv6 address must carry scope identifier as documented in
|
|
|
|
.Xr inet6 4 .
|
|
|
|
For example,
|
2008-06-30 08:29:02 +00:00
|
|
|
.Dq Li fe80::%re2/10
|
|
|
|
is used to specify
|
|
|
|
.Li fe80::/10
|
|
|
|
on
|
|
|
|
.Li re2
|
|
|
|
interface.
|
2008-06-27 16:32:04 +00:00
|
|
|
.Pp
|
2009-05-27 22:02:54 +00:00
|
|
|
For the third form which specifies the NFSv4 tree root, the directory path
|
|
|
|
specifies the location within the server's file system tree which is the
|
|
|
|
root of the NFSv4 tree.
|
|
|
|
All entries of this form must specify the same directory path.
|
2012-12-25 22:34:43 +00:00
|
|
|
For file systems other than ZFS,
|
|
|
|
this location can be any directory and does not
|
2009-05-27 22:02:54 +00:00
|
|
|
need to be within an exported file system. If it is not in an exported
|
|
|
|
file system, a very limited set of operations are permitted, so that an
|
|
|
|
NFSv4 client can traverse the tree to an exported file system.
|
|
|
|
Although parts of the NFSv4 tree can be non-exported, the entire NFSv4 tree
|
|
|
|
must consist of local file systems capable of being exported via NFS.
|
2012-12-25 22:34:43 +00:00
|
|
|
All ZFS file systems in the subtree below the NFSv4 tree root must be
|
|
|
|
exported.
|
2009-05-27 22:02:54 +00:00
|
|
|
NFSv4 does not use the mount protocol and does permit clients to cross server
|
|
|
|
mount point boundaries, although not all clients are capable of crossing the
|
|
|
|
mount points.
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Fl sec
|
|
|
|
option on these line(s) specifies what security flavors may be used for
|
|
|
|
NFSv4 operations that do not use file handles. Since these operations
|
|
|
|
(SetClientID, SetClientIDConfirm, Renew, DelegPurge and ReleaseLockOnwer)
|
|
|
|
allocate/modify state in the server, it is possible to restrict some clients to
|
|
|
|
the use of the krb5[ip] security flavors, via this option.
|
|
|
|
See the
|
|
|
|
.Sx EXAMPLES
|
|
|
|
section below.
|
|
|
|
This third form is meaningless for NFSv2 and NFSv3 and is ignored for them.
|
|
|
|
.Pp
|
2002-07-18 20:52:17 +00:00
|
|
|
The
|
|
|
|
.Xr mountd 8
|
|
|
|
utility can be made to re-read the
|
|
|
|
.Nm
|
|
|
|
file by sending it a hangup signal as follows:
|
|
|
|
.Bd -literal -offset indent
|
2008-06-27 16:32:04 +00:00
|
|
|
/etc/rc.d/mountd reload
|
2002-07-18 20:52:17 +00:00
|
|
|
.Ed
|
1994-05-26 06:35:07 +00:00
|
|
|
.Pp
|
2002-07-18 20:52:17 +00:00
|
|
|
After sending the
|
|
|
|
.Dv SIGHUP ,
|
|
|
|
check the
|
|
|
|
.Xr syslogd 8
|
|
|
|
output to see whether
|
|
|
|
.Xr mountd 8
|
|
|
|
logged any parsing errors in the
|
|
|
|
.Nm
|
|
|
|
file.
|
|
|
|
.Sh FILES
|
|
|
|
.Bl -tag -width /etc/exports -compact
|
|
|
|
.It Pa /etc/exports
|
|
|
|
the default remote mount-point file
|
|
|
|
.El
|
|
|
|
.Sh EXAMPLES
|
1994-05-26 06:35:07 +00:00
|
|
|
.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
|
2008-06-27 16:32:04 +00:00
|
|
|
/a -network 192.168.0/24
|
|
|
|
/a -network 3ffe:1ce1:1:fe80::/64
|
1994-05-26 06:35:07 +00:00
|
|
|
/u2 -maproot=root friends
|
2002-09-20 20:03:27 +00:00
|
|
|
/u2 -alldirs -network cis-net -mask cis-mask
|
2002-07-18 20:52:17 +00:00
|
|
|
/cdrom -alldirs,quiet,ro -network 192.168.33.0 -mask 255.255.255.0
|
Implement support for RPCSEC_GSS authentication to both the NFS client
and server. This replaces the RPC implementation of the NFS client and
server with the newer RPC implementation originally developed
(actually ported from the userland sunrpc code) to support the NFS
Lock Manager. I have tested this code extensively and I believe it is
stable and that performance is at least equal to the legacy RPC
implementation.
The NFS code currently contains support for both the new RPC
implementation and the older legacy implementation inherited from the
original NFS codebase. The default is to use the new implementation -
add the NFS_LEGACYRPC option to fall back to the old code. When I
merge this support back to RELENG_7, I will probably change this so
that users have to 'opt in' to get the new code.
To use RPCSEC_GSS on either client or server, you must build a kernel
which includes the KGSSAPI option and the crypto device. On the
userland side, you must build at least a new libc, mountd, mount_nfs
and gssd. You must install new versions of /etc/rc.d/gssd and
/etc/rc.d/nfsd and add 'gssd_enable=YES' to /etc/rc.conf.
As long as gssd is running, you should be able to mount an NFS
filesystem from a server that requires RPCSEC_GSS authentication. The
mount itself can happen without any kerberos credentials but all
access to the filesystem will be denied unless the accessing user has
a valid ticket file in the standard place (/tmp/krb5cc_<uid>). There
is currently no support for situations where the ticket file is in a
different place, such as when the user logged in via SSH and has
delegated credentials from that login. This restriction is also
present in Solaris and Linux. In theory, we could improve this in
future, possibly using Brooks Davis' implementation of variant
symlinks.
Supporting RPCSEC_GSS on a server is nearly as simple. You must create
service creds for the server in the form 'nfs/<fqdn>@<REALM>' and
install them in /etc/krb5.keytab. The standard heimdal utility ktutil
makes this fairly easy. After the service creds have been created, you
can add a '-sec=krb5' option to /etc/exports and restart both mountd
and nfsd.
The only other difference an administrator should notice is that nfsd
doesn't fork to create service threads any more. In normal operation,
there will be two nfsd processes, one in userland waiting for TCP
connections and one in the kernel handling requests. The latter
process will create as many kthreads as required - these should be
visible via 'top -H'. The code has some support for varying the number
of service threads according to load but initially at least, nfsd uses
a fixed number of threads according to the value supplied to its '-n'
option.
Sponsored by: Isilon Systems
MFC after: 1 month
2008-11-03 10:38:00 +00:00
|
|
|
/private -sec=krb5i
|
|
|
|
/secret -sec=krb5p
|
2009-05-27 22:02:54 +00:00
|
|
|
V4: / -sec=krb5:krb5i:krb5p -network 131.104.48 -mask 255.255.255.0
|
|
|
|
V4: / -sec=sys:krb5:krb5i:krb5p grumpy.cis.uoguelph.ca
|
1994-05-26 06:35:07 +00:00
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
Given that
|
2008-07-01 19:54:02 +00:00
|
|
|
.Pa /usr , /u , /a
|
1994-05-26 06:35:07 +00:00
|
|
|
and
|
2006-01-29 08:44:05 +00:00
|
|
|
.Pa /u2
|
1994-05-26 06:35:07 +00:00
|
|
|
are
|
2002-12-12 17:26:04 +00:00
|
|
|
local file system mount points, the above example specifies the following:
|
2004-01-01 00:59:58 +00:00
|
|
|
.Pp
|
2008-06-30 08:29:02 +00:00
|
|
|
The file system rooted at
|
2006-01-29 08:44:05 +00:00
|
|
|
.Pa /usr
|
1994-05-26 06:35:07 +00:00
|
|
|
is exported to hosts
|
|
|
|
.Em friends
|
|
|
|
where friends is specified in the netgroup file
|
|
|
|
with users mapped to their remote credentials and
|
2008-06-30 08:29:02 +00:00
|
|
|
root mapped to UID 0 and group 10.
|
2008-06-27 16:32:04 +00:00
|
|
|
It is exported read-write and the hosts in
|
|
|
|
.Dq friends
|
|
|
|
can mount either
|
|
|
|
.Pa /usr
|
|
|
|
or
|
|
|
|
.Pa /usr/local .
|
1994-05-26 06:35:07 +00:00
|
|
|
It is exported to
|
|
|
|
.Em 131.104.48.16
|
|
|
|
and
|
|
|
|
.Em grumpy.cis.uoguelph.ca
|
|
|
|
with users mapped to their remote credentials and
|
2008-06-27 16:32:04 +00:00
|
|
|
root mapped to the user and groups associated with
|
|
|
|
.Dq daemon ;
|
1994-05-26 06:35:07 +00:00
|
|
|
it is exported to the rest of the world as read-only with
|
2008-06-27 16:32:04 +00:00
|
|
|
all users mapped to the user and groups associated with
|
|
|
|
.Dq nobody .
|
1994-05-26 06:35:07 +00:00
|
|
|
.Pp
|
2008-06-30 08:29:02 +00:00
|
|
|
The file system rooted at
|
2006-01-29 08:44:05 +00:00
|
|
|
.Pa /u
|
1994-05-26 06:35:07 +00:00
|
|
|
is exported to all hosts on the subnetwork
|
|
|
|
.Em 131.104.48
|
2008-06-30 08:29:02 +00:00
|
|
|
with root mapped to the UID for
|
2008-06-27 16:32:04 +00:00
|
|
|
.Dq bin
|
|
|
|
and with no group access.
|
1994-05-26 06:35:07 +00:00
|
|
|
.Pp
|
2008-06-30 08:29:02 +00:00
|
|
|
The file system rooted at
|
2006-01-29 08:44:05 +00:00
|
|
|
.Pa /u2
|
2008-06-27 16:32:04 +00:00
|
|
|
is exported to the hosts in
|
|
|
|
.Dq friends
|
2008-06-30 08:29:02 +00:00
|
|
|
with root mapped to UID and groups
|
2008-06-27 16:32:04 +00:00
|
|
|
associated with
|
|
|
|
.Dq root ;
|
|
|
|
it is exported to all hosts on network
|
|
|
|
.Dq cis-net
|
|
|
|
allowing mounts at any
|
2002-09-20 20:03:27 +00:00
|
|
|
directory within /u2.
|
2000-07-03 11:43:48 +00:00
|
|
|
.Pp
|
2008-06-30 08:29:02 +00:00
|
|
|
The file system rooted at
|
2008-06-27 16:32:04 +00:00
|
|
|
.Pa /a
|
|
|
|
is exported to the network 192.168.0.0, with a netmask of 255.255.255.0.
|
2008-06-30 08:29:02 +00:00
|
|
|
However, the netmask length in the entry for
|
|
|
|
.Pa /a
|
|
|
|
is not specified through a
|
|
|
|
.Fl mask
|
|
|
|
option, but through the
|
|
|
|
.Li / Ns Ar prefix
|
|
|
|
notation.
|
2008-06-27 16:32:04 +00:00
|
|
|
.Pp
|
2008-06-30 08:29:02 +00:00
|
|
|
The file system rooted at
|
2008-06-27 16:32:04 +00:00
|
|
|
.Pa /a
|
2008-06-30 08:29:02 +00:00
|
|
|
is also exported to the IPv6 network
|
|
|
|
.Li 3ffe:1ce1:1:fe80::
|
|
|
|
address, using the upper 64 bits as the prefix.
|
2008-06-27 16:32:04 +00:00
|
|
|
Note that, unlike with IPv4 network addresses, the specified network
|
|
|
|
address must be complete, and not just contain the upper bits.
|
2008-06-30 08:29:02 +00:00
|
|
|
With IPv6 addresses, the
|
|
|
|
.Fl mask
|
|
|
|
option must not be used.
|
2008-06-27 16:32:04 +00:00
|
|
|
.Pp
|
2002-12-12 17:26:04 +00:00
|
|
|
The file system rooted at
|
2006-01-29 08:44:05 +00:00
|
|
|
.Pa /cdrom
|
2008-06-30 08:29:02 +00:00
|
|
|
will be exported read-only to the entire network 192.168.33.0/24, including
|
2002-07-18 20:52:17 +00:00
|
|
|
all its subdirectories.
|
|
|
|
Since
|
2006-01-29 08:44:05 +00:00
|
|
|
.Pa /cdrom
|
2002-07-18 20:52:17 +00:00
|
|
|
is the conventional mountpoint for a CD-ROM device, this export will
|
|
|
|
fail if no CD-ROM medium is currently mounted there since that line
|
2002-12-12 17:26:04 +00:00
|
|
|
would then attempt to export a subdirectory of the root file system
|
2002-07-18 20:52:17 +00:00
|
|
|
with the
|
|
|
|
.Fl alldirs
|
|
|
|
option which is not allowed.
|
2000-07-03 11:43:48 +00:00
|
|
|
The
|
2002-07-18 20:52:17 +00:00
|
|
|
.Fl quiet
|
|
|
|
option will then suppress the error message for this condition that
|
|
|
|
would normally be syslogged.
|
|
|
|
As soon as an actual CD-ROM is going to be mounted,
|
|
|
|
.Xr mount 8
|
|
|
|
will notify
|
2000-07-03 11:43:48 +00:00
|
|
|
.Xr mountd 8
|
2002-07-18 20:52:17 +00:00
|
|
|
about this situation, and the
|
2006-01-29 08:44:05 +00:00
|
|
|
.Pa /cdrom
|
2002-12-27 12:15:40 +00:00
|
|
|
file system will be exported as intended.
|
2002-07-18 20:52:17 +00:00
|
|
|
Note that without using the
|
|
|
|
.Fl alldirs
|
|
|
|
option, the export would always succeed.
|
|
|
|
While there is no CD-ROM medium mounted under
|
2006-01-29 08:44:05 +00:00
|
|
|
.Pa /cdrom ,
|
2002-07-18 20:52:17 +00:00
|
|
|
it would export the (normally empty) directory
|
2006-01-29 08:44:05 +00:00
|
|
|
.Pa /cdrom
|
2002-12-12 17:26:04 +00:00
|
|
|
of the root file system instead.
|
Implement support for RPCSEC_GSS authentication to both the NFS client
and server. This replaces the RPC implementation of the NFS client and
server with the newer RPC implementation originally developed
(actually ported from the userland sunrpc code) to support the NFS
Lock Manager. I have tested this code extensively and I believe it is
stable and that performance is at least equal to the legacy RPC
implementation.
The NFS code currently contains support for both the new RPC
implementation and the older legacy implementation inherited from the
original NFS codebase. The default is to use the new implementation -
add the NFS_LEGACYRPC option to fall back to the old code. When I
merge this support back to RELENG_7, I will probably change this so
that users have to 'opt in' to get the new code.
To use RPCSEC_GSS on either client or server, you must build a kernel
which includes the KGSSAPI option and the crypto device. On the
userland side, you must build at least a new libc, mountd, mount_nfs
and gssd. You must install new versions of /etc/rc.d/gssd and
/etc/rc.d/nfsd and add 'gssd_enable=YES' to /etc/rc.conf.
As long as gssd is running, you should be able to mount an NFS
filesystem from a server that requires RPCSEC_GSS authentication. The
mount itself can happen without any kerberos credentials but all
access to the filesystem will be denied unless the accessing user has
a valid ticket file in the standard place (/tmp/krb5cc_<uid>). There
is currently no support for situations where the ticket file is in a
different place, such as when the user logged in via SSH and has
delegated credentials from that login. This restriction is also
present in Solaris and Linux. In theory, we could improve this in
future, possibly using Brooks Davis' implementation of variant
symlinks.
Supporting RPCSEC_GSS on a server is nearly as simple. You must create
service creds for the server in the form 'nfs/<fqdn>@<REALM>' and
install them in /etc/krb5.keytab. The standard heimdal utility ktutil
makes this fairly easy. After the service creds have been created, you
can add a '-sec=krb5' option to /etc/exports and restart both mountd
and nfsd.
The only other difference an administrator should notice is that nfsd
doesn't fork to create service threads any more. In normal operation,
there will be two nfsd processes, one in userland waiting for TCP
connections and one in the kernel handling requests. The latter
process will create as many kthreads as required - these should be
visible via 'top -H'. The code has some support for varying the number
of service threads according to load but initially at least, nfsd uses
a fixed number of threads according to the value supplied to its '-n'
option.
Sponsored by: Isilon Systems
MFC after: 1 month
2008-11-03 10:38:00 +00:00
|
|
|
.Pp
|
|
|
|
The file system rooted at
|
|
|
|
.Pa /private
|
|
|
|
will be exported using Kerberos 5 authentication and will require
|
|
|
|
integrity protected messages for all accesses.
|
|
|
|
The file system rooted at
|
|
|
|
.Pa /secret
|
|
|
|
will also be exported using Kerberos 5 authentication and all messages
|
|
|
|
used to access it will be encrypted.
|
2009-05-27 22:02:54 +00:00
|
|
|
.Pp
|
|
|
|
For the experimental server, the NFSv4 tree is rooted at ``/'',
|
|
|
|
and any client within the 131.104.48 subnet is permitted to perform NFSv4 state
|
|
|
|
operations on the server, so long as valid Kerberos credentials are provided.
|
|
|
|
The machine grumpy.cis.uoguelph.ca is permitted to perform NFSv4 state
|
|
|
|
operations on the server using AUTH_SYS credentials, as well as Kerberos ones.
|
1994-05-26 06:35:07 +00:00
|
|
|
.Sh SEE ALSO
|
2009-12-03 19:16:40 +00:00
|
|
|
.Xr nfsv4 4 ,
|
1994-05-26 06:35:07 +00:00
|
|
|
.Xr netgroup 5 ,
|
|
|
|
.Xr mountd 8 ,
|
|
|
|
.Xr nfsd 8 ,
|
|
|
|
.Xr showmount 8
|
|
|
|
.Sh BUGS
|
|
|
|
The export options are tied to the local mount points in the kernel and
|
|
|
|
must be non-contradictory for any exported subdirectory of the local
|
|
|
|
server mount point.
|
|
|
|
It is recommended that all exported directories within the same server
|
2002-12-12 17:26:04 +00:00
|
|
|
file system be specified on adjacent lines going down the tree.
|
1994-05-26 06:35:07 +00:00
|
|
|
You cannot specify a hostname that is also the name of a netgroup.
|
|
|
|
Specifying the full domain specification for a hostname can normally
|
|
|
|
circumvent the problem.
|