xref: /illumos-gate/usr/src/man/man8/sharemgr.8 (revision f17620a4f72a29025a22655ba8735ccd20ae174f)
1.\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved
2.\" Copyright 2016 Nexenta Systems, Inc.  All rights reserved.
3.\" Copyright 2022 Jason King
4.\"
5.\" The contents of this file are subject to the terms of the
6.\" Common Development and Distribution License (the "License").
7.\" You may not use this file except in compliance with the License.
8.\"
9.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10.\" or http://www.opensolaris.org/os/licensing.
11.\" See the License for the specific language governing permissions
12.\" and limitations under the License.
13.\"
14.\" When distributing Covered Code, include this CDDL HEADER in each
15.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16.\" If applicable, add the following below this CDDL HEADER, with the
17.\" fields enclosed by brackets "[]" replaced with your own identifying
18.\" information: Portions Copyright [yyyy] [name of copyright owner]
19.\"
20.Dd October 10, 2022
21.Dt SHAREMGR 8
22.Os
23.Sh NAME
24.Nm sharemgr
25.Nd configure and manage file sharing
26.Sh SYNOPSIS
27.Nm Cm subcommand Op options
28.Nm Cm add-share \
29    Oo Fl nth Oc \
30    Oo Fl r Ar resource-name Oc \
31    Oo Fl d Ar \(dqdescription\0text\(dq Oc
32.Nm Cm create \
33    Oo Fl nvh Oc \
34    Oo Fl P Ar proto \
35        Oo Fl p Ar property Ns = Ns Ar value Oc \
36    Oc \
37    Ar group
38.Nm Cm delete \
39    Oo Fl nvh Oc \
40    Oo Fl P Ar proto Oc \
41    Oo Fl f Oc \
42    Ar group
43.Nm Cm disable \
44    Oo Fl nvh Oc \
45    Oo Fl a | Ar group Ns ... Oc
46.Nm Cm enable \
47    Oo Fl nvh Oc \
48    Oo Fl a | Ar group Ns ... Oc
49.Nm Cm list \
50    Oo Fl vh Oc \
51    Oo Fl P Ar proto Oc
52.Nm Cm move-share \
53    Oo Fl nv Oc \
54    Fl s Ar sharepath Ar destination-group
55.Nm Cm remove-share \
56    Oo Fl fnvh Oc \
57    Fl s Ar sharepath Ar group
58.Nm Cm set \
59    Oo Fl nvh Oc \
60    Fl P Ar proto \
61    Oo Fl p Ar property Ns = Ns Ar Value Oc Ns ... \
62    Oo Fl S Ar optionset Oc \
63    Oo Fl s Ar sharepath Oc \
64    Ar group
65.Nm Cm set-share \
66    Oo Fl nh Oc \
67    Oo Fl r Ar resource Oc \
68    Oo Fl d Ar \(dqdescription\0text\(dq Oc \
69    Fl s Ar sharepath \
70    Ar group
71.Nm Cm show \
72    Oo Fl pvxh Oc \
73    Oo Fl P Ar proto Oc \
74    Oo Ar group Ns ... Oc
75.Nm Cm unset \
76    Oo Fl nvh Oc \
77    Fl P Ar proto \
78    Oo Fl S Ar optionset Oc \
79    Oo Fl p Ar property Oc Ns ... \
80    Ar group
81.Nm Cm share \
82    Oo Fl F Ar fstype Oc \
83    Oo Fl p Oc \
84    Oo Fl o Ar optionlist Oc \
85    Oo Fl d Ar description Oc \
86    Oo Ar pathname Oo Ar resourcename Oc Oc
87.Nm Cm unshare \
88    Oo Fl F Ar fstype Oc \
89    Oo Fl p Oc \
90    Oo Fl o Ar optionlist Oc \
91    Ar sharepath
92.Sh DESCRIPTION
93The
94.Nm
95command configures share groups and the shares contained within them.
96.Pp
97A group name must conform to service management facility (SMF)
98.Po
99see
100.Xr smf 7
101.Pc
102service-naming conventions, thus is limited to starting with an
103alphabetic character, with the rest of the name consisting only of alphanumeric
104characters plus
105.Ql \(hy
106(hyphen) and
107.Ql \(ru
108(underbar).
109.Pp
110Subcommands that result in a configuration change support a dry-run option.
111When dry-run
112.Pq Fl n
113is specified, the syntax and validity of the command is
114tested but the configuration is not actually updated.
115.Pp
116For all subcommands, the
117.Fl h
118option lists usage and help information.
119.Pp
120For subcommands with the verbose
121.Pq Fl v
122option, additional information will be provided.
123For example, in conjunction with the
124.Fl n
125option, verbose mode will also indicate whether the current user has
126sufficient permissions to accomplish the operation.
127.Pp
128There are two groups that are created automatically.
129The
130.Sy default
131group always exists and covers legacy NFS shares only.
132The
133.Sy zfs
134group will be created when ZFS shares are enabled.
135.Pp
136The options shown in the
137.Sx SYNOPSIS
138section are described in the context of each subcommand.
139All subcommands except
140.Cm list
141and
142.Cm show
143require root privileges or that you assume the Primary Administrator role.
144.Ss "Subcommands"
145With no subcommand entered, a
146.Nm
147command with the
148.Fl h
149option displays a usage message for all subcommands.
150.Pp
151The following subcommands follow
152.Nm
153on a command line.
154Commands take the form:
155.Bd -literal -offset 2n
156% \fBsharemgr \fI<subcommand>\fR [\fIoptions\fR]\fR
157.Ed
158.Bl -tag -width "1"
159.It Cm create \
160    Oo Fl nvh Oc \
161    Oo Fl P Ar proto Oo \
162        Fl p Ar property Ns = Ns Ar value \
163    Oc Oc \
164    Ar group
165.Pp
166Create a new group with specified name.
167.Pp
168If
169.Fl n
170is specified, the command checks only the validity of the command
171and that the group does not already exist.
172.Pp
173If no protocol is specified, all known protocols are enabled for the specified
174group.
175If a protocol is specified, only that protocol is enabled.
176You can specify properties for a specified protocol.
177.Pp
178If
179.Ar group
180exists, use of
181.Fl P
182adds the specified protocol to that group.
183.Pp
184As an example of the
185.Cm create
186subcommand, the following command creates a new group with the name
187.Ar mygroup .
188.Bd -literal -offset 2n
189# \fBsharemgr create mygroup\fR
190.Ed
191.Pp
192Because no protocol was specified in the preceding command, all defined
193protocols will be enabled on the group.
194.It Cm delete \
195    Oo Fl nvh Oc \
196    Oo Fl P Ar proto Oc \
197    Oo Fl f Oc \
198    Ar group
199.Pp
200Delete the specified group.
201If the group is not empty, you can use the
202.Fl f
203option to force the deletion, which unshares and removes all shares from the
204group before removing the group itself.
205.Pp
206If you specify a protocol, rather than deleting the whole group, this
207subcommand deletes the protocol from the group.
208.Pp
209The
210.Fl n
211option can be used to test the syntax of the command.
212.Pp
213As an example, the following command removes the group
214.Ar mygroup
215from the configuration if it is empty.
216.Bd -literal -offset 2n
217# \fBsharemgr delete mygroup\fR
218.Ed
219.Pp
220The following command removes any existing shares prior to removing the group.
221.Bd -literal -offset 2n
222# \fBsharemgr delete -f mygroup\fR
223.Ed
224.Pp
225Note the use of the force
226.Pq Fl f
227option, above.
228.It Cm list \
229    Oo Fl vh Oc \
230    Oo Fl P Ar proto Oc
231.Pp
232List the defined groups.
233.Pp
234If a protocol is specified, list only those groups that have the specified
235protocol defined.
236.Pp
237If the verbose option is specified, the current state of the group and all
238protocols enabled on the group are listed as well.
239For example:
240.Bd -literal -offset 2n
241# \fBsharemgr list -v\fR
242mygroup    enabled    nfs
243rdonlygrp  disabled   nfs
244.Ed
245.It Cm show \
246    Oo Fl pvxh Oc \
247    Oo Fl P Ar proto Oc \
248    Oo Ar group Ns ... Oc
249.Pp
250Shows the contents of the specified group(s).
251.Pp
252If the verbose option is specified, the resource name and description of each
253share is displayed if they are defined.
254Otherwise, only the share paths are
255displayed.
256Also, when temporary shares are listed, they are prefixed with an asterisk
257.Pq Ql * .
258.Pp
259If the
260.Fl p
261option is specified, all options defined for the protocols of
262the group are displayed, in addition to the display without options.
263If the
264.Fl P
265option is used, the output is limited to those groups that have the
266specified protocol enabled.
267If the
268.Fl x
269option is specified, output is in XML format and the
270.Fl p
271and
272.Fl v
273options are ignored, because all information is included in the XML.
274.Pp
275The following example illustrates the use of the
276.Fl p
277option.
278.Bd -literal -offset 2n
279# \fBsharemgr show -p mygroup\fR
280default nfs=()
281    * /data/backup
282mygroup nfs=(nosuid=true)
283      /export/home/home0
284      /export/home/home1
285.Ed
286.Pp
287The following example illustrates the use of the
288.Fl v
289option.
290.Bd -literal -offset 2n
291# \fBsharemgr show -v mygroup\fR
292mygroup
293    HOME0=/export/home/home0    "Home directory set 0"
294    HOME1=/export/home/home1    "Home directory set 1"
295.Ed
296.Pp
297ZFS managed shares are handled in a way similar to the way NFS shares are
298handled.
299These shares appear as subgroups within the parent group
300.Sy zfs .
301The subgroups are always prefixed with
302.Sy zfs/
303and use the ZFS dataset name for the rest of the name.
304The mount point and any sub-mounts that inherit
305sharing are shown as the shares of the subgroup.
306For example:
307.Bd -literal -offset 2n
308# \fBsharemgr show -vp zfs\fR
309zfs        nfs=()
310    zfs/ztest
311          /ztest
312          /ztest/backups
313.Ed
314.It Cm set \
315    Oo Fl nvh Oc \
316    Fl P Ar proto \
317    Oo Fl S Ar optionset Oc \
318    Oo Fl p Ar property Ns = Ar value Oc Ns ... \
319    Oo Fl s Ar sharepath Oc \
320    Ar group
321.Pp
322Set protocol-specific properties on the specified group.
323.Pp
324The
325.Fl P
326option is required and must specify a valid protocol.
327.Pp
328Optionsets are protocol-specific sets of properties that can be negotiated by
329the protocol client.
330For NFS, optionsets are equivalent to security modes as defined in
331.Xr nfssec 7 .
332If
333.Fl S Ar optionset
334is specified, the properties are applied to the selected optionset.
335Otherwise they are applied to the general optionset.
336.Pp
337Together,
338.Fl P
339and
340.Fl S
341select a specific view of the group's options on which to work.
342.Pp
343Property values are strings.
344A specified property is set to a new value if the
345property already exists or is added to the protocol if it does not already
346exist.
347.Pp
348In the general case, at least one property must be set.
349If
350.Fl S
351is specified, properties can be omitted and the specified optionset is enabled
352for the protocol.
353.Pp
354The
355.Fl s
356option allows setting properties on a per-share basis.
357While this is supported, it should be limited to managing legacy shares and to
358the occasional need for an override of a group-level property or placing an
359additional property on one share within a group.
360.Pp
361An example of this subcommand:
362.Bd -literal -offset 2n
363# \fBsharemgr set -P nfs -p anon=1234 mygroup\fR
364.Ed
365.Pp
366The preceding command adds the property
367.Sy anon=1234
368to the
369.Sy nfs
370view of group
371.Ar mygroup .
372If
373.Ar mygroup
374has existing shares, they will all be reshared with the new property value(s).
375.It Cm unset \
376    Oo Fl nvh Oc \
377    Fl P Ar proto \
378    Oo Fl S Ar optionset Oc \
379    Oo Fl p Ar property Oc Ns ... \
380    Oo Fl s Ar sharepath Oc \
381    Ar group
382.Pp
383Unset the specified properties for the protocol or for the specified
384.Ar optionset
385of the protocol.
386.Pp
387In the general case, at least one property must be set.
388If
389.Fl S
390is specified, properties can be omitted and the specified optionset is removed
391from the protocol.
392.Pp
393The
394.Fl s
395option allows removing a share-specific property.
396.Pp
397An example of this subcommand:
398.Bd -literal -offset 2n
399# \fBsharemgr unset -P nfs -p anon mygroup\fR
400.Ed
401.Pp
402The preceding command removes the
403.Ar anon=
404property from the
405.Sy nfs
406view of group
407.Ar mygroup .
408If
409.Ar mygroup
410has existing shares, they will all be reshared with the new property value(s).
411.It Cm add-share \
412    Oo Fl nth Oc \
413    Oo Fl r Ar resource-name Oc \
414    Oo Fl d Ar \(dqdescription text\(dq Oc \
415    Fl s Ar sharepath \
416    Ar group
417.Pp
418Add a new share to the specified group.
419.Pp
420The
421.Fl s
422option is mandatory and takes a full directory path.
423.Pp
424If either or both of
425.Fl d
426and
427.Fl r
428are specified, they specify values associated with the share.
429.Fl d
430provides a description string to document the share and
431.Fl r
432provides a protocol-independent resource name.
433Resource names are not used by NFS at this time but can be specified.
434These names currently follow the same naming rules as group names.
435.Pp
436The temporary option
437.Pq Fl t
438results in the share being shared but not
439stored in the configuration repository.
440This option is intended for shares that
441should not survive a reboot or server restart, or for testing purposes.
442Temporary shares are indicated in the
443.Cm show
444subcommand output with an asterisk
445.Pq Ql *
446preceding the share.
447.Pp
448If
449.Ar sharepath
450is a ZFS path and that path is added to the
451.Ar zfs
452group,
453.Nm
454creates a new ZFS subgroup; the new share is added to that subgroup.
455Any ZFS sub-filesystems under the ZFS filesystem designated by
456.Ar sharepath
457will inherit the shared status of
458.Ar sharepath .
459.Pp
460The effect of the
461.Cm add-share
462subcommand on a ZFS dataset is determined by the values of the
463.Sy sharesmb
464and
465.Sy sharenfs
466properties of that dataset.
467.Pp
468See
469.Xr zfs 8
470for a description of the
471.Sy sharesmb
472and
473.Sy sharenfs
474properties.
475.Pp
476The following are examples of the
477.Cm add-share
478subcommand.
479.Bd -literal -offset 2n
480# \fBsharemgr add-share -s /export/home/home0 -d "home \e
481directory set 0" -r HOME0 mygroup\fR
482
483# \fBsharemgr add-share -s /export/home/home1 -d "home \e
484directory set 1" -r HOME1 mygroup\fR
485.Ed
486.Pp
487The preceding commands add
488.Pa /export/home/home0
489and
490.Pa /export/home/home1
491to the group
492.Ar mygroup .
493A descriptive comment and a resource name are included.
494.It Cm move-share \
495    Oo Fl nvh Oc \
496    Fl s Ar sharepath \
497    Ar destination-group
498.Pp
499Move the specified share from the group it is currently in to the specified
500destination group.
501The
502.Cm move-share
503subcommand does not create a group.
504A specified group must exist for the command to succeed.
505.Pp
506The following is an example of this subcommand.
507.Bd -literal -offset 2n
508# \fBsharemgr move-share -s /export/home/home1 newgroup\fR
509.Ed
510.Pp
511Assuming
512.Pa /export/home/home1
513is in the group
514.Ar mygroup ,
515the preceding command moves
516.Pa /export/home/home1
517to the group
518.Ar newgroup
519and unshares and then reshares the directory with the properties associated with
520.Ar newgroup .
521.It Cm remove-share \
522    Oo Fl fnvh Oc \
523    Fl s Ar sharepath \
524    Ar group
525.Pp
526Remove the specified share from the specified group.
527The force
528.Pq Fl f
529option forces the share to be removed even if it is busy.
530.Pp
531You must specify the full path for
532.Ar sharepath .
533For group, use the subgroup as displayed in the output of the
534.Nm Cm show
535command.
536Note that if
537there are subshares that were created by inheritance, these will be removed,
538along with the parent shares.
539.It Cm set-share \
540    Oo Fl nvh Oc \
541    Oo Fl r resource Oc \
542    Oo Fl d Ar \(dqdescription text\(dq Oc \
543    Fl s Ar sharepath \
544    Ar group
545.Pp
546Set or change the specified share's description and resource values.
547One use of
548.Cm set-share
549is to rename a resource.
550The syntax for this use of the subcommand is:
551.Bd -literal -offset 2n
552# \fBsharemgr set-share -r \fIcurrent_name\fR=\fInew_name\fR -s \fIsharepath\fR \fIgroup\fR\fR
553.Ed
554.It Cm enable \
555    Oo Fl nvh Oc \
556    Oo Ar group Ns ... | Fl a Oc
557.Pp
558Enable the specified group(s), or
559.Po
560with
561.Fl a
562.Pc
563all groups, and start sharing the contained shares.
564This state persists across reboots.
565.Pp
566An enabled group will be shared whenever the corresponding SMF service instance
567is enabled.
568.Nm
569will start the SMF service instance if it is not currently online.
570.It Cm disable \
571    Oo Fl nvh Oc \
572    Oo Ar group Ns ... | Fl a Oc
573.Pp
574Disable the specified group(s), or
575.Po
576with
577.Fl a
578.Pc
579all groups, and unshare the shares that they contain.
580This state persists across reboots.
581.Pp
582A disabled group will not be shared even if the corresponding SMF service
583instance is online.
584This feature is useful when you do not want a group of
585shares to be started at boot time.
586.It Cm start \
587    Oo Fl vh Oc \
588    Oo Fl P Ar proto Oc \
589    Oo Ar group Ns ... | Fl a Oc
590.Pp
591Start the specified group, or
592.Po
593with
594.Fl a
595.Pc
596all groups.
597The
598.Cm start
599subcommand is similar to
600.Cm enable
601in that all shares are started, but
602.Cm start
603works only on groups that are enabled.
604.Cm start
605is used by the SMF to start sharing at system boot.
606.Pp
607A group will not start sharing if it is in the
608.Nm sharemgr Em disabled
609state.
610However, the corresponding SMF service instance will be started.
611.Pp
612Note that the
613.Cm start
614subcommand is similar to the
615.Xr shareall 8
616command in that it starts up only the configured shares.
617That is, the enabled
618shares will start being shared, but the configuration state is left the same.
619The command:
620.Bd -literal -offset 2n
621# \fBsharemgr start -a\fR
622.Ed
623.Pp
624\&...is equivalent to:
625.Bd -literal -offset 2n
626# \fBshareall\fR
627.Ed
628.It Cm stop \
629    Oo Fl vh Oc \
630    Oo Fl P Ar proto Oc \
631    Oo Ar group Ns ... | Fl a Oc
632.Pp
633Stop the specified group, or
634.Po
635with
636.Fl a
637.Pc
638all groups.
639The
640.Cm stop
641subcommand is similar to
642.Cm disable
643in that all shares are no longer shared,
644but it works only on groups that are enabled.
645.Cm stop
646is used by the SMF to stop sharing at system shutdown.
647.Pp
648Note that the
649.Cm stop
650subcommand is similar to the
651.Xr unshareall 8
652command in that all active shares are unshared, but the configuration is left
653the same.
654That is, the shares are stopped but the service instances are left enabled.
655The command:
656.Bd -literal -offset 2n
657# \fBsharemgr stop -a\fR
658.Ed
659.Pp
660\&...is equivalent to:
661.Bd -literal -offset 2n
662# \fBunshareall\fR
663.Ed
664.It Cm share \
665    Oo Fl F Ar fstype Oc \
666    Oo Fl p Oc \
667    Oo Fl o Ar optionlist Oc \
668    Oo Fl d Ar descriptoion Oc \
669    Oo Ar pathname Oo Ar resoucename Oc Oc
670.Pp
671Shares the specified path in the
672.Ar default
673share group.
674This subcommand implements the
675.Xr share 8
676functionality.
677Shares that are shared in this manner will be transient shares.
678Use of the
679.Fl p
680option causes the shares to be persistent.
681.It Cm unshare \
682    Oo Fl F Ar fstype Oc \
683    Oo Fl p Oc \
684    Oo Fl o Ar optionlist Oc \
685    Ar sharepath
686.Pp
687Unshares the specified share.
688This subcommand implements the
689.Xr unshare 8
690functionality.
691By default, the
692.Cm unshare
693is temporary.
694The
695.Fl p
696option
697is provided to remove the share from the configuration in a way that persists
698across reboots.
699.El
700.Ss "Supported Properties"
701Properties are protocol-specific.
702Currently, only the NFS and SMB protocols are supported.
703Properties have the following characteristics:
704.Bl -bullet -offset indent
705.It
706Values of type
707.Sy boolean
708take either
709.Sy true
710or
711.Sy false .
712.It
713Values of type
714.Sy value
715take a numeric value.
716.It
717Values of type
718.Sy file
719take a file name and not a file path.
720.It
721Values of type
722.Sy access-list
723are described in detail following the descriptions of the NFS properties.
724.El
725.Pp
726The general properties supported for NFS are:
727.Bl -tag -width 1
728.It Cm abe Ns = Ns Ar boolean
729.Pp
730Set the access-based enumeration (ABE) policy for a share.
731When set to
732.Ql true ,
733ABE filtering is enabled on this share and directory entries to
734which the requesting user has no access will be omitted from directory listings
735returned to the client.
736When set to
737.Ql false
738or not defined, ABE filtering will not be performed on this share.
739This property is not defined by default.
740.Bl -tag -width disabled
741.It false
742Disable ABE for this share.
743.It true
744Enable ABE for this share.
745.El
746.It Cm aclok Ns = Ns Ar boolean
747.Pp
748Allows the NFS server to do access control for NFS Version 2 clients (running
749SunOS 2.4 or earlier).
750When
751.Cm aclok
752is set on the server, maximum access is given to all clients.
753For example, with
754.Cm aclok
755set, if anyone has read permissions, then everyone does.
756If
757.Cm aclok
758is not set, minimum access is given to all clients.
759.It Cm ad-container
760.Pp
761Specifies the AD container in which to publish shares.
762.Pp
763The AD container is specified as a comma-separated list of attribute name-value
764pairs using the LDAP distinguished name (DN) or relative distinguished name
765(RDN) format.
766The DN or RDN must be specified in LDAP format using the
767.Ar cn= ,
768.Ar ou= ,
769and
770.Ar dc=
771prefixes:
772.Bl -bullet -offset indent
773.It
774.Cm cn
775represents the common name
776.It
777.Cm ou
778represents the organizational unit
779.It
780.Cm dc
781represents the domain component
782.El
783.Pp
784.Cm cn= ,
785.Cm ou= ,
786and
787.Cm dc=
788are attribute types.
789The attribute type used
790to describe an object's RDN is called the naming attribute, which, for ADS,
791includes the following object classes:
792.Bl -bullet -offset indent
793.It
794.Cm cn
795for the
796.Sy user
797object class
798.It
799.Cm ou
800for the organizational unit
801.Pq Cm OU
802object class
803.It
804.Cm dc
805for the
806.Cm domainDns
807object class
808.El
809.It Cm anon Ns = Ns Ar uid
810.Pp
811Set
812.Ar uid
813to be the effective user ID of unknown users.
814By default, unknown users are given the effective user ID
815.Dv UID_NOBODY .
816If uid is set to
817.Sy -1 ,
818access is denied.
819.It Cm catia Ns = Ns Ar boolean
820.Pp
821CATIA V4 uses characters in file names that are considered to be invalid by
822Windows.
823CATIA V5 is available on Windows.
824A CATIA V4 file could be
825inaccessible to Windows clients if the file name contains any of the characters
826that are considered illegal in Windows.
827By default, CATIA character substitution is not performed.
828If the
829.Cm catia
830property is set to true, the following character
831substitution is applied to file names.
832.Bd -literal -offset 2n
833CATIA    CATIA
834V4 UNIX  V5 Windows
835  "      \e250   0x00a8  Dieresis
836  *      \e244   0x00a4  Currency Sign
837  /      \e370   0x00f8  Latin Small Letter O with Stroke
838  :      \e367   0x00f7  Division Sign
839  <      \e253   0x00ab  Left-Pointing Double Angle Quotation Mark
840  >      \e273   0x00bb  Right-Pointing Double Angle Quotation Mark
841  ?      \e277   0x00bf  Inverted Question Mark
842  \e      \e377   0x00ff  Latin Small Letter Y with Dieresis
843  |      \e246   0x00a6  Broken Bar
844.Ed
845.It Cm cksum Ns = Ns Ar cksumlist
846.Pp
847Set the share to attempt to use end-to-end checksums.
848The value
849.Ar cksumlist
850specifies the checksum algorithms that should be used.
851.It Cm csc Ns = Ns Ar value
852.Pp
853Set the client-side caching policy for a share.
854Client-side caching is a client
855feature and offline files are managed entirely by the clients.
856.Pp
857The following are valid values for the
858.Cm csc
859property:
860.Bl -tag -width disabled -offset indent
861.It Sy manual
862Clients are permitted to cache files from the specified
863share for offline use as requested by users.
864However, automatic file-by-file reintegration is not permitted.
865.Sy manual
866is the default value.
867.It Sy auto
868Clients are permitted to automatically cache files from the
869specified share for offline use and file-by-file reintegration is permitted.
870.It Sy vdo
871Clients are permitted to automatically cache files from the
872specified share for offline use, file-by-file reintegration is permitted, and
873clients are permitted to work from their local cache even while offline.
874.It Sy disabled
875Client-side caching is not permitted for this share.
876.El
877.It Cm guestok Ns = Ns Ar boolean
878.Pp
879Set the guest access policy for the share.
880When set to
881.Sy true
882guest access is allowed on this share.
883When set to
884.Sy false
885or not defined guest access is not allowed on this share.
886This property is not defined by default.
887.Pp
888An
889.Xr idmap 8
890name-based rule can be used to map
891.Sy guest
892to any local username, such as
893.Sy guest
894or
895.Sy nobody .
896If the local account has a password in
897.Pa /var/smb/smbpasswd
898the guest connection will be authenticated against that password.
899Any connection made using an account that maps to the
900local guest account will be treated as a guest connection.
901.Pp
902Example name-based rule:
903.Bd -literal -offset 2n
904# \fBidmap add winname:Guest unixuser:guest\fR
905.Ed
906.It Cm index Ns = Ns Ar file
907.Pp
908Load
909.Ar file
910rather than a listing of the directory containing this file
911when the directory is referenced by an NFS URL.
912.It Cm log Ns = Ns Ar tag
913.Pp
914Enables NFS server logging for the specified system.
915The optional tag determines the location of the related log files.
916The tag is defined in
917.Pa /etc/nfs/nfslog.conf .
918If no tag is specified, the default values
919associated with the global tag in
920.Pa /etc/nfs/nfslog.conf
921is used.
922Support of
923NFS server logging is available only for NFS Version 2 and Version 3 requests.
924.It Cm nosub Ns = Ns Ar boolean
925.Pp
926Prevents clients from mounting subdirectories of shared directories.
927For example, if
928.Pa /export
929is shared with the
930.Cm nosub
931option on server
932.Ql wool
933then an NFS client cannot do:
934.Bd -literal -offset 2n
935# \fBmount -F nfs wool:/export/home/mnt\fR
936.Ed
937.Pp
938NFS Version 4 does not use the MOUNT protocol.
939The
940.Cm nosub
941option applies only to NFS Version 2 and Version 3 requests.
942.It Cm nosuid Ns = Ns Ar boolean
943.Pp
944By default, clients are allowed to create files on a shared file system with
945the
946.Sy setuid
947or
948.Sy setgid
949mode enabled.
950Specifying
951.Sy nosuid
952causes the server file system to silently ignore any attempt to enable the
953.Sy setuid
954or
955.Sy setgid
956mode bits.
957.It Cm public Ns = Ns Ar boolean
958.Pp
959Moves the location of the public file handle from root
960.Pq /
961to the exported directory for WebNFS-enabled browsers and clients.
962This option does not enable WebNFS service; WebNFS is always on.
963Only one file system per server can have the
964.Sy public
965property.
966You can apply the
967.Sy public
968property only to a share and not to a group.
969.El
970.Pp
971NFS also supports negotiated optionsets for supported security modes.
972The security modes are documented in
973.Xr nfssec 7 .
974The properties supported for these optionsets are:
975.Bl -tag -width 1
976.It Cm charset Ns = Ns Ar access-list
977.Pp
978Where
979.Cm charset
980is one of:
981.Sy euc-cn ,
982.Sy euc-jp ,
983.Sy euc-jpms ,
984.Sy euc-kr ,
985.Sy euc-tw ,
986.Sy iso8859-1 ,
987.Sy iso8859-2 ,
988.Sy iso8859-5 ,
989.Sy iso8859-6 ,
990.Sy iso8859-7 ,
991.Sy iso8859-8 ,
992.Sy iso8859-9 ,
993.Sy iso8859-13 ,
994.Sy iso8859-15 ,
995.Sy koi8-r .
996.Pp
997Clients that match the
998.Ar access-list
999for one of these properties will be
1000assumed to be using that character set and file and path names will be
1001converted to UTF-8 for the server.
1002.It Cm ro Ns = Ns Ar access-list
1003.Pp
1004Sharing is read-only to the clients listed in
1005.Ar access-list ;
1006overrides the
1007.Cm rw
1008suboption for the clients specified.
1009See the description of
1010.Ar access-list
1011below.
1012.It Cm rw Ns = Ns Ar access-list
1013.Pp
1014Sharing is read-write to the clients listed in
1015.Ar access-list ;
1016overrides the
1017.Cm ro
1018suboption for the clients specified.
1019See the description of
1020.Ar access-list
1021below.
1022.It Cm none Ns = Ns Ar access-list
1023.Pp
1024Access is not allowed to any client that matches the access list.
1025The exception
1026is when the access list is an asterisk
1027.Pq Ql * ,
1028in which case
1029.Cm ro
1030or
1031.Cm rw
1032can override
1033.Cm none .
1034.It Cm root Ns = Ns Ar access-list
1035.Pp
1036Only root users from the hosts specified in
1037.Ar access-list
1038have root access.
1039See details on
1040.Ar access-list
1041below.
1042By default, no host has root access, so
1043root users are mapped to an anonymous user ID (see the
1044.Cm anon Ns = Ns Ar uid
1045option described above).
1046Netgroups can be used if the file system shared is using UNIX
1047authentication
1048.Pq Dv AUTH_SYS .
1049.It Cm root_mapping Ns = Ns Ar uid
1050.Pp
1051For a client that is allowed root access, map the root UID to the specified
1052user id.
1053.It Cm window Ns = Ns Ar value
1054.Pp
1055When sharing with
1056.Cm sec Ns = Ns Sy dh
1057.Po
1058see
1059.Xr nfssec 7
1060.Pc ,
1061set the maximum lifetime (in seconds) of the RPC request's credential
1062(in the authentication header) that the NFS server allows.
1063If a credential arrives with a lifetime larger than
1064what is allowed, the NFS server rejects the request.
1065The default value is 30000 seconds (8.3 hours).
1066This property is ignored for security modes other than
1067.Sy dh .
1068.El
1069.Pp
1070The general properties supported for SMB are:
1071.Bl -tag -width 1
1072.It Cm encrypt Ns = Ns Ar string
1073.Pp
1074Controls SMB3 per-share encryption.
1075This is similar to the global smbd/encrypt option.
1076For requests on a particular share, the server's behavior is controlled
1077by the stricter of this option and smbd/encrypt.
1078.Pp
1079When set to
1080.Sy disabled ,
1081the server will not ask clients to encrypt requests.
1082When set to
1083.Sy enabled ,
1084the server will ask clients to encrypt requests,
1085but will not require that they do so.
1086Any message than can be encrypted will be encrypted.
1087When set to
1088.Sy required ,
1089the server will deny access to or disconnect
1090any client that does not support encryption or fails to encrypt requests
1091that they should.
1092.Pp
1093In other words, the
1094.Sy enabled
1095behavior is that any message that CAN
1096be encrypted SHOULD be encrypted, while the
1097.Sy required
1098behavior is that any message that CAN be encrypted MUST be encrypted.
1099.Pp
1100This property is not defined by default.
1101.It Cm ro Ns = Ns Ar access-list
1102.Pp
1103Sharing is read-only to the clients listed in
1104.Ar access-list ;
1105overrides the
1106.Cm rw
1107suboption for the clients specified.
1108See the description of
1109.Ar access-list
1110below.
1111.It Cm rw Ns = Ns Ar access-list
1112.Pp
1113Sharing is read-write to the clients listed in
1114.Ar access-list ;
1115overrides the
1116.Cm ro
1117suboption for the clients specified.
1118See the description of
1119.Ar access-list
1120below.
1121.It Cm none Ns = Ns access-list
1122.Pp
1123Access is not allowed to any client that matches the access list.
1124The exception is when the access list is an asterisk
1125.Pq Ql * ,
1126in which case
1127.Cm ro
1128or
1129.Cm rw
1130can override
1131.Cm none .
1132.El
1133.Ss "Access List Argument"
1134The
1135.Ar access-list
1136argument is either the string
1137.Ql *
1138to represent all hosts or a colon-separated list whose components can be any
1139number of the following:
1140.Bl -tag -width 1
1141.It Ar hostname
1142.Pp
1143The name of a host.
1144With a server configured for DNS or LDAP naming in the
1145.Xr nsswitch.conf 5
1146.Ql hosts
1147entry, a hostname must be represented as a fully qualified DNS or LDAP name.
1148.It Ar netgroup
1149.Pp
1150A
1151.Ar netgroup
1152contains a number of hostnames.
1153With a server configured for DNS or LDAP naming in the
1154.Xr nsswitch.conf 5
1155.Ql hosts
1156entry, any
1157hostname in a netgroup must be represented as a fully qualified DNS or LDAP
1158name.
1159.It Ar domainname . Ns Ar suffix
1160.Pp
1161To use domain membership the server must use DNS or LDAP, rather than, for
1162example, NIS, to resolve hostnames to IP addresses.
1163That is, the
1164.Sy hosts
1165entry in the
1166.Xr nsswitch.conf 5
1167must specify
1168.Ql dns
1169or
1170.Ql ldap
1171ahead of
1172.Ql nis ,
1173because only DNS and LDAP return the full domain name of the host.
1174Other name services, such as NIS,
1175cannot be used to resolve hostnames on the server because, when mapping
1176an IP address to a hostname, they do not return domain information.
1177For example, for the IP address 172.16.45.9:
1178.Bl -tag -width "DNS OR LDAP"
1179.It Sy NIS
1180Returns:
1181.Sy myhost
1182.It Sy DNS or LDAP
1183Returns:
1184.Sy myhost.mydomain.example.com
1185.El
1186.Pp
1187The domain name suffix is distinguished from hostnames and netgroups by a
1188prefixed dot.
1189For example:
1190.Bd -literal -offset 2n
1191rw=.mydomain.example.com
1192.Ed
1193.Pp
1194A single dot can be used to match a hostname with no suffix.
1195For example, the
1196specification:
1197.Bd -literal -offset 2n
1198rw=.
1199.Ed
1200.Pp
1201\&...matches
1202.Ql mydomain
1203but not
1204.Ql mydomain.example.com .
1205This feature can be used to match hosts resolved through NIS rather than DNS and
1206LDAP.
1207.It Ar network
1208.Pp
1209The network or subnet component is preceded by an at-sign
1210.Pq Ql @ .
1211It can be either a name or a dotted address.
1212If a name, it is converted to a dotted address by
1213.Xr getnetbyname 3SOCKET .
1214For example:
1215.Bd -literal -offset 2n
1216=@mynet
1217.Ed
1218.Pp
1219\&...is equivalent to:
1220.Bd -literal -offset 2n
1221=@172.16 or =@172.16.0.0
1222.Ed
1223.Pp
1224The network prefix assumes an octet-aligned netmask determined from the zeroth
1225octet in the low-order part of the address up to and including the high-order
1226octet, if you want to specify a single IP address.
1227In the case where network
1228prefixes are not byte-aligned, the syntax allows a mask length to be specified
1229explicitly following a slash
1230.Pq Ql /
1231delimiter.
1232For example:
1233.Bd -literal -offset 2n
1234=@theothernet/17 or =@172.16.132/22
1235.Ed
1236.Pp
1237\&...where the mask is the number of leftmost contiguous significant bits in
1238the corresponding IP address.
1239.El
1240.Pp
1241A prefixed minus sign
1242.Pq Ql -
1243denies access to a component of
1244.Ar access-list .
1245The list is searched sequentially until a match is found
1246that either grants or denies access, or until the end of the list is reached.
1247For example, if host
1248.Ql terra
1249is in the netgroup
1250.Ql engineering ,
1251then:
1252.Bd -literal -offset 2n
1253rw=-terra:engineering
1254.Ed
1255.Pp
1256\&...denies access to
1257.Ql terra ,
1258but:
1259.Bd -literal -offset 2n
1260rw=engineering:-terra
1261.Ed
1262.Pp
1263\&...grants access to
1264.Ql terra .
1265.Sh FILES
1266.Bl -tag -width Pa
1267.It Pa /usr/include/libshare.h
1268Error codes used for exit status.
1269.El
1270.Sh EXIT STATUS
1271.Bl -tag -offset indent -width "other non-zero" -compact
1272.It Er 0
1273Successful completion.
1274.It Er 98
1275Service is offline and cannot be enabled (start only).
1276.It Er other non-zero
1277Command failed.
1278.El
1279.Sh INTERFACE STABILITY
1280Committed
1281.Sh SEE ALSO
1282.Xr attributes 7 ,
1283.Xr nfssec 7 ,
1284.Xr smf 7 ,
1285.Xr standards 7 ,
1286.Xr idmap 8 ,
1287.Xr sharectl 8 ,
1288.Xr zfs 8
1289