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>
25 <arg choice="opt">-D|--delete=ACL</arg>
26 <arg choice="opt">-M|--modify=ACL</arg>
27 <arg choice="opt">-a|--add=ACL</arg>
28 <arg choice="opt">-S|--set=ACLS</arg>
29 <arg choice="opt">-C|--chown=USERNAME</arg>
30 <arg choice="opt">-G|--chgrp=GROUPNAME</arg>
31 <arg choice="opt">-I|--inherit=STRING</arg>
32 <arg choice="opt">--propagate-inheritance</arg>
33 <arg choice="opt">--numeric</arg>
34 <arg choice="opt">--sddl</arg>
35 <arg choice="opt">--query-security-info=INT</arg>
36 <arg choice="opt">--set-security-info=INT</arg>
37 <arg choice="opt">-t|--test-args</arg>
38 <arg choice="opt">--domain-sid=SID</arg>
39 <arg choice="opt">-x|--maximum-access</arg>
40 <arg choice="opt">-?|--help</arg>
41 <arg choice="opt">--usage</arg>
42 <arg choice="opt">-d|--debuglevel=DEBUGLEVEL</arg>
43 <arg choice="opt">--debug-stdout</arg>
44 <arg choice="opt">--configfile=CONFIGFILE</arg>
45 <arg choice="opt">--option=name=value</arg>
46 <arg choice="opt">-l|--log-basename=LOGFILEBASE</arg>
47 <arg choice="opt">--leak-report</arg>
48 <arg choice="opt">--leak-report-full</arg>
49 <arg choice="opt">-R|--name-resolve=NAME-RESOLVE-ORDER</arg>
50 <arg choice="opt">-O|--socket-options=SOCKETOPTIONS</arg>
51 <arg choice="opt">-m|--max-protocol=MAXPROTOCOL</arg>
52 <arg choice="opt">-n|--netbiosname=NETBIOSNAME</arg>
53 <arg choice="opt">--netbios-scope=SCOPE</arg>
54 <arg choice="opt">-W|--workgroup=WORKGROUP</arg>
55 <arg choice="opt">--realm=REALM</arg>
56 <arg choice="opt">-U|--user=[DOMAIN/]USERNAME[%PASSWORD]</arg>
57 <arg choice="opt">-N|--no-pass</arg>
58 <arg choice="opt">--password=STRING</arg>
59 <arg choice="opt">--pw-nt-hash</arg>
60 <arg choice="opt">-A|--authentication-file=FILE</arg>
61 <arg choice="opt">-P|--machine-pass</arg>
62 <arg choice="opt">--simple-bind-dn=DN</arg>
63 <arg choice="opt">--use-kerberos=desired|required|off</arg>
64 <arg choice="opt">--use-krb5-ccache=CCACHE</arg>
65 <arg choice="opt">--use-winbind-ccache</arg>
66 <arg choice="opt">--client-protection=sign|encrypt|off</arg>
67 <arg choice="opt">-V|--version</arg>
72 <title>DESCRIPTION</title>
74 <para>This tool is part of the <citerefentry><refentrytitle>samba</refentrytitle>
75 <manvolnum>7</manvolnum></citerefentry> suite.</para>
77 <para>The <command>smbcacls</command> program manipulates NT Access Control
78 Lists (ACLs) on SMB file shares. An ACL is comprised zero or more Access
79 Control Entries (ACEs), which define access restrictions for a specific
85 <title>OPTIONS</title>
87 <para>The following options are available to the <command>smbcacls</command> program.
88 The format of ACLs is described in the section ACL FORMAT </para>
93 <term>-a|--add acl</term>
94 <listitem><para>Add the entries specified to the ACL. Existing
95 access control entries are unchanged.</para></listitem>
101 <term>-M|--modify acl</term>
102 <listitem><para>Modify the mask value (permissions) for the ACEs
103 specified on the command line. An error will be printed for each
104 ACE specified that was not already present in the object's ACL.
111 <term>-D|--delete acl</term>
112 <listitem><para>Delete any ACEs specified on the command line.
113 An error will be printed for each ACE specified that was not
114 already present in the object's ACL. </para></listitem>
120 <term>-S|--set acl</term>
121 <listitem><para>This command sets the ACL on the object with
122 only what is specified on the command line. Any existing ACL
123 is erased. Note that the ACL specified must contain at least a revision,
124 type, owner and group for the call to succeed. </para></listitem>
130 <term>-C|--chown name</term>
131 <listitem><para>The owner of a file or directory can be changed
132 to the name given using the <parameter>-C</parameter> option.
133 The name can be a sid in the form S-1-x-y-z or a name resolved
134 against the server specified in the first argument. </para>
136 <para>This command is a shortcut for -M OWNER:name.
143 <term>-G|--chgrp name</term>
144 <listitem><para>The group owner of a file or directory can
145 be changed to the name given using the <parameter>-G</parameter>
146 option. The name can be a sid in the form S-1-x-y-z or a name
147 resolved against the server specified n the first argument.
150 <para>This command is a shortcut for -M GROUP:name.</para></listitem>
156 <term>-I|--inherit allow|remove|copy</term>
157 <listitem><para>Set or unset the windows "Allow inheritable
158 permissions" check box using the <parameter>-I</parameter>
159 option. To set the check box pass allow. To unset the check
160 box pass either remove or copy. Remove will remove all
161 inherited ACEs. Copy will copy all the inherited ACEs.
167 <term>--propagate-inheritance</term>
168 <listitem><para>Add, modify, delete or set ACEs on an entire
169 directory tree according to the inheritance flags. Refer to the
170 INHERITANCE section for details.
175 <term>--numeric</term>
176 <listitem><para>This option displays all ACL information in numeric
177 format. The default is to convert SIDs to names and ACE types
178 and masks to a readable string format. </para></listitem>
182 <term>-m|--max-protocol PROTOCOL_NAME</term>
183 <listitem><para>This allows the user to select the
184 highest SMB protocol level that smbcacls will use to
185 connect to the server. By default this is set to
186 NT1, which is the highest available SMB1 protocol.
187 To connect using SMB2 or SMB3 protocol, use the
188 strings SMB2 or SMB3 respectively. Note that to connect
189 to a Windows 2012 server with encrypted transport selecting
190 a max-protocol of SMB3 is required.
195 <term>-t|--test-args</term>
197 Don't actually do anything, only validate the correctness of
203 <term>--query-security-info FLAGS</term>
204 <listitem><para>The security-info flags for queries.
209 <term>--set-security-info FLAGS</term>
210 <listitem><para>The security-info flags for queries.
216 <listitem><para>Output and input acls in sddl format.
221 <term>--domain-sid SID</term>
222 <listitem><para>SID used for sddl processing.
227 <term>-x|--maximum-access</term>
228 <listitem><para>When displaying an ACL additionally query
229 the server for effective maximum permissions. Note that this
230 is only supported with SMB protocol version 2 or higher.
235 &cmdline.common.samba.client;
236 &cmdline.common.connection;
237 &cmdline.common.credentials;
243 <title>ACL FORMAT</title>
245 <para>The format of an ACL is one or more entries separated by
246 either commas or newlines. An ACL entry is one of the following: </para>
248 <para><programlisting>
249 REVISION:<revision number>
250 OWNER:<sid or name>
251 GROUP:<sid or name>
252 ACL:<sid or name>:<type>/<flags>/<mask>
253 </programlisting></para>
255 <para>Control bits related to automatic inheritance</para>
259 <listitem><para><emphasis>OD</emphasis> - "Owner Defaulted" - Indicates that the SID of the owner of the security descriptor was provided by a default mechanism.</para></listitem>
260 <listitem><para><emphasis>GD</emphasis> - "Group Defaulted" - Indicates that the SID of the security descriptor group was provided by a default mechanism.</para></listitem>
261 <listitem><para><emphasis>DP</emphasis> - "DACL Present" - Indicates a security descriptor that has a discretionary access control list (DACL).</para></listitem>
262 <listitem><para><emphasis>DD</emphasis> - "DACL Defaulted" - Indicates a security descriptor with a default DACL.</para></listitem>
263 <listitem><para><emphasis>SP</emphasis> - "SACL Present" - Indicates a security descriptor that has a system access control list (SACL).</para></listitem>
264 <listitem><para><emphasis>SD</emphasis> - "SACL Defaulted" - A default mechanism, rather than the original provider of the security descriptor, provided the SACL.</para></listitem>
265 <listitem><para><emphasis>DT</emphasis> - "DACL Trusted"</para></listitem>
266 <listitem><para><emphasis>SS</emphasis> - "Server Security"</para></listitem>
267 <listitem><para><emphasis>DR</emphasis> - "DACL Inheritance Required" - Indicates a required security descriptor in which the DACL is set up to support automatic propagation of inheritable access control entries (ACEs) to existing child objects.</para></listitem>
268 <listitem><para><emphasis>SR</emphasis> - "SACL Inheritance Required" - Indicates a required security descriptor in which the SACL is set up to support automatic propagation of inheritable ACEs to existing child objects.</para></listitem>
269 <listitem><para><emphasis>DI</emphasis> - "DACL Auto Inherited" - Indicates a security descriptor in which the DACL is set up to support automatic propagation of inheritable access control entries (ACEs) to existing child objects.</para></listitem>
270 <listitem><para><emphasis>SI</emphasis> - "SACL Auto Inherited" - Indicates a security descriptor in which the SACL is set up to support automatic propagation of inheritable ACEs to existing child objects.</para></listitem>
271 <listitem><para><emphasis>PD</emphasis> - "DACL Protected" - Prevents the DACL of the security descriptor from being modified by inheritable ACEs.</para></listitem>
272 <listitem><para><emphasis>PS</emphasis> - "SACL Protected" - Prevents the SACL of the security descriptor from being modified by inheritable ACEs.</para></listitem>
273 <listitem><para><emphasis>RM</emphasis> - "RM Control Valid" - Indicates that the resource manager control is valid.</para></listitem>
274 <listitem><para><emphasis>SR</emphasis> - "Self Relative" - Indicates a self-relative security descriptor.</para></listitem>
277 <para>The revision of the ACL specifies the internal Windows
278 NT ACL revision for the security descriptor.
279 If not specified it defaults to 1. Using values other than 1 may
280 cause strange behaviour. </para>
282 <para>The owner and group specify the owner and group sids for the
283 object. If a SID in the format S-1-x-y-z is specified this is used,
284 otherwise the name specified is resolved using the server on which
285 the file or directory resides. </para>
287 <para>ACEs are specified with an "ACL:" prefix, and define permissions
288 granted to an SID. The SID again can be specified in S-1-x-y-z format
289 or as a name in which case it is resolved against the server on which
290 the file or directory resides. The type, flags and mask values
291 determine the type of access granted to the SID. </para>
293 <para>The type can be either ALLOWED or DENIED to allow/deny access
296 <para>The flags field defines how the ACE should be considered when
297 performing inheritance. <command>smbcacls</command> uses these flags
298 when run with <parameter>--propagate-inheritance</parameter>.</para>
300 <para>Flags can be specified as decimal or hexadecimal values, or with
301 the respective (XX) aliases, separated by a vertical bar "|".</para>
304 <listitem><para><emphasis>(OI)</emphasis> Object Inherit 0x1</para></listitem>
305 <listitem><para><emphasis>(CI)</emphasis> Container Inherit 0x2</para></listitem>
306 <listitem><para><emphasis>(NP)</emphasis> No Propagate Inherit 0x4</para></listitem>
307 <listitem><para><emphasis>(IO)</emphasis> Inherit Only 0x8</para></listitem>
308 <listitem><para><emphasis>(I)</emphasis> ACE was inherited 0x10</para></listitem>
312 <para>The mask is a value which expresses the access right
313 granted to the SID. It can be given as a decimal or hexadecimal value,
314 or by using one of the following text strings which map to the NT
315 file permissions of the same name. </para>
318 <listitem><para><emphasis>R</emphasis> - Allow read access </para></listitem>
319 <listitem><para><emphasis>W</emphasis> - Allow write access</para></listitem>
320 <listitem><para><emphasis>X</emphasis> - Execute permission on the object</para></listitem>
321 <listitem><para><emphasis>D</emphasis> - Delete the object</para></listitem>
322 <listitem><para><emphasis>P</emphasis> - Change permissions</para></listitem>
323 <listitem><para><emphasis>O</emphasis> - Take ownership</para></listitem>
327 <para>The following combined permissions can be specified:</para>
331 <listitem><para><emphasis>READ</emphasis> - Equivalent to 'RX'
332 permissions</para></listitem>
333 <listitem><para><emphasis>CHANGE</emphasis> - Equivalent to 'RXWD' permissions
335 <listitem><para><emphasis>FULL</emphasis> - Equivalent to 'RWXDPO'
336 permissions</para></listitem>
341 <title>INHERITANCE</title>
343 <para>Per-ACE inheritance flags can be set in the ACE flags field. By
344 default, inheritable ACEs e.g. those marked for object inheritance (OI)
345 or container inheritance (CI), are not propagated to sub-files or
346 folders. However, with the
347 <parameter>--propagate-inheritance</parameter> argument specified, such
348 ACEs are automatically propagated according to some inheritance
351 <listitem><para>Inheritable (OI)(OI) ACE flags can only be
352 applied to folders. </para></listitem>
353 <listitem><para>Any inheritable ACEs applied to sub-files or
354 folders are marked with the inherited (I) flag. Inheritable
355 ACE(s) are applied to folders unless the no propagation (NP)
358 <listitem><para>When an ACE with the (OI) flag alone set is
359 progagated to a child folder the inheritance only flag (IO) is
360 also applied. This indicates the permissions associated with
361 the ACE don't apply to the folder itself (only to it's
362 child files). When applying the ACE to a child file the ACE is
363 inherited as normal.</para></listitem>
364 <listitem><para>When an ace with the (CI) flag alone set is
365 propagated to a child file there is no effect, when propagated
366 to a child folder it is inherited as normal.
368 <listitem><para>When an ACE that has both (OI) & (CI) flags
369 set the ACE is inherited as normal by both folders and
370 files.</para></listitem>
371 </itemizedlist></para>
372 <para>(OI)(READ) added to parent folder</para>
373 <para><programlisting>
376 | +-nested/ (OI)(IO)(I)(READ)
378 </programlisting></para>
379 <para>(CI)(READ) added to parent folder</para>
380 <para><programlisting>
383 | +-nested/ (CI)(I)(READ)
385 </programlisting></para>
386 <para>(OI)(CI)(READ) added to parent folder</para>
387 <para><programlisting>
388 +-parent/ (OI)(CI)(READ)
390 | +-nested/ (OI)(CI)(I)(READ)
392 </programlisting></para>
393 <para>(OI)(NP)(READ) added to parent folder</para>
394 <para><programlisting>
395 +-oi_dir/ (OI)(NP)(READ)
399 </programlisting></para>
400 <para>(CI)(NP)(READ) added to parent folder</para>
401 <para><programlisting>
402 +-oi_dir/ (CI)(NP)(READ)
404 | +-nested/ (I)(READ)
406 </programlisting></para>
407 <para>(OI)(CI)(NP)(READ) added to parent folder</para>
408 <para><programlisting>
409 +-parent/ (CI)(OI)(NP)(READ)
411 | +-nested/ (I)(READ)
413 </programlisting></para>
414 <para>Files and folders with protected ACLs do not allow inheritable
415 permissions (set with <parameter>-I</parameter>). Such objects will
416 not receive ACEs flagged for inheritance with (CI) or (OI).</para>
421 <title>EXIT STATUS</title>
423 <para>The <command>smbcacls</command> program sets the exit status
424 depending on the success or otherwise of the operations performed.
425 The exit status may be one of the following values. </para>
427 <para>If the operation succeeded, smbcacls returns and exit
428 status of 0. If <command>smbcacls</command> couldn't connect to the specified server,
429 or there was an error getting or setting the ACLs, an exit status
430 of 1 is returned. If there was an error parsing any command line
431 arguments, an exit status of 2 is returned. </para>
435 <title>VERSION</title>
437 <para>This man page is part of version &doc.version; of the Samba suite.</para>
441 <title>AUTHOR</title>
443 <para>The original Samba software and related utilities
444 were created by Andrew Tridgell. Samba is now developed
445 by the Samba Team as an Open Source project similar
446 to the way the Linux kernel is developed.</para>
448 <para><command>smbcacls</command> was written by Andrew Tridgell
449 and Tim Potter.</para>
451 <para>The conversion to DocBook for Samba 2.2 was done
452 by Gerald Carter. The conversion to DocBook XML 4.2 for Samba 3.0 was done
453 by Alexander Bokovoy.</para>