xref: /titanic_51/usr/src/man/man1m/share_nfs.1m (revision 3a005aada8ac0e291c13cbc488ba9ae1473f0a96)
1073ec901SMarcel Telka.\"
2073ec901SMarcel Telka.\" CDDL HEADER START
3073ec901SMarcel Telka.\"
4073ec901SMarcel Telka.\" The contents of this file are subject to the terms of the
5073ec901SMarcel Telka.\" Common Development and Distribution License (the "License").
6073ec901SMarcel Telka.\" You may not use this file except in compliance with the License.
7073ec901SMarcel Telka.\"
8073ec901SMarcel Telka.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9073ec901SMarcel Telka.\" or http://www.opensolaris.org/os/licensing.
10073ec901SMarcel Telka.\" See the License for the specific language governing permissions
11073ec901SMarcel Telka.\" and limitations under the License.
12073ec901SMarcel Telka.\"
13073ec901SMarcel Telka.\" When distributing Covered Code, include this CDDL HEADER in each
14073ec901SMarcel Telka.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15073ec901SMarcel Telka.\" If applicable, add the following below this CDDL HEADER, with the
16073ec901SMarcel Telka.\" fields enclosed by brackets "[]" replaced with your own identifying
17073ec901SMarcel Telka.\" information: Portions Copyright [yyyy] [name of copyright owner]
18073ec901SMarcel Telka.\"
19073ec901SMarcel Telka.\" CDDL HEADER END
20073ec901SMarcel Telka.\"
21073ec901SMarcel Telka.\"
22c10c16deSRichard Lowe.\" Copyright (C) 2008, Sun Microsystems, Inc. All Rights Reserved
23073ec901SMarcel Telka.\" Copyright 2014 Nexenta Systems, Inc.  All rights reserved.
24073ec901SMarcel Telka.\"
25073ec901SMarcel Telka.Dd November 10, 2014
26073ec901SMarcel Telka.Dt SHARE_NFS 1M
27073ec901SMarcel Telka.Os
28073ec901SMarcel Telka.Sh NAME
29073ec901SMarcel Telka.Nm share_nfs
30073ec901SMarcel Telka.Nd make local NFS file systems available for mounting by remote systems
31073ec901SMarcel Telka.Sh SYNOPSIS
32073ec901SMarcel Telka.Nm share
33073ec901SMarcel Telka.Op Fl d Ar description
34073ec901SMarcel Telka.Op Fl F Sy nfs
35073ec901SMarcel Telka.Op Fl o Ar specific_options
36073ec901SMarcel Telka.Ar pathname
37073ec901SMarcel Telka.Sh DESCRIPTION
38073ec901SMarcel TelkaThe
39073ec901SMarcel Telka.Nm share
40073ec901SMarcel Telkautility makes local file systems available for mounting by remote systems. It
41073ec901SMarcel Telkastarts the
42073ec901SMarcel Telka.Xr nfsd 1M
43073ec901SMarcel Telkaand
44073ec901SMarcel Telka.Xr mountd 1M
45073ec901SMarcel Telkadaemons if they are not already running.
46073ec901SMarcel Telka.Pp
47073ec901SMarcel TelkaIf no argument is specified, then
48073ec901SMarcel Telka.Nm share
49073ec901SMarcel Telkadisplays all file systems currently shared, including NFS file systems and file
50073ec901SMarcel Telkasystems shared through other distributed file system packages.
51073ec901SMarcel Telka.Sh OPTIONS
52c10c16deSRichard LoweThe following options are supported:
53073ec901SMarcel Telka.Bl -tag -width "indented"
54073ec901SMarcel Telka.It Fl d Ar description
55c10c16deSRichard LoweProvide a comment that describes the file system to be shared.
56073ec901SMarcel Telka.It Fl F Sy nfs
57073ec901SMarcel TelkaShare NFS file system type.
58073ec901SMarcel Telka.It Fl o Ar specific_options
59073ec901SMarcel TelkaSpecify
60073ec901SMarcel Telka.Ar specific_options
61073ec901SMarcel Telkain a comma-separated list of keywords and attribute-value-assertions for
62073ec901SMarcel Telkainterpretation by the file-system-type-specific command. If
63073ec901SMarcel Telka.Ar specific_options
64073ec901SMarcel Telkais not specified, then by default sharing is read-write to all clients.
65073ec901SMarcel Telka.Ar specific_options
66073ec901SMarcel Telkacan be any combination of the following:
67073ec901SMarcel Telka.Bl -tag -width "indented"
68073ec901SMarcel Telka.It Sy aclok
69073ec901SMarcel TelkaAllows the NFS server to do access control for NFS Version 2 clients (running
70073ec901SMarcel TelkaSunOS 2.4 or earlier). When
71073ec901SMarcel Telka.Sy aclok
72073ec901SMarcel Telkais set on the server, maximal access is given to all clients. For example, with
73073ec901SMarcel Telka.Sy aclok
74073ec901SMarcel Telkaset, if anyone has read permissions, then everyone does. If
75073ec901SMarcel Telka.Sy aclok
76073ec901SMarcel Telkais not set, minimal access is given to all clients.
77073ec901SMarcel Telka.It Sy anon Ns = Ns Ar uid
78073ec901SMarcel TelkaSet
79073ec901SMarcel Telka.Ar uid
80073ec901SMarcel Telkato be the effective user ID of unknown users. By default, unknown users are
81073ec901SMarcel Telkagiven the effective user ID UID_NOBODY. If uid is set to -1, access is denied.
82073ec901SMarcel Telka.It Ar charset Ns = Ns Ar access_list
83073ec901SMarcel TelkaWhere
84073ec901SMarcel Telka.Ar charset
85073ec901SMarcel Telkais one of: euc-cn, euc-jp, euc-jpms, euc-kr, euc-tw, iso8859-1, iso8859-2,
86073ec901SMarcel Telkaiso8859-5, iso8859-6, iso8859-7, iso8859-8, iso8859-9, iso8859-13, iso8859-15,
87073ec901SMarcel Telkakoi8-r.
88073ec901SMarcel Telka.Pp
89073ec901SMarcel TelkaClients that match the
90073ec901SMarcel Telka.Ar access_list
91073ec901SMarcel Telkafor one of these properties will be assumed to be using that character set and
92073ec901SMarcel Telkafile and path names will be converted to UTF-8 for the server.
93073ec901SMarcel Telka.It Sy gidmap Ns = Ns Ar mapping Ns Oo ~ Ns Ar mapping Oc Ns ...
94073ec901SMarcel TelkaWhere
95073ec901SMarcel Telka.Ar mapping
96073ec901SMarcel Telkais:
97073ec901SMarcel Telka.Oo Ar clnt Oc : Ns Oo Ar srv Oc : Ns Ar access_list
98073ec901SMarcel Telka.Pp
995cb0d679SMarcel TelkaAllows remapping the group ID (gid) in the incoming request to some other gid.
1005cb0d679SMarcel TelkaThis effectively changes the identity of the user in the request to that of
1015cb0d679SMarcel Telkasome other local user.
102073ec901SMarcel Telka.Pp
103073ec901SMarcel TelkaFor clients where the gid in the incoming request is
104073ec901SMarcel Telka.Ar clnt
105073ec901SMarcel Telkaand the client matches the
106073ec901SMarcel Telka.Ar access_list Ns
107073ec901SMarcel Telka, change the group ID to
108073ec901SMarcel Telka.Ar srv Ns .  If
109073ec901SMarcel Telka.Ar clnt
110073ec901SMarcel Telkais asterisk (*), all groups are mapped by this rule.  If
111073ec901SMarcel Telka.Ar clnt
112073ec901SMarcel Telkais omitted, all unknown groups are mapped by this rule.  If
113073ec901SMarcel Telka.Ar srv
114073ec901SMarcel Telkais set to -1, access is denied.  If
115073ec901SMarcel Telka.Ar srv
116073ec901SMarcel Telkais omitted, the gid is mapped to UID_NOBODY.
117073ec901SMarcel Telka.Pp
118073ec901SMarcel TelkaThe particular
119073ec901SMarcel Telka.Ar mapping Ns s
120073ec901SMarcel Telkaare separated in the
121073ec901SMarcel Telka.Sy gidmap Ns =
122073ec901SMarcel Telkaoption by tilde (~) and are evaluated in the specified order until a match is
123073ec901SMarcel Telkafound.  Both
124073ec901SMarcel Telka.Sy root Ns =
125073ec901SMarcel Telkaand
126073ec901SMarcel Telka.Sy root_mapping Ns =
127073ec901SMarcel Telkaoptions (if specified) are evaluated before the
128073ec901SMarcel Telka.Sy gidmap Ns =
129073ec901SMarcel Telkaoption.  The
130073ec901SMarcel Telka.Sy gidmap Ns =
131073ec901SMarcel Telkaoption is skipped in the case where the client matches the
132073ec901SMarcel Telka.Sy root Ns =
133c10c16deSRichard Loweoption.
134073ec901SMarcel Telka.Pp
135073ec901SMarcel TelkaThe
136073ec901SMarcel Telka.Sy gidmap Ns =
137073ec901SMarcel Telkaoption is evaluated before the
138073ec901SMarcel Telka.Sy anon Ns =
139073ec901SMarcel Telkaoption.
140073ec901SMarcel Telka.Pp
141073ec901SMarcel TelkaThis option is supported only for AUTH_SYS.
142073ec901SMarcel Telka.It Sy index Ns = Ns Ar file
143073ec901SMarcel TelkaLoad
144073ec901SMarcel Telka.Ar file
145073ec901SMarcel Telkarather than a listing of the directory containing this file when the
146073ec901SMarcel Telkadirectory is referenced by an NFS URL.
147073ec901SMarcel Telka.It Sy log Ns Oo = Ns Ar tag Oc
148073ec901SMarcel TelkaEnables NFS server logging for the specified file system. The optional
149073ec901SMarcel Telka.Ar tag
150073ec901SMarcel Telkadetermines the location of the related log files. The
151073ec901SMarcel Telka.Ar tag
152073ec901SMarcel Telkais defined in
153073ec901SMarcel Telka.Pa /etc/nfs/nfslog.conf .
154073ec901SMarcel TelkaIf no
155073ec901SMarcel Telka.Ar tag
156073ec901SMarcel Telkais specified, the default values associated with the global tag in
157073ec901SMarcel Telka.Pa /etc/nfs/nfslog.conf
158073ec901SMarcel Telkaare used. Support of NFS server logging is only available for NFS Version 2 and
159073ec901SMarcel TelkaVersion 3 requests.
160073ec901SMarcel Telka.It Sy none Ns = Ns Ar access_list
161073ec901SMarcel TelkaAccess is not allowed to any client that matches the access list. The exception
162073ec901SMarcel Telkais when the access list is an asterisk (*), in which case
163073ec901SMarcel Telka.Sy ro
164073ec901SMarcel Telkaor
165073ec901SMarcel Telka.Sy rw
166073ec901SMarcel Telkacan override
167073ec901SMarcel Telka.Sy none .
168073ec901SMarcel Telka.It Sy nosub
169073ec901SMarcel TelkaPrevents clients from mounting subdirectories of shared directories. For
170073ec901SMarcel Telkaexample, if
171073ec901SMarcel Telka.Pa /export
172073ec901SMarcel Telkais shared with the
173073ec901SMarcel Telka.Sy nosub
174073ec901SMarcel Telkaoption on server
175073ec901SMarcel Telka.Qq fooey
176073ec901SMarcel Telkathen a NFS client cannot do:
177073ec901SMarcel Telka.Bd -literal -offset indent
178073ec901SMarcel Telkamount -F nfs fooey:/export/home/mnt
179073ec901SMarcel Telka.Ed
180073ec901SMarcel Telka.Pp
181073ec901SMarcel TelkaNFS Version 4 does not use the MOUNT protocol. The
182073ec901SMarcel Telka.Sy nosub
183073ec901SMarcel Telkaoption only applies to NFS Version 2 and Version 3 requests.
184073ec901SMarcel Telka.It Sy nosuid
185073ec901SMarcel TelkaBy default, clients are allowed to create files on the shared file system with
186073ec901SMarcel Telkathe setuid or setgid mode enabled. Specifying
187073ec901SMarcel Telka.Sy nosuid
188073ec901SMarcel Telkacauses the server file system to silently ignore any attempt to enable the
189073ec901SMarcel Telkasetuid or setgid mode bits.
190073ec901SMarcel Telka.It Sy public
191073ec901SMarcel TelkaMoves the location of the public file handle from root
192073ec901SMarcel Telka.Pa ( / )
193073ec901SMarcel Telkato the exported directory for WebNFS-enabled browsers and clients. This option
194073ec901SMarcel Telkadoes not enable WebNFS service; WebNFS is always on. Only one file system per
195073ec901SMarcel Telkaserver may use this option. Any other option, including the
196073ec901SMarcel Telka.Sy ro Ns = Ns Ar list
197073ec901SMarcel Telkaand
198073ec901SMarcel Telka.Sy rw Ns = Ns Ar list
199073ec901SMarcel Telkaoptions can be included with the
200073ec901SMarcel Telka.Sy public
201073ec901SMarcel Telkaoption.
202073ec901SMarcel Telka.It Sy ro
203c10c16deSRichard LoweSharing is read-only to all clients.
204073ec901SMarcel Telka.It Sy ro Ns = Ns Ar access_list
205073ec901SMarcel TelkaSharing is read-only to the clients listed in
206073ec901SMarcel Telka.Ar access_list ;
207073ec901SMarcel Telkaoverrides the
208073ec901SMarcel Telka.Sy rw
209073ec901SMarcel Telkasuboption for the clients specified. See
210073ec901SMarcel Telka.Sx access_list
211073ec901SMarcel Telkabelow.
212073ec901SMarcel Telka.It Sy root Ns = Ns Ar access_list
213073ec901SMarcel TelkaOnly root users from the hosts specified in
214073ec901SMarcel Telka.Ar access_list
215073ec901SMarcel Telkahave root access. See
216073ec901SMarcel Telka.Sx access_list
217073ec901SMarcel Telkabelow. By default, no host has root access, so root users are mapped to an
218073ec901SMarcel Telkaanonymous user ID (see the
219073ec901SMarcel Telka.Sy anon Ns = Ns Ar uid
220073ec901SMarcel Telkaoption described above). Netgroups can be used if the file system shared is
221073ec901SMarcel Telkausing UNIX authentication (AUTH_SYS).
222073ec901SMarcel Telka.It Sy root_mapping Ns = Ns Ar uid
223c10c16deSRichard LoweFor a client that is allowed root access, map the root UID to the specified
224c10c16deSRichard Loweuser id.
225073ec901SMarcel Telka.It Sy rw
226c10c16deSRichard LoweSharing is read-write to all clients.
227073ec901SMarcel Telka.It Sy rw Ns = Ns Ar access_list
228073ec901SMarcel TelkaSharing is read-write to the clients listed in
229073ec901SMarcel Telka.Ar access_list ;
230073ec901SMarcel Telkaoverrides the
231073ec901SMarcel Telka.Sy ro
232073ec901SMarcel Telkasuboption for the clients specified. See
233073ec901SMarcel Telka.Sx access_list
234073ec901SMarcel Telkabelow.
235073ec901SMarcel Telka.It Sy sec Ns = Ns Ar mode Ns Oo : Ns Ar mode Oc Ns ...
236073ec901SMarcel TelkaSharing uses one or more of the specified security modes. The
237073ec901SMarcel Telka.Ar mode
238073ec901SMarcel Telkain the
239073ec901SMarcel Telka.Sy sec Ns = Ns Ar mode
240073ec901SMarcel Telkaoption must be a mode name supported on the client. If the
241073ec901SMarcel Telka.Sy sec Ns =
242073ec901SMarcel Telkaoption is not specified, the default security mode used is AUTH_SYS. Multiple
243073ec901SMarcel Telka.Sy sec Ns =
244073ec901SMarcel Telkaoptions can be specified on the command line, although each mode can appear
245073ec901SMarcel Telkaonly once. The security modes are defined in
246073ec901SMarcel Telka.Xr nfssec 5 .
247073ec901SMarcel Telka.Pp
248073ec901SMarcel TelkaEach
249073ec901SMarcel Telka.Sy sec Ns =
250073ec901SMarcel Telkaoption specifies modes that apply to any subsequent
251073ec901SMarcel Telka.Sy window Ns = ,
252073ec901SMarcel Telka.Sy rw ,
253073ec901SMarcel Telka.Sy ro ,
254073ec901SMarcel Telka.Sy rw Ns = ,
255073ec901SMarcel Telka.Sy ro Ns = ,
256073ec901SMarcel Telkaand
257073ec901SMarcel Telka.Sy root Ns =
258073ec901SMarcel Telkaoptions that are provided before another
259073ec901SMarcel Telka.Sy sec Ns =
260073ec901SMarcel Telkaoption.
261073ec901SMarcel TelkaEach additional
262073ec901SMarcel Telka.Sy sec Ns =
263073ec901SMarcel Telkaresets the security mode context, so that more
264073ec901SMarcel Telka.Sy window Ns = ,
265073ec901SMarcel Telka.Sy rw ,
266073ec901SMarcel Telka.Sy ro ,
267073ec901SMarcel Telka.Sy rw Ns = ,
268073ec901SMarcel Telka.Sy ro Ns = ,
269073ec901SMarcel Telkaand
270073ec901SMarcel Telka.Sy root Ns =
271073ec901SMarcel Telkaoptions can be supplied for additional modes.
272073ec901SMarcel Telka.It Sy sec Ns = Ns Sy none
273073ec901SMarcel TelkaIf the option
274073ec901SMarcel Telka.Sy sec Ns = Ns Sy none
275073ec901SMarcel Telkais specified when the client uses AUTH_NONE, or if the client uses a security
276073ec901SMarcel Telkamode that is not one that the file system is shared with, then the credential
277073ec901SMarcel Telkaof each NFS request is treated as unauthenticated. See the
278073ec901SMarcel Telka.Sy anon Ns = Ns Ar uid
279073ec901SMarcel Telkaoption for a description of how unauthenticated requests are handled.
280073ec901SMarcel Telka.It Sy secure
281073ec901SMarcel TelkaThis option has been deprecated in favor of the
282073ec901SMarcel Telka.Sy sec Ns = Ns Sy dh
283073ec901SMarcel Telkaoption.
284073ec901SMarcel Telka.It Sy uidmap Ns = Ns Ar mapping Ns Oo ~ Ns Ar mapping Oc Ns ...
285073ec901SMarcel TelkaWhere
286073ec901SMarcel Telka.Ar mapping
287073ec901SMarcel Telkais:
288073ec901SMarcel Telka.Oo Ar clnt Oc : Ns Oo Ar srv Oc : Ns Ar access_list
289073ec901SMarcel Telka.Pp
2905cb0d679SMarcel TelkaAllows remapping the user ID (uid) in the incoming request to some other uid.
2915cb0d679SMarcel TelkaThis effectively changes the identity of the user in the request to that of
2925cb0d679SMarcel Telkasome other local user.
293073ec901SMarcel Telka.Pp
294073ec901SMarcel TelkaFor clients where the uid in the incoming request is
295073ec901SMarcel Telka.Ar clnt
296073ec901SMarcel Telkaand the client matches the
297073ec901SMarcel Telka.Ar access_list Ns
298073ec901SMarcel Telka, change the user ID to
299073ec901SMarcel Telka.Ar srv Ns .  If
300073ec901SMarcel Telka.Ar clnt
301073ec901SMarcel Telkais asterisk (*), all users are mapped by this rule.  If
302073ec901SMarcel Telka.Ar clnt
303073ec901SMarcel Telkais omitted, all unknown users are mapped by this rule.  If
304073ec901SMarcel Telka.Ar srv
305073ec901SMarcel Telkais set to -1, access is denied.  If
306073ec901SMarcel Telka.Ar srv
307073ec901SMarcel Telkais omitted, the uid is mapped to UID_NOBODY.
308073ec901SMarcel Telka.Pp
309073ec901SMarcel TelkaThe particular
310073ec901SMarcel Telka.Ar mapping Ns s
311073ec901SMarcel Telkaare separated in the
312073ec901SMarcel Telka.Sy uidmap Ns =
313073ec901SMarcel Telkaoption by tilde (~) and are evaluated in the specified order until a match is
314073ec901SMarcel Telkafound.  Both
315073ec901SMarcel Telka.Sy root Ns =
316c10c16deSRichard Loweand
317073ec901SMarcel Telka.Sy root_mapping Ns =
318073ec901SMarcel Telkaoptions (if specified) are evaluated before the
319073ec901SMarcel Telka.Sy uidmap Ns =
320073ec901SMarcel Telkaoption.  The
321073ec901SMarcel Telka.Sy uidmap Ns =
322073ec901SMarcel Telkaoption is skipped in the case where the client matches the
323073ec901SMarcel Telka.Sy root Ns =
324073ec901SMarcel Telkaoption.
325073ec901SMarcel Telka.Pp
326073ec901SMarcel TelkaThe
327073ec901SMarcel Telka.Sy uidmap Ns =
328073ec901SMarcel Telkaoption is evaluated before the
329073ec901SMarcel Telka.Sy anon Ns =
330073ec901SMarcel Telkaoption.
331073ec901SMarcel Telka.Pp
332073ec901SMarcel TelkaThis option is supported only for AUTH_SYS.
333073ec901SMarcel Telka.It Sy window Ns = Ns Ar value
334073ec901SMarcel TelkaWhen sharing with
335073ec901SMarcel Telka.Sy sec Ns = Ns Sy dh ,
336073ec901SMarcel Telkaset the maximum life time (in seconds) of the RPC request's credential (in the
337073ec901SMarcel Telkaauthentication header) that the NFS server allows. If a credential arrives with
338073ec901SMarcel Telkaa life time larger than what is allowed, the NFS server rejects the request. The
339073ec901SMarcel Telkadefault value is 30000 seconds (8.3 hours).
340073ec901SMarcel Telka.El
341073ec901SMarcel Telka.El
342073ec901SMarcel Telka.Ss access_list
343073ec901SMarcel TelkaThe
344073ec901SMarcel Telka.Ar access_list
345073ec901SMarcel Telkaargument is a colon-separated list whose components may be any number of the
346073ec901SMarcel Telkafollowing:
347073ec901SMarcel Telka.Bl -tag -width "indented"
348073ec901SMarcel Telka.It Sy hostname
349073ec901SMarcel TelkaThe name of a host. With a server configured for DNS or LDAP naming in the
350073ec901SMarcel Telkansswitch
351073ec901SMarcel Telka.Sy hosts
352073ec901SMarcel Telkaentry, any hostname must be represented as a fully qualified DNS or LDAP name.
353073ec901SMarcel Telka.It Sy netgroup
354073ec901SMarcel TelkaA netgroup contains a number of hostnames. With a server configured for DNS or
355073ec901SMarcel TelkaLDAP naming in the nsswitch
356073ec901SMarcel Telka.Sy hosts
357073ec901SMarcel Telkaentry, any hostname in a netgroup must be represented as a fully qualified DNS
358073ec901SMarcel Telkaor LDAP name.
359073ec901SMarcel Telka.It Sy domain name suffix
360073ec901SMarcel TelkaTo use domain membership the server must use DNS or LDAP to resolve hostnames to
361073ec901SMarcel TelkaIP addresses; that is, the
362073ec901SMarcel Telka.Sy hosts
363073ec901SMarcel Telkaentry in the
364073ec901SMarcel Telka.Pa /etc/nsswitch.conf
365073ec901SMarcel Telkamust specify
366073ec901SMarcel Telka.Sy dns
367073ec901SMarcel Telkaor
368073ec901SMarcel Telka.Sy ldap
369073ec901SMarcel Telkaahead of
370073ec901SMarcel Telka.Sy nis
371073ec901SMarcel Telkaor
372073ec901SMarcel Telka.Sy nisplus ,
373073ec901SMarcel Telkasince only DNS and LDAP return the full domain name of the host. Other name
374073ec901SMarcel Telkaservices like NIS or NIS+ cannot be used to resolve hostnames on the server
375073ec901SMarcel Telkabecause when mapping an IP address to a hostname they do not return domain
376073ec901SMarcel Telkainformation. For example,
377073ec901SMarcel Telka.Bd -literal -offset indent
378073ec901SMarcel TelkaNIS or NIS+   172.16.45.9 --> "myhost"
379073ec901SMarcel Telka.Ed
380073ec901SMarcel Telka.Pp
381073ec901SMarcel Telkaand
382073ec901SMarcel Telka.Bd -literal -offset indent
383073ec901SMarcel TelkaDNS or LDAP   172.16.45.9 --> "myhost.mydomain.mycompany.com"
384073ec901SMarcel Telka.Ed
385073ec901SMarcel Telka.Pp
386c10c16deSRichard LoweThe domain name suffix is distinguished from hostnames and netgroups by a
387c10c16deSRichard Loweprefixed dot. For example,
388073ec901SMarcel Telka.Bd -literal -offset indent
389073ec901SMarcel Telkarw=.mydomain.mycompany.com
390073ec901SMarcel Telka.Ed
391073ec901SMarcel Telka.Pp
392c10c16deSRichard LoweA single dot can be used to match a hostname with no suffix. For example,
393073ec901SMarcel Telka.Bd -literal -offset indent
394073ec901SMarcel Telkarw=.
395073ec901SMarcel Telka.Ed
396073ec901SMarcel Telka.Pp
397073ec901SMarcel Telkamatches
398073ec901SMarcel Telka.Qq mydomain
399073ec901SMarcel Telkabut not
400073ec901SMarcel Telka.Qq mydomain.mycompany.com .
401073ec901SMarcel TelkaThis feature can be used to match hosts resolved through NIS and NIS+ rather
402073ec901SMarcel Telkathan DNS and LDAP.
403073ec901SMarcel Telka.It Sy network
404073ec901SMarcel TelkaThe network or subnet component is preceded by an at-sign (@). It can be either
405073ec901SMarcel Telkaa name or a dotted address. If a name, it is converted to a dotted address by
406073ec901SMarcel Telka.Xr getnetbyname 3SOCKET .
407073ec901SMarcel TelkaFor example,
408073ec901SMarcel Telka.Bd -literal -offset indent
409073ec901SMarcel Telka=@mynet
410073ec901SMarcel Telka.Ed
411073ec901SMarcel Telka.Pp
412c10c16deSRichard Lowewould be equivalent to:
413073ec901SMarcel Telka.Bd -literal -offset indent
414073ec901SMarcel Telka=@172.16 or =@172.16.0.0
415073ec901SMarcel Telka.Ed
416073ec901SMarcel Telka.Pp
417c10c16deSRichard LoweThe network prefix assumes an octet-aligned netmask determined from the zeroth
418c10c16deSRichard Loweoctet in the low-order part of the address up to and including the high-order
419c10c16deSRichard Loweoctet, if you want to specify a single IP address (see below). In the case
420c10c16deSRichard Lowewhere network prefixes are not byte-aligned, the syntax allows a mask length to
421073ec901SMarcel Telkabe specified explicitly following a slash (/) delimiter. For example,
422073ec901SMarcel Telka.Bd -literal -offset indent
423073ec901SMarcel Telka=@theothernet/17 or =@172.16.132/22
424073ec901SMarcel Telka.Ed
425073ec901SMarcel Telka.Pp
426073ec901SMarcel Telkawhere the mask is the number of leftmost contiguous significant bits in the
427073ec901SMarcel Telkacorresponding IP address.
428073ec901SMarcel Telka.Pp
429073ec901SMarcel TelkaWhen specifying individual IP addresses, use the same @ notation described
430073ec901SMarcel Telkaabove, without a netmask specification. For example:
431073ec901SMarcel Telka.Bd -literal -offset indent
432c10c16deSRichard Lowe=@172.16.132.14
433073ec901SMarcel Telka.Ed
434073ec901SMarcel Telka.Pp
435c10c16deSRichard LoweMultiple, individual IP addresses would be specified, for example, as:
436073ec901SMarcel Telka.Bd -literal -offset indent
437c10c16deSRichard Loweroot=@172.16.132.20:@172.16.134.20
438073ec901SMarcel Telka.Ed
439073ec901SMarcel Telka.El
440073ec901SMarcel Telka.Pp
441073ec901SMarcel TelkaA prefixed minus sign (-) denies access to that component of
442073ec901SMarcel Telka.Ar access_list .
443073ec901SMarcel TelkaThe list is searched sequentially until a match is found that either grants or
444073ec901SMarcel Telkadenies access, or until the end of the list is reached. For example, if host
445073ec901SMarcel Telka.Qq terra
446073ec901SMarcel Telkais in the
447073ec901SMarcel Telka.Qq engineering
448073ec901SMarcel Telkanetgroup, then
449073ec901SMarcel Telka.Bd -literal -offset indent
450c10c16deSRichard Lowerw=-terra:engineering
451073ec901SMarcel Telka.Ed
452073ec901SMarcel Telka.Pp
453073ec901SMarcel Telkadenies access to
454073ec901SMarcel Telka.Qq terra
455073ec901SMarcel Telkabut
456073ec901SMarcel Telka.Bd -literal -offset indent
457c10c16deSRichard Lowerw=engineering:-terra
458073ec901SMarcel Telka.Ed
459073ec901SMarcel Telka.Pp
460073ec901SMarcel Telkagrants access to
461073ec901SMarcel Telka.Qq terra .
462073ec901SMarcel Telka.Sh OPERANDS
463c10c16deSRichard LoweThe following operands are supported:
464073ec901SMarcel Telka.Bl -tag -width "pathname"
465073ec901SMarcel Telka.It Sy pathname
466c10c16deSRichard LoweThe pathname of the file system to be shared.
467073ec901SMarcel Telka.El
468073ec901SMarcel Telka.Sh FILES
469073ec901SMarcel Telka.Bl -tag -width "/etc/nfs/nfslog.conf"
470073ec901SMarcel Telka.It Pa /etc/dfs/fstypes
471073ec901SMarcel Telkalist of system types, NFS by default
472073ec901SMarcel Telka.It Pa /etc/dfs/sharetab
473073ec901SMarcel Telkasystem record of shared file systems
474073ec901SMarcel Telka.It Pa /etc/nfs/nfslogtab
475073ec901SMarcel Telkasystem record of logged file systems
476073ec901SMarcel Telka.It Pa /etc/nfs/nfslog.conf
477073ec901SMarcel Telkalogging configuration file
478073ec901SMarcel Telka.El
479073ec901SMarcel Telka.Sh EXIT STATUS
480073ec901SMarcel Telka.Ex -std
481073ec901SMarcel Telka.Sh EXAMPLES
482073ec901SMarcel Telka.Ss Example 1 Sharing A File System With Logging Enabled
483073ec901SMarcel TelkaThe following example shows the
484073ec901SMarcel Telka.Pa /export
485073ec901SMarcel Telkafile system shared with logging enabled:
486073ec901SMarcel Telka.Bd -literal -offset indent
487073ec901SMarcel Telkashare -o log /export
488073ec901SMarcel Telka.Ed
489073ec901SMarcel Telka.Pp
490c10c16deSRichard LoweThe default global logging parameters are used since no tag identifier is
491c10c16deSRichard Lowespecified. The location of the log file, as well as the necessary logging work
492073ec901SMarcel Telkafiles, is specified by the global entry in
493073ec901SMarcel Telka.Pa /etc/nfs/nfslog.conf .
494073ec901SMarcel TelkaThe
495073ec901SMarcel Telka.Xr nfslogd 1M
496073ec901SMarcel Telkadaemon runs only if at least one file system entry in
497073ec901SMarcel Telka.Pa /etc/dfs/dfstab
498073ec901SMarcel Telkais shared with logging enabled upon starting or rebooting the system. Simply
499073ec901SMarcel Telkasharing a file system with logging enabled from the command line does not start
500073ec901SMarcel Telkathe
501073ec901SMarcel Telka.Xr nfslogd 1M .
502073ec901SMarcel Telka.Ss Example 2 Remap A User Coming From The Particular NFS Client
503073ec901SMarcel TelkaThe following example remaps the user with uid
504073ec901SMarcel Telka.Sy 100
505073ec901SMarcel Telkaat client
506073ec901SMarcel Telka.Sy 10.0.0.1
507073ec901SMarcel Telkato user
508073ec901SMarcel Telka.Sy joe Ns :
509073ec901SMarcel Telka.Bd -literal -offset indent
510073ec901SMarcel Telkashare -o uidmap=100:joe:@10.0.0.1 /export
511073ec901SMarcel Telka.Ed
512073ec901SMarcel Telka.Sh SEE ALSO
513073ec901SMarcel Telka.Xr mount 1M ,
514073ec901SMarcel Telka.Xr mountd 1M ,
515073ec901SMarcel Telka.Xr nfsd 1M ,
516073ec901SMarcel Telka.Xr nfslogd 1M ,
517073ec901SMarcel Telka.Xr share 1M ,
518073ec901SMarcel Telka.Xr unshare 1M ,
519073ec901SMarcel Telka.Xr getnetbyname 3SOCKET ,
520073ec901SMarcel Telka.Xr netgroup 4 ,
521*3a005aadSYuri Pankov.Xr nfslog.conf 4 ,
522073ec901SMarcel Telka.Xr attributes 5 ,
523073ec901SMarcel Telka.Xr nfssec 5
524073ec901SMarcel Telka.Sh NOTES
525073ec901SMarcel TelkaIf the
526073ec901SMarcel Telka.Sy sec Ns =
527073ec901SMarcel Telkaoption is presented at least once, all uses of the
528073ec901SMarcel Telka.Sy window Ns = ,
529073ec901SMarcel Telka.Sy rw ,
530073ec901SMarcel Telka.Sy ro ,
531073ec901SMarcel Telka.Sy rw Ns = ,
532073ec901SMarcel Telka.Sy ro Ns = ,
533073ec901SMarcel Telkaand
534073ec901SMarcel Telka.Sy root Ns =
535073ec901SMarcel Telkaoptions must come after the first
536073ec901SMarcel Telka.Sy sec Ns =
537073ec901SMarcel Telkaoption. If the
538073ec901SMarcel Telka.Sy sec Ns =
539073ec901SMarcel Telkaoption is not presented, then
540073ec901SMarcel Telka.Sy sec Ns = Ns Sy sys
541073ec901SMarcel Telkais implied.
542073ec901SMarcel Telka.Pp
543073ec901SMarcel TelkaIf one or more explicit
544073ec901SMarcel Telka.Sy sec Ns =
545073ec901SMarcel Telkaoptions are presented,
546073ec901SMarcel Telka.Sy sys
547073ec901SMarcel Telkamust appear in one of the options mode lists for accessing using the AUTH_SYS
548c10c16deSRichard Lowesecurity mode to be allowed. For example:
549073ec901SMarcel Telka.Bd -literal -offset indent
550073ec901SMarcel Telkashare -F nfs /var
551073ec901SMarcel Telkashare -F nfs -o sec=sys /var
552073ec901SMarcel Telka.Ed
553073ec901SMarcel Telka.Pp
554073ec901SMarcel Telkagrants read-write access to any host using AUTH_SYS, but
555073ec901SMarcel Telka.Bd -literal -offset indent
556073ec901SMarcel Telkashare -F nfs -o sec=dh /var
557073ec901SMarcel Telka.Ed
558073ec901SMarcel Telka.Pp
559073ec901SMarcel Telkagrants no access to clients that use AUTH_SYS.
560073ec901SMarcel Telka.Pp
561073ec901SMarcel TelkaUnlike previous implementations of
562073ec901SMarcel Telka.Nm ,
563073ec901SMarcel Telkaaccess checking for the
564073ec901SMarcel Telka.Sy window Ns = ,
565073ec901SMarcel Telka.Sy rw ,
566073ec901SMarcel Telka.Sy ro ,
567073ec901SMarcel Telka.Sy rw Ns = ,
568073ec901SMarcel Telkaand
569073ec901SMarcel Telka.Sy ro Ns =
570073ec901SMarcel Telkaoptions is done per NFS request, instead of per mount request.
571073ec901SMarcel Telka.Pp
572c10c16deSRichard LoweCombining multiple security modes can be a security hole in situations where
573073ec901SMarcel Telkathe
574073ec901SMarcel Telka.Sy ro Ns =
575073ec901SMarcel Telkaand
576073ec901SMarcel Telka.Sy rw Ns =
577073ec901SMarcel Telkaoptions are used to control access to weaker security modes. In this example,
578073ec901SMarcel Telka.Bd -literal -offset indent
579073ec901SMarcel Telkashare -F nfs -o sec=dh,rw,sec=sys,rw=hosta /var
580073ec901SMarcel Telka.Ed
581073ec901SMarcel Telka.Pp
582073ec901SMarcel Telkaan intruder can forge the IP address for
583073ec901SMarcel Telka.Qq hosta
584073ec901SMarcel Telka(albeit on each NFS request) to side-step the stronger controls of AUTH_DES.
585073ec901SMarcel TelkaSomething like:
586073ec901SMarcel Telka.Bd -literal -offset indent
587073ec901SMarcel Telkashare -F nfs -o sec=dh,rw,sec=sys,ro /var
588073ec901SMarcel Telka.Ed
589073ec901SMarcel Telka.Pp
590073ec901SMarcel Telkais safer, because any client (intruder or legitimate) that avoids AUTH_DES only
591073ec901SMarcel Telkagets read-only access. In general, multiple security modes per share command
592073ec901SMarcel Telkashould only be used in situations where the clients using more secure modes get
593073ec901SMarcel Telkastronger access than clients using less secure modes.
594073ec901SMarcel Telka.Pp
595073ec901SMarcel TelkaIf
596073ec901SMarcel Telka.Sy rw Ns =
597073ec901SMarcel Telkaand
598073ec901SMarcel Telka.Sy ro Ns =
599073ec901SMarcel Telkaoptions are specified in the same
600073ec901SMarcel Telka.Sy sec Ns =
601c10c16deSRichard Loweclause, and a client is in both lists, the order of the two options determines
602073ec901SMarcel Telkathe access the client gets. If client
603073ec901SMarcel Telka.Qq hosta
604073ec901SMarcel Telkais in two netgroups,
605073ec901SMarcel Telka.Qq group1
606073ec901SMarcel Telkaand
607073ec901SMarcel Telka.Qq group2 ,
608073ec901SMarcel Telkain this example, the client would get read-only access:
609073ec901SMarcel Telka.Bd -literal -offset indent
610073ec901SMarcel Telkashare -F nfs -o ro=group1,rw=group2 /var
611073ec901SMarcel Telka.Ed
612073ec901SMarcel Telka.Pp
613073ec901SMarcel TelkaIn this example
614073ec901SMarcel Telka.Qq hosta
615073ec901SMarcel Telkawould get read-write access:
616073ec901SMarcel Telka.Bd -literal -offset indent
617073ec901SMarcel Telkashare -F nfs -o rw=group2,ro=group1 /var
618073ec901SMarcel Telka.Ed
619073ec901SMarcel Telka.Pp
620073ec901SMarcel TelkaIf within a
621073ec901SMarcel Telka.Sy sec Ns =
622073ec901SMarcel Telkaclause, both the
623073ec901SMarcel Telka.Sy ro
624073ec901SMarcel Telkaand
625073ec901SMarcel Telka.Sy rw Ns =
626073ec901SMarcel Telkaoptions are specified, for compatibility, the order of the options rule is not
627073ec901SMarcel Telkaenforced. All hosts would get read-only access, with the exception to those in
628073ec901SMarcel Telkathe read-write list. Likewise, if the
629073ec901SMarcel Telka.Sy ro Ns =
630073ec901SMarcel Telkaand
631073ec901SMarcel Telka.Sy rw
632073ec901SMarcel Telkaoptions are specified, all hosts get read-write access with the exceptions of
633073ec901SMarcel Telkathose in the read-only list.
634073ec901SMarcel Telka.Pp
635073ec901SMarcel TelkaThe
636073ec901SMarcel Telka.Sy ro Ns =
637073ec901SMarcel Telkaand
638073ec901SMarcel Telka.Sy rw Ns =
639073ec901SMarcel Telkaoptions are guaranteed to work over UDP and TCP but may not work over other
640073ec901SMarcel Telkatransport providers.
641073ec901SMarcel Telka.Pp
642073ec901SMarcel TelkaThe
643073ec901SMarcel Telka.Sy root Ns =
644073ec901SMarcel Telkaoption with AUTH_SYS is guaranteed to work over UDP and TCP but may not work
645073ec901SMarcel Telkaover other transport providers.
646073ec901SMarcel Telka.Pp
647073ec901SMarcel TelkaThe
648073ec901SMarcel Telka.Sy root Ns =
649073ec901SMarcel Telkaoption with AUTH_DES is guaranteed to work over any transport provider.
650073ec901SMarcel Telka.Pp
651073ec901SMarcel TelkaThere are no interactions between the
652073ec901SMarcel Telka.Sy root Ns =
653073ec901SMarcel Telkaoption and the
654073ec901SMarcel Telka.Sy rw ,
655073ec901SMarcel Telka.Sy ro ,
656073ec901SMarcel Telka.Sy rw Ns = ,
657073ec901SMarcel Telkaand
658073ec901SMarcel Telka.Sy ro Ns =
659073ec901SMarcel Telkaoptions. Putting a host in the root list does not override the semantics of the
660073ec901SMarcel Telkaother options. The access the host gets is the same as when the
661073ec901SMarcel Telka.Sy root Ns =
662073ec901SMarcel Telkaoption is absent. For example, the following share command denies access to
663073ec901SMarcel Telka.Qq hostb :
664073ec901SMarcel Telka.Bd -literal -offset indent
665073ec901SMarcel Telkashare -F nfs -o ro=hosta,root=hostb /var
666073ec901SMarcel Telka.Ed
667073ec901SMarcel Telka.Pp
668073ec901SMarcel TelkaThe following gives read-only permissions to
669073ec901SMarcel Telka.Qq hostb :
670073ec901SMarcel Telka.Bd -literal -offset indent
671073ec901SMarcel Telkashare -F nfs -o ro=hostb,root=hostb /var
672073ec901SMarcel Telka.Ed
673073ec901SMarcel Telka.Pp
674073ec901SMarcel TelkaThe following gives read-write permissions to
675073ec901SMarcel Telka.Qq hostb :
676073ec901SMarcel Telka.Bd -literal -offset indent
677073ec901SMarcel Telkashare -F nfs -o ro=hosta,rw=hostb,root=hostb /var
678073ec901SMarcel Telka.Ed
679073ec901SMarcel Telka.Pp
680c10c16deSRichard LoweIf the file system being shared is a symbolic link to a valid pathname, the
681073ec901SMarcel Telkacanonical path (the path which the symbolic link follows) is shared. For
682073ec901SMarcel Telkaexample, if
683073ec901SMarcel Telka.Pa /export/foo
684073ec901SMarcel Telkais a symbolic link to
685073ec901SMarcel Telka.Pa /export/bar ,
686073ec901SMarcel Telkathe following share command results in
687073ec901SMarcel Telka.Pa /export/bar
688073ec901SMarcel Telkaas the shared pathname (and not
689073ec901SMarcel Telka.Pa /export/foo ) :
690073ec901SMarcel Telka.Bd -literal -offset indent
691073ec901SMarcel Telkashare -F nfs /export/foo
692073ec901SMarcel Telka.Ed
693073ec901SMarcel Telka.Pp
694073ec901SMarcel TelkaAn NFS mount of
695073ec901SMarcel Telka.Lk server:/export/foo
696073ec901SMarcel Telkaresults in
697073ec901SMarcel Telka.Lk server:/export/bar
698073ec901SMarcel Telkareally being mounted.
699073ec901SMarcel Telka.Pp
700073ec901SMarcel TelkaThis line in the
701073ec901SMarcel Telka.Pa /etc/dfs/dfstab
702073ec901SMarcel Telkafile shares the
703073ec901SMarcel Telka.Pa /disk
704073ec901SMarcel Telkafile system read-only at boot time:
705073ec901SMarcel Telka.Bd -literal -offset indent
706073ec901SMarcel Telkashare -F nfs -o ro /disk
707073ec901SMarcel Telka.Ed
708073ec901SMarcel Telka.Pp
709073ec901SMarcel TelkaThe same command entered from the command line does not share the
710073ec901SMarcel Telka.Pa /disk
711c10c16deSRichard Lowefile system unless there is at least one file system entry in the
712073ec901SMarcel Telka.Pa /etc/dfs/dfstab
713073ec901SMarcel Telkafile. The
714073ec901SMarcel Telka.Xr mountd 1M
715073ec901SMarcel Telkaand
716073ec901SMarcel Telka.Xr nfsd 1M
717073ec901SMarcel Telkadaemons only run if there is a file system entry in
718073ec901SMarcel Telka.Pa /etc/dfs/dfstab
719073ec901SMarcel Telkawhen starting or rebooting the system.
720073ec901SMarcel Telka.Pp
721073ec901SMarcel TelkaThe
722073ec901SMarcel Telka.Xr mountd 1M
723073ec901SMarcel Telkaprocess allows the processing of a path name the contains a symbolic link.
724073ec901SMarcel TelkaThis allows the processing of paths that are not themselves explicitly shared
725073ec901SMarcel Telkawith
726073ec901SMarcel Telka.Nm .
727073ec901SMarcel TelkaFor example,
728073ec901SMarcel Telka.Pa /export/foo
729073ec901SMarcel Telkamight be a symbolic link that refers to
730073ec901SMarcel Telka.Pa /export/bar
731073ec901SMarcel Telkawhich has been specifically shared. When the client mounts
732073ec901SMarcel Telka.Pa /export/foo
733073ec901SMarcel Telkathe mountd processing follows the symbolic link and responds with the
734073ec901SMarcel Telka.Pa /export/bar .
735073ec901SMarcel TelkaThe NFS Version 4 protocol does not use the mountd processing and the client's
736073ec901SMarcel Telkause of
737073ec901SMarcel Telka.Pa /export/foo
738073ec901SMarcel Telkadoes not work as it does with NFS Version 2 and Version 3 and the client
739073ec901SMarcel Telkareceives an error when attempting to mount
740073ec901SMarcel Telka.Pa /export/foo .
741