torture: smbtorture test case to verify Compound related handling
[Samba.git] / docs-xml / manpages / smbcacls.1.xml
blob7efcc087cfda5ab658bc88fd8675d2037c0a2ed1
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="smbcacls.1">
5 <refmeta>
6         <refentrytitle>smbcacls</refentrytitle>
7         <manvolnum>1</manvolnum>
8         <refmiscinfo class="source">Samba</refmiscinfo>
9         <refmiscinfo class="manual">User Commands</refmiscinfo>
10         <refmiscinfo class="version">&doc.version;</refmiscinfo>
11 </refmeta>
14 <refnamediv>
15         <refname>smbcacls</refname>
16         <refpurpose>Set or get ACLs on an NT file or directory names</refpurpose>
17 </refnamediv>
19 <refsynopsisdiv>
20         <cmdsynopsis>
21                 <command>smbcacls</command>
22                 <arg choice="req">//server/share</arg>
23                 <arg choice="req">/filename</arg>
24                 <arg choice="opt">-D|--delete acl</arg>
25                 <arg choice="opt">-M|--modify acl</arg>
26                 <arg choice="opt">-a|--add acl</arg>
27                 <arg choice="opt">-S|--set acl</arg>
28                 <arg choice="opt">-C|--chown name</arg>
29                 <arg choice="opt">-G|--chgrp name</arg>
30                 <arg choice="opt">-I allow|remove|copy</arg>
31                 <arg choice="opt">--propagate-inheritance</arg>
32                 <arg choice="opt">--numeric</arg>
33                 <arg choice="opt">-t</arg>
34                 <arg choice="opt">-U username</arg>
35                 <arg choice="opt">-d</arg>
36                 <arg choice="opt">-e</arg>
37                 <arg choice="opt">-m|--max-protocol LEVEL</arg>
38                 <arg choice="opt">--query-security-info FLAGS</arg>
39                 <arg choice="opt">--set-security-info FLAGS</arg>
40                 <arg choice="opt">--sddl</arg>
41                 <arg choice="opt">--domain-sid SID</arg>
42                 <arg choice="opt">-x|--maximum-access</arg>
43         </cmdsynopsis>
44 </refsynopsisdiv>
46 <refsect1>
47         <title>DESCRIPTION</title>
49         <para>This tool is part of the <citerefentry><refentrytitle>samba</refentrytitle>
50         <manvolnum>7</manvolnum></citerefentry> suite.</para>
52         <para>The <command>smbcacls</command> program manipulates NT Access Control
53         Lists (ACLs) on SMB file shares. An ACL is comprised zero or more Access
54         Control Entries (ACEs), which define access restrictions for a specific
55         user or group.</para>
56 </refsect1>
59 <refsect1>
60         <title>OPTIONS</title>
62         <para>The following options are available to the <command>smbcacls</command> program.  
63         The format of ACLs is described in the section ACL FORMAT </para>
66         <variablelist>
67                 <varlistentry>
68                 <term>-a|--add acl</term>
69                 <listitem><para>Add the entries specified to the ACL.  Existing
70                 access control entries are unchanged.</para></listitem>
71                 </varlistentry>
72                 
73                 
74                 
75                 <varlistentry>
76                 <term>-M|--modify acl</term>
77                 <listitem><para>Modify the mask value (permissions) for the ACEs
78                 specified on the command line.  An error will be printed for each 
79                 ACE specified that was not already present in the object's ACL.
80                 </para></listitem>
81                 </varlistentry>
82                 
83                 
84                 
85                 <varlistentry>
86                 <term>-D|--delete acl</term>
87                 <listitem><para>Delete any ACEs specified on the command line.
88                 An error will be printed for each ACE specified that was not
89                 already present in the object's ACL. </para></listitem>
90                 </varlistentry>
91                 
92                 
93                 
94                 <varlistentry>
95                 <term>-S|--set acl</term>
96                 <listitem><para>This command sets the ACL on the object with
97                 only what is specified on the command line.  Any existing ACL
98                 is erased. Note that the ACL specified must contain at least a revision,
99                 type, owner and group for the call to succeed. </para></listitem>
100                 </varlistentry>
101                 
102                 
103                 
104                 <varlistentry>
105                 <term>-C|--chown name</term>
106                 <listitem><para>The owner of a file or directory can be changed 
107                 to the name given using the <parameter>-C</parameter> option.  
108                 The name can be a sid in the form S-1-x-y-z or a name resolved 
109                 against the server specified in the first argument. </para>
110                 
111                 <para>This command is a shortcut for -M OWNER:name. 
112                 </para></listitem>
113                 </varlistentry>
114                 
115                 
116                 
117                 <varlistentry>
118                 <term>-G|--chgrp name</term>
119                 <listitem><para>The group owner of a file or directory can 
120                 be changed to the name given using the <parameter>-G</parameter> 
121                 option.  The name can be a sid in the form S-1-x-y-z or a name 
122                 resolved against the server specified n the first argument.
123                 </para>
124                 
125                 <para>This command is a shortcut for -M GROUP:name.</para></listitem>
126                 </varlistentry>
127                 
128                 
129                 
130                 <varlistentry>
131                 <term>-I|--inherit allow|remove|copy</term>
132                 <listitem><para>Set or unset the windows "Allow inheritable
133                 permissions" check box using the <parameter>-I</parameter>
134                 option.  To set the check box pass allow. To unset the check
135                 box pass either remove or copy. Remove will remove all
136                 inherited ACEs. Copy will copy all the inherited ACEs.
137                 </para></listitem>
139                 </varlistentry>
141                 <varlistentry>
142                 <term>--propagate-inheritance</term>
143                 <listitem><para>Add, modify, delete or set ACEs on an entire
144                 directory tree according to the inheritance flags. Refer to the
145                 INHERITANCE section for details.
146                 </para></listitem>
147                 </varlistentry>
149                 <varlistentry>
150                 <term>--numeric</term>
151                 <listitem><para>This option displays all ACL information in numeric 
152                 format.  The default is to convert SIDs to names and ACE types 
153                 and masks to a readable string format.  </para></listitem>
154                 </varlistentry>
155                 
156                 <varlistentry>
157                 <term>-m|--max-protocol PROTOCOL_NAME</term>
158                 <listitem><para>This allows the user to select the
159                 highest SMB protocol level that smbcacls will use to
160                 connect to the server. By default this is set to
161                 NT1, which is the highest available SMB1 protocol.
162                 To connect using SMB2 or SMB3 protocol, use the
163                 strings SMB2 or SMB3 respectively. Note that to connect
164                 to a Windows 2012 server with encrypted transport selecting
165                 a max-protocol of SMB3 is required.
166                 </para></listitem>
167                 </varlistentry>
169                 <varlistentry>
170                 <term>-t|--test-args</term>
171                 <listitem><para>
172                 Don't actually do anything, only validate the correctness of 
173                 the arguments.
174                 </para></listitem>
175                 </varlistentry>
177                 <varlistentry>
178                 <term>--query-security-info FLAGS</term>
179                 <listitem><para>The security-info flags for queries.
180                 </para></listitem>
181                 </varlistentry>
183                 <varlistentry>
184                 <term>--set-security-info FLAGS</term>
185                 <listitem><para>The security-info flags for queries.
186                 </para></listitem>
187                 </varlistentry>
189                 <varlistentry>
190                 <term>--sddl</term>
191                 <listitem><para>Output and input acls in sddl format.
192                 </para></listitem>
193                 </varlistentry>
195                 <varlistentry>
196                 <term>--domain-sid SID</term>
197                 <listitem><para>SID used for sddl processing.
198                 </para></listitem>
199                 </varlistentry>
201                 <varlistentry>
202                 <term>-x|--maximum-access</term>
203                 <listitem><para>When displaying an ACL additionally query
204                 the server for effective maximum permissions. Note that this
205                 is only supported with SMB protocol version 2 or higher.
206                 </para></listitem>
207                 </varlistentry>
209                 &stdarg.server.debug;
210                 &popt.common.samba;
211                 &popt.common.credentials;
212                 &popt.common.connection;
213                 &popt.autohelp;
214         </variablelist>
215 </refsect1>
218 <refsect1>
219         <title>ACL FORMAT</title>
221         <para>The format of an ACL is one or more entries separated by
222         either commas or newlines.  An ACL entry is one of the following: </para>
224 <para><programlisting> 
225 REVISION:&lt;revision number&gt;
226 OWNER:&lt;sid or name&gt;
227 GROUP:&lt;sid or name&gt;
228 ACL:&lt;sid or name&gt;:&lt;type&gt;/&lt;flags&gt;/&lt;mask&gt;
229 </programlisting></para>
230   
232         <para>The revision of the ACL specifies the internal Windows 
233         NT ACL revision for the security descriptor.  
234         If not specified it defaults to 1.  Using values other than 1 may 
235         cause strange behaviour. </para>
237         <para>The owner and group specify the owner and group sids for the 
238         object.  If a SID in the format S-1-x-y-z is specified this is used, 
239         otherwise the name specified is resolved using the server on which 
240         the file or directory resides. </para>
242         <para>ACEs are specified with an "ACL:" prefix, and define permissions
243         granted to an SID.  The SID again can be specified in S-1-x-y-z format
244         or as a name in which case it is resolved against the server on which
245         the file or directory resides.  The type, flags and mask values
246         determine the type of access granted to the SID. </para>
248         <para>The type can be either ALLOWED or DENIED to allow/deny access 
249         to the SID.</para>
251         <para>The flags field defines how the ACE should be considered when
252         performing inheritance. <command>smbcacls</command> uses these flags
253         when run with <parameter>--propagate-inheritance</parameter>.</para>
255         <para>Flags can be specified as decimal or hexadecimal values, or with
256         the respective (XX) aliases, separated by a vertical bar "|".</para>
258         <itemizedlist> 
259                 <listitem><para><emphasis>(OI)</emphasis> Object Inherit        0x1</para></listitem>
260                 <listitem><para><emphasis>(CI)</emphasis> Container Inherit     0x2</para></listitem>
261                 <listitem><para><emphasis>(NP)</emphasis> No Propagate Inherit  0x4</para></listitem>
262                 <listitem><para><emphasis>(IO)</emphasis> Inherit Only          0x8</para></listitem>
263         </itemizedlist>
264   
266         <para>The mask is a value which expresses the access right 
267         granted to the SID. It can be given as a decimal or hexadecimal value, 
268         or by using one of the following text strings which map to the NT 
269         file permissions of the same name. </para>
271         <itemizedlist>
272                 <listitem><para><emphasis>R</emphasis> - Allow read access </para></listitem>
273                 <listitem><para><emphasis>W</emphasis> - Allow write access</para></listitem>
274                 <listitem><para><emphasis>X</emphasis> - Execute permission on the object</para></listitem>
275                 <listitem><para><emphasis>D</emphasis> - Delete the object</para></listitem>
276                 <listitem><para><emphasis>P</emphasis> - Change permissions</para></listitem>
277                 <listitem><para><emphasis>O</emphasis> - Take ownership</para></listitem>
278         </itemizedlist>
281         <para>The following combined permissions can be specified:</para>
284         <itemizedlist>
285                 <listitem><para><emphasis>READ</emphasis> -  Equivalent to 'RX'
286                 permissions</para></listitem>
287                 <listitem><para><emphasis>CHANGE</emphasis> - Equivalent to 'RXWD' permissions
288                 </para></listitem>
289                 <listitem><para><emphasis>FULL</emphasis> - Equivalent to 'RWXDPO' 
290                 permissions</para></listitem>
291         </itemizedlist>
292         </refsect1>
294 <refsect1>
295         <title>INHERITANCE</title>
297         <para>Per-ACE inheritance flags can be set in the ACE flags field. By
298         default, inheritable ACEs e.g. those marked for object inheritance (OI)
299         or container inheritance (CI), are not propagated to sub-files or
300         folders. However, with the
301         <parameter>--propagate-inheritance</parameter> argument specified, such
302         ACEs are automatically propagated according to some inheritance
303         rules.
304         <itemizedlist>
305                 <listitem><para>Inheritable (OI)(OI) ACE flags can only be
306                 applied to folders. </para></listitem>
307                 <listitem><para>Any inheritable ACEs applied to sub-files or
308                 folders are marked with the inherited (I) flag. Inheritable
309                 ACE(s) are applied to folders unless the no propagation (NP)
310                 flag is set. </para>
311                 </listitem>
312                 <listitem><para>When an ACE with the (OI) flag alone set is
313                 progagated to a child folder the inheritance only flag (IO) is
314                 also applied. This indicates the permissions associated with
315                 the ACE don't apply to the folder itself (only to it's
316                 child files). When applying the ACE to a child file the ACE is
317                 inherited as normal.</para></listitem>
318                 <listitem><para>When an ace with the (CI) flag alone set is
319                 propagated to a child file there is no effect, when propagated
320                 to a child folder it is inherited as normal.
321                 </para></listitem>
322                 <listitem><para>When an ACE that has both (OI) &amp; (CI) flags
323                 set the ACE is inherited as normal by both folders and
324                 files.</para></listitem>
325         </itemizedlist></para>
326 <para>(OI)(READ) added to parent folder</para>
327 <para><programlisting>
328 +-parent/        (OI)(READ)
329 | +-file.1       (I)(READ)
330 | +-nested/      (OI)(IO)(I)(READ)
331   |   +-file.2   (I)(READ)
332 </programlisting></para>
333 <para>(CI)(READ) added to parent folder</para>
334 <para><programlisting>
335 +-parent/        (CI)(READ)
336 | +-file.1
337 | +-nested/      (CI)(I)(READ)
338   |   +-file.2
339 </programlisting></para>
340 <para>(OI)(CI)(READ) added to parent folder</para>
341 <para><programlisting>
342 +-parent/        (OI)(CI)(READ)
343 | +-file.1       (I)(READ)
344 | +-nested/      (OI)(CI)(I)(READ)
345   |   +-file.2   (I)(READ)
346 </programlisting></para>
347 <para>(OI)(NP)(READ) added to parent folder</para>
348 <para><programlisting>
349 +-oi_dir/        (OI)(NP)(READ)
350 | +-file.1       (I)(READ)
351 | +-nested/
352 |   +-file.2
353 </programlisting></para>
354 <para>(CI)(NP)(READ) added to parent folder</para>
355 <para><programlisting>
356 +-oi_dir/        (CI)(NP)(READ)
357 | +-file.1
358 | +-nested/      (I)(READ)
359 |   +-file.2
360 </programlisting></para>
361 <para>(OI)(CI)(NP)(READ) added to parent folder</para>
362 <para><programlisting>
363 +-parent/        (CI)(OI)(NP)(READ)
364 | +-file.1       (I)(READ)
365 | +-nested/      (I)(READ)
366 |   +-file.2
367 </programlisting></para>
368         <para>Files and folders with protected ACLs do not allow inheritable
369         permissions (set with <parameter>-I</parameter>). Such objects will
370         not receive ACEs flagged for inheritance with (CI) or (OI).</para>
372 </refsect1>
374 <refsect1>
375         <title>EXIT STATUS</title>
377         <para>The <command>smbcacls</command> program sets the exit status 
378         depending on the success or otherwise of the operations performed.  
379         The exit status may be one of the following values. </para>
381         <para>If the operation succeeded, smbcacls returns and exit 
382         status of 0.  If <command>smbcacls</command> couldn't connect to the specified server, 
383         or there was an error getting or setting the ACLs, an exit status 
384         of 1 is returned.  If there was an error parsing any command line 
385         arguments, an exit status of 2 is returned. </para>
386 </refsect1>
388 <refsect1>
389         <title>VERSION</title>
391         <para>This man page is part of version &doc.version; of the Samba suite.</para>
392 </refsect1>
394 <refsect1>
395         <title>AUTHOR</title>
396         
397         <para>The original Samba software and related utilities 
398         were created by Andrew Tridgell. Samba is now developed
399         by the Samba Team as an Open Source project similar 
400         to the way the Linux kernel is developed.</para>
401         
402         <para><command>smbcacls</command> was written by Andrew Tridgell 
403         and Tim Potter.</para>
404         
405         <para>The conversion to DocBook for Samba 2.2 was done 
406         by Gerald Carter. The conversion to DocBook XML 4.2 for Samba 3.0 was done
407         by Alexander Bokovoy.</para>
408 </refsect1>
410 </refentry>