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">
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>
15 <refname>smbcacls</refname>
16 <refpurpose>Set or get ACLs on an NT file or directory names</refpurpose>
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>
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
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>
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>
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.
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>
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>
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>
111 <para>This command is a shortcut for -M OWNER:name.
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.
125 <para>This command is a shortcut for -M GROUP:name.</para></listitem>
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.
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.
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>
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.
170 <term>-t|--test-args</term>
172 Don't actually do anything, only validate the correctness of
178 <term>--query-security-info FLAGS</term>
179 <listitem><para>The security-info flags for queries.
184 <term>--set-security-info FLAGS</term>
185 <listitem><para>The security-info flags for queries.
191 <listitem><para>Output and input acls in sddl format.
196 <term>--domain-sid SID</term>
197 <listitem><para>SID used for sddl processing.
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.
209 &stdarg.server.debug;
211 &popt.common.credentials;
212 &popt.common.connection;
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:<revision number>
226 OWNER:<sid or name>
227 GROUP:<sid or name>
228 ACL:<sid or name>:<type>/<flags>/<mask>
229 </programlisting></para>
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
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>
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>
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>
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>
281 <para>The following combined permissions can be specified:</para>
285 <listitem><para><emphasis>READ</emphasis> - Equivalent to 'RX'
286 permissions</para></listitem>
287 <listitem><para><emphasis>CHANGE</emphasis> - Equivalent to 'RXWD' permissions
289 <listitem><para><emphasis>FULL</emphasis> - Equivalent to 'RWXDPO'
290 permissions</para></listitem>
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
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)
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.
322 <listitem><para>When an ACE that has both (OI) & (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>
330 | +-nested/ (OI)(IO)(I)(READ)
332 </programlisting></para>
333 <para>(CI)(READ) added to parent folder</para>
334 <para><programlisting>
337 | +-nested/ (CI)(I)(READ)
339 </programlisting></para>
340 <para>(OI)(CI)(READ) added to parent folder</para>
341 <para><programlisting>
342 +-parent/ (OI)(CI)(READ)
344 | +-nested/ (OI)(CI)(I)(READ)
346 </programlisting></para>
347 <para>(OI)(NP)(READ) added to parent folder</para>
348 <para><programlisting>
349 +-oi_dir/ (OI)(NP)(READ)
353 </programlisting></para>
354 <para>(CI)(NP)(READ) added to parent folder</para>
355 <para><programlisting>
356 +-oi_dir/ (CI)(NP)(READ)
358 | +-nested/ (I)(READ)
360 </programlisting></para>
361 <para>(OI)(CI)(NP)(READ) added to parent folder</para>
362 <para><programlisting>
363 +-parent/ (CI)(OI)(NP)(READ)
365 | +-nested/ (I)(READ)
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>
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>
389 <title>VERSION</title>
391 <para>This man page is part of version &doc.version; of the Samba suite.</para>
395 <title>AUTHOR</title>
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>
402 <para><command>smbcacls</command> was written by Andrew Tridgell
403 and Tim Potter.</para>
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>