docs: mention -S|--setsddl in sharesec manpage.
[Samba.git] / docs-xml / manpages / sharesec.1.xml
blob201c395a265d8a3fe8fe01fe56d6f4c3c058c9cf
1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <!DOCTYPE refentry PUBLIC "-//Samba-Team//DTD DocBook V4.2-Based Variant V1.0//EN" "http://www.samba.org/samba/DTD/samba-doc">
3 <refentry id="sharesec.1">
5 <refmeta>
6         <refentrytitle>sharesec</refentrytitle>
7         <manvolnum>1</manvolnum>
8         <refmiscinfo class="source">Samba</refmiscinfo>
9         <refmiscinfo class="manual">User Commands</refmiscinfo>
10         <refmiscinfo class="version">4.0</refmiscinfo>
11 </refmeta>
14 <refnamediv>
15         <refname>sharesec</refname>
16         <refpurpose>Set or get share ACLs</refpurpose>
17 </refnamediv>
19 <refsynopsisdiv>
20         <cmdsynopsis>
21                 <command>sharesec</command>
22                 <arg choice="req">sharename</arg>
23                 <arg choice="opt">-r, --remove=ACL</arg>
24                 <arg choice="opt">-m, --modify=ACL</arg>
25                 <arg choice="opt">-a, --add=ACL</arg>
26                 <arg choice="opt">-R, --replace=ACLs</arg>
27                 <arg choice="opt">-D, --delete</arg>
28                 <arg choice="opt">-v, --view</arg>
29                 <arg choice="opt">--view-all</arg>
30                 <arg choice="opt">-M, --machine-sid</arg>
31                 <arg choice="opt">-F, --force</arg>
32                 <arg choice="opt">-d, --debuglevel=DEBUGLEVEL</arg>
33                 <arg choice="opt">-s, --configfile=CONFIGFILE</arg>
34                 <arg choice="opt">-l, --log-basename=LOGFILEBASE</arg>
35                 <arg choice="opt">-V, --version</arg>
36                 <arg choice="opt">-?, --help</arg>
37                 <arg choice="opt">--usage</arg>
38                 <arg choice="opt">-S, --setsddl=STRING</arg>
39         </cmdsynopsis>
40 </refsynopsisdiv>
42 <refsect1>
43         <title>DESCRIPTION</title>
45         <para>This tool is part of the <citerefentry><refentrytitle>samba</refentrytitle>
46         <manvolnum>7</manvolnum></citerefentry> suite.</para>
48         <para>The <command>sharesec</command> program manipulates share permissions
49         on SMB file shares.</para>
50 </refsect1>
53 <refsect1>
54         <title>OPTIONS</title>
56         <para>The following options are available to the <command>sharesec</command> program.
57         The format of ACLs is described in the section ACL FORMAT </para>
59         <variablelist>
60                 <varlistentry>
61                 <term>-a|--add=ACL</term>
62                 <listitem><para>Add the ACEs specified to the ACL list.
63                 </para></listitem>
64                 </varlistentry>
66                 <varlistentry>
67                 <term>-D|--delete</term>
68                 <listitem><para>Delete the entire security descriptor.
69                 </para></listitem>
70                 </varlistentry>
72                 <varlistentry>
73                 <term>-F|--force</term>
74                 <listitem><para>Force storing the ACL.
75                 </para></listitem>
76                 </varlistentry>
78                 <varlistentry>
79                 <term>-m|--modify=ACL</term>
80                 <listitem><para>Modify existing ACEs.
81                 </para></listitem>
82                 </varlistentry>
84                 <varlistentry>
85                 <term>-M|--machine-sid</term>
86                 <listitem><para>Initialize the machine SID.
87                 </para></listitem>
88                 </varlistentry>
90                 <varlistentry>
91                 <term>-r|--remove=ACL</term>
92                 <listitem><para>Remove ACEs.
93                 </para></listitem>
94                 </varlistentry>
96                 <varlistentry>
97                 <term>-R|--replace=ACLS</term>
98                 <listitem><para>
99                 Overwrite an existing share permission ACL.
100                 </para></listitem>
101                 </varlistentry>
103                 <varlistentry>
104                 <term>-v|--view</term>
105                 <listitem><para>
106                 List a share acl
107                 </para></listitem>
108                 </varlistentry>
110                 <varlistentry>
111                 <term>--view-all</term>
112                 <listitem><para>
113                 List all share acls
114                 </para></listitem>
115                 </varlistentry>
117                 <varlistentry>
118                 <term>-S|--setsddl=STRING</term>
119                 <listitem><para>
120                 Set security descriptor by providing ACL in SDDL format.
121                 </para></listitem>
122                 </varlistentry>
124                 &stdarg.help;
125                 &stdarg.server.debug;
126                 &popt.common.samba;
127         </variablelist>
128 </refsect1>
131 <refsect1>
132         <title>ACL FORMAT</title>
134         <para>The format of an ACL is one or more ACL entries separated by
135         either commas or newlines.  An ACL entry is one of the following: </para>
137         <para><programlisting>
138         REVISION:&lt;revision number&gt;
139         OWNER:&lt;sid or name&gt;
140         GROUP:&lt;sid or name&gt;
141         ACL:&lt;sid or name&gt;:&lt;type&gt;/&lt;flags&gt;/&lt;mask&gt;
142         </programlisting></para>
144         <para>The revision of the ACL specifies the internal Windows
145         NT ACL revision for the security descriptor.
146         If not specified it defaults to 1. Using values other than 1 may
147         cause strange behaviour.</para>
149         <para>The owner and group specify the owner and group SIDs for the
150         object. If a SID in the format S-1-x-y-z is specified this is used,
151         otherwise the name specified is resolved using the server on which
152         the file or directory resides.</para>
154         <para>ACLs specify permissions granted to the SID. This SID
155         can be specified in S-1-x-y-z format or as a name in which case
156         it is resolved against the server on which the file or directory
157         resides.  The type, flags and mask values determine the type of
158         access granted to the SID.</para>
160         <para>The type can be either ALLOWED or DENIED to allow/deny access
161         to the SID. The flags values are generally zero for share ACLs.
162         </para>
164         <para>The mask is a value which expresses the access right
165         granted to the SID. It can be given as a decimal or hexadecimal value,
166         or by using one of the following text strings which map to the NT
167         file permissions of the same name.</para>
169         <itemizedlist>
170                 <listitem><para><emphasis>R</emphasis> - Allow read access </para></listitem>
171                 <listitem><para><emphasis>W</emphasis> - Allow write access</para></listitem>
172                 <listitem><para><emphasis>X</emphasis> - Execute permission on the object</para></listitem>
173                 <listitem><para><emphasis>D</emphasis> - Delete the object</para></listitem>
174                 <listitem><para><emphasis>P</emphasis> - Change permissions</para></listitem>
175                 <listitem><para><emphasis>O</emphasis> - Take ownership</para></listitem>
176         </itemizedlist>
178         <para>The following combined permissions can be specified:</para>
180         <itemizedlist>
181                 <listitem><para><emphasis>READ</emphasis> -  Equivalent to 'RX'
182                 permissions</para></listitem>
183                 <listitem><para><emphasis>CHANGE</emphasis> - Equivalent to 'RXWD' permissions
184                 </para></listitem>
185                 <listitem><para><emphasis>FULL</emphasis> - Equivalent to 'RWXDPO'
186                 permissions</para></listitem>
187         </itemizedlist>
188         </refsect1>
190 <refsect1>
191         <title>EXIT STATUS</title>
193         <para>The <command>sharesec</command> program sets the exit status
194         depending on the success or otherwise of the operations performed.
195         The exit status may be one of the following values. </para>
197         <para>If the operation succeeded, sharesec returns and exit
198         status of 0.  If <command>sharesec</command> couldn't connect to the specified server,
199         or there was an error getting or setting the ACLs, an exit status
200         of 1 is returned.  If there was an error parsing any command line
201         arguments, an exit status of 2 is returned. </para>
202 </refsect1>
204 <refsect1>
205         <title>EXAMPLES</title>
207         <para>Add full access for SID
208         <parameter>S-1-5-21-1866488690-1365729215-3963860297-17724</parameter> on
209         <parameter>share</parameter>:
210         </para>
212         <programlisting>
213         host:~ # sharesec share -a S-1-5-21-1866488690-1365729215-3963860297-17724:ALLOWED/0/FULL
214         </programlisting>
216         <para>List all ACEs for <parameter>share</parameter>:
217         </para>
219         <programlisting>
220         host:~ # sharesec share -v
221         REVISION:1
222         OWNER:(NULL SID)
223         GROUP:(NULL SID)
224         ACL:S-1-1-0:ALLOWED/0/0x101f01ff
225         ACL:S-1-5-21-1866488690-1365729215-3963860297-17724:ALLOWED/0/FULL
226         </programlisting>
227 </refsect1>
229 <refsect1>
230         <title>VERSION</title>
232         <para>This man page is correct for version 3 of the Samba suite.</para>
233 </refsect1>
235 <refsect1>
236         <title>AUTHOR</title>
237         <para>The original Samba software and related utilities
238         were created by Andrew Tridgell. Samba is now developed
239         by the Samba Team as an Open Source project similar
240         to the way the Linux kernel is developed.</para>
241 </refsect1>
243 </refentry>