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">--numeric</arg>
32 <arg choice="opt">-t</arg>
33 <arg choice="opt">-U username</arg>
34 <arg choice="opt">-d</arg>
35 <arg choice="opt">-e</arg>
36 <arg choice="opt">-m|--max-protocol LEVEL</arg>
37 <arg choice="opt">--query-security-info FLAGS</arg>
38 <arg choice="opt">--set-security-info FLAGS</arg>
39 <arg choice="opt">--sddl</arg>
40 <arg choice="opt">--domain-sid SID</arg>
41 <arg choice="opt">-x|--maximum-access</arg>
46 <title>DESCRIPTION</title>
48 <para>This tool is part of the <citerefentry><refentrytitle>samba</refentrytitle>
49 <manvolnum>7</manvolnum></citerefentry> suite.</para>
51 <para>The <command>smbcacls</command> program manipulates NT Access Control
52 Lists (ACLs) on SMB file shares. An ACL is comprised zero or more Access
53 Control Entries (ACEs), which define access restrictions for a specific
59 <title>OPTIONS</title>
61 <para>The following options are available to the <command>smbcacls</command> program.
62 The format of ACLs is described in the section ACL FORMAT </para>
67 <term>-a|--add acl</term>
68 <listitem><para>Add the entries specified to the ACL. Existing
69 access control entries are unchanged.</para></listitem>
75 <term>-M|--modify acl</term>
76 <listitem><para>Modify the mask value (permissions) for the ACEs
77 specified on the command line. An error will be printed for each
78 ACE specified that was not already present in the object's ACL.
85 <term>-D|--delete acl</term>
86 <listitem><para>Delete any ACEs specified on the command line.
87 An error will be printed for each ACE specified that was not
88 already present in the object's ACL. </para></listitem>
94 <term>-S|--set acl</term>
95 <listitem><para>This command sets the ACL on the object with
96 only what is specified on the command line. Any existing ACL
97 is erased. Note that the ACL specified must contain at least a revision,
98 type, owner and group for the call to succeed. </para></listitem>
104 <term>-C|--chown name</term>
105 <listitem><para>The owner of a file or directory can be changed
106 to the name given using the <parameter>-C</parameter> option.
107 The name can be a sid in the form S-1-x-y-z or a name resolved
108 against the server specified in the first argument. </para>
110 <para>This command is a shortcut for -M OWNER:name.
117 <term>-G|--chgrp name</term>
118 <listitem><para>The group owner of a file or directory can
119 be changed to the name given using the <parameter>-G</parameter>
120 option. The name can be a sid in the form S-1-x-y-z or a name
121 resolved against the server specified n the first argument.
124 <para>This command is a shortcut for -M GROUP:name.</para></listitem>
130 <term>-I|--inherit allow|remove|copy</term>
131 <listitem><para>Set or unset the windows "Allow inheritable
132 permissions" check box using the <parameter>-I</parameter>
133 option. To set the check box pass allow. To unset the check
134 box pass either remove or copy. Remove will remove all
135 inherited acls. Copy will copy all the inherited acls.
142 <term>--numeric</term>
143 <listitem><para>This option displays all ACL information in numeric
144 format. The default is to convert SIDs to names and ACE types
145 and masks to a readable string format. </para></listitem>
149 <term>-m|--max-protocol PROTOCOL_NAME</term>
150 <listitem><para>This allows the user to select the
151 highest SMB protocol level that smbcacls will use to
152 connect to the server. By default this is set to
153 NT1, which is the highest available SMB1 protocol.
154 To connect using SMB2 or SMB3 protocol, use the
155 strings SMB2 or SMB3 respectively. Note that to connect
156 to a Windows 2012 server with encrypted transport selecting
157 a max-protocol of SMB3 is required.
162 <term>-t|--test-args</term>
164 Don't actually do anything, only validate the correctness of
170 <term>--query-security-info FLAGS</term>
171 <listitem><para>The security-info flags for queries.
176 <term>--set-security-info FLAGS</term>
177 <listitem><para>The security-info flags for queries.
183 <listitem><para>Output and input acls in sddl format.
188 <term>--domain-sid SID</term>
189 <listitem><para>SID used for sddl processing.
194 <term>-x|--maximum-access</term>
195 <listitem><para>When displaying an ACL additionally query
196 the server for effective maximum permissions. Note that this
197 is only supported with SMB protocol version 2 or higher.
201 &stdarg.server.debug;
203 &popt.common.credentials;
204 &popt.common.connection;
211 <title>ACL FORMAT</title>
213 <para>The format of an ACL is one or more entries separated by
214 either commas or newlines. An ACL entry is one of the following: </para>
216 <para><programlisting>
217 REVISION:<revision number>
218 OWNER:<sid or name>
219 GROUP:<sid or name>
220 ACL:<sid or name>:<type>/<flags>/<mask>
221 </programlisting></para>
224 <para>The revision of the ACL specifies the internal Windows
225 NT ACL revision for the security descriptor.
226 If not specified it defaults to 1. Using values other than 1 may
227 cause strange behaviour. </para>
229 <para>The owner and group specify the owner and group sids for the
230 object. If a SID in the format S-1-x-y-z is specified this is used,
231 otherwise the name specified is resolved using the server on which
232 the file or directory resides. </para>
234 <para>ACEs are specified with an "ACL:" prefix, and define permissions
235 granted to an SID. The SID again can be specified in S-1-x-y-z format
236 or as a name in which case it is resolved against the server on which
237 the file or directory resides. The type, flags and mask values
238 determine the type of access granted to the SID. </para>
240 <para>The type can be either ALLOWED or DENIED to allow/deny access
241 to the SID. The flags values are generally zero for file ACEs and
242 either 9 or 2 for directory ACEs. Some common flags are: </para>
245 <listitem><para><constant>#define SEC_ACE_FLAG_OBJECT_INHERIT 0x1</constant></para></listitem>
246 <listitem><para><constant>#define SEC_ACE_FLAG_CONTAINER_INHERIT 0x2</constant></para></listitem>
247 <listitem><para><constant>#define SEC_ACE_FLAG_NO_PROPAGATE_INHERIT 0x4</constant></para></listitem>
248 <listitem><para><constant>#define SEC_ACE_FLAG_INHERIT_ONLY 0x8</constant></para></listitem>
251 <para>At present, flags can only be specified as decimal or
252 hexadecimal values.</para>
254 <para>The mask is a value which expresses the access right
255 granted to the SID. It can be given as a decimal or hexadecimal value,
256 or by using one of the following text strings which map to the NT
257 file permissions of the same name. </para>
260 <listitem><para><emphasis>R</emphasis> - Allow read access </para></listitem>
261 <listitem><para><emphasis>W</emphasis> - Allow write access</para></listitem>
262 <listitem><para><emphasis>X</emphasis> - Execute permission on the object</para></listitem>
263 <listitem><para><emphasis>D</emphasis> - Delete the object</para></listitem>
264 <listitem><para><emphasis>P</emphasis> - Change permissions</para></listitem>
265 <listitem><para><emphasis>O</emphasis> - Take ownership</para></listitem>
269 <para>The following combined permissions can be specified:</para>
273 <listitem><para><emphasis>READ</emphasis> - Equivalent to 'RX'
274 permissions</para></listitem>
275 <listitem><para><emphasis>CHANGE</emphasis> - Equivalent to 'RXWD' permissions
277 <listitem><para><emphasis>FULL</emphasis> - Equivalent to 'RWXDPO'
278 permissions</para></listitem>
283 <title>EXIT STATUS</title>
285 <para>The <command>smbcacls</command> program sets the exit status
286 depending on the success or otherwise of the operations performed.
287 The exit status may be one of the following values. </para>
289 <para>If the operation succeeded, smbcacls returns and exit
290 status of 0. If <command>smbcacls</command> couldn't connect to the specified server,
291 or there was an error getting or setting the ACLs, an exit status
292 of 1 is returned. If there was an error parsing any command line
293 arguments, an exit status of 2 is returned. </para>
297 <title>VERSION</title>
299 <para>This man page is part of version &doc.version; of the Samba suite.</para>
303 <title>AUTHOR</title>
305 <para>The original Samba software and related utilities
306 were created by Andrew Tridgell. Samba is now developed
307 by the Samba Team as an Open Source project similar
308 to the way the Linux kernel is developed.</para>
310 <para><command>smbcacls</command> was written by Andrew Tridgell
311 and Tim Potter.</para>
313 <para>The conversion to DocBook for Samba 2.2 was done
314 by Gerald Carter. The conversion to DocBook XML 4.2 for Samba 3.0 was done
315 by Alexander Bokovoy.</para>