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">4.1</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">-h</arg>
35 <arg choice="opt">-d</arg>
36 <arg choice="opt">-e</arg>
37 <arg choice="opt">-m|--max-protocol LEVEL</arg>
42 <title>DESCRIPTION</title>
44 <para>This tool is part of the <citerefentry><refentrytitle>samba</refentrytitle>
45 <manvolnum>7</manvolnum></citerefentry> suite.</para>
47 <para>The <command>smbcacls</command> program manipulates NT Access Control
48 Lists (ACLs) on SMB file shares. An ACL is comprised zero or more Access
49 Control Entries (ACEs), which define access restrictions for a specific
55 <title>OPTIONS</title>
57 <para>The following options are available to the <command>smbcacls</command> program.
58 The format of ACLs is described in the section ACL FORMAT </para>
63 <term>-a|--add acl</term>
64 <listitem><para>Add the entries specified to the ACL. Existing
65 access control entries are unchanged.</para></listitem>
71 <term>-M|--modify acl</term>
72 <listitem><para>Modify the mask value (permissions) for the ACEs
73 specified on the command line. An error will be printed for each
74 ACE specified that was not already present in the object's ACL.
81 <term>-D|--delete acl</term>
82 <listitem><para>Delete any ACEs specified on the command line.
83 An error will be printed for each ACE specified that was not
84 already present in the object's ACL. </para></listitem>
90 <term>-S|--set acl</term>
91 <listitem><para>This command sets the ACL on the object with
92 only what is specified on the command line. Any existing ACL
93 is erased. Note that the ACL specified must contain at least a revision,
94 type, owner and group for the call to succeed. </para></listitem>
100 <term>-C|--chown name</term>
101 <listitem><para>The owner of a file or directory can be changed
102 to the name given using the <parameter>-C</parameter> option.
103 The name can be a sid in the form S-1-x-y-z or a name resolved
104 against the server specified in the first argument. </para>
106 <para>This command is a shortcut for -M OWNER:name.
113 <term>-G|--chgrp name</term>
114 <listitem><para>The group owner of a file or directory can
115 be changed to the name given using the <parameter>-G</parameter>
116 option. The name can be a sid in the form S-1-x-y-z or a name
117 resolved against the server specified n the first argument.
120 <para>This command is a shortcut for -M GROUP:name.</para></listitem>
126 <term>-I|--inherit allow|remove|copy</term>
127 <listitem><para>Set or unset the windows "Allow inheritable
128 permissions" check box using the <parameter>-I</parameter>
129 option. To set the check box pass allow. To unset the check
130 box pass either remove or copy. Remove will remove all
131 inherited acls. Copy will copy all the inherited acls.
138 <term>--numeric</term>
139 <listitem><para>This option displays all ACL information in numeric
140 format. The default is to convert SIDs to names and ACE types
141 and masks to a readable string format. </para></listitem>
146 <listitem><para>This command line parameter requires the remote
147 server support the UNIX extensions or that the SMB3 protocol has been selected.
148 Requests that the connection be encrypted. Negotiates SMB encryption using either
149 SMB3 or POSIX extensions via GSSAPI. Uses the given credentials for
150 the encryption negotiation (either kerberos or NTLMv1/v2 if given
151 domain/username/password triple. Fails the connection if encryption
152 cannot be negotiated.
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 &stdarg.server.debug;
180 &popt.common.credentials;
186 <title>ACL FORMAT</title>
188 <para>The format of an ACL is one or more entries separated by
189 either commas or newlines. An ACL entry is one of the following: </para>
191 <para><programlisting>
192 REVISION:<revision number>
193 OWNER:<sid or name>
194 GROUP:<sid or name>
195 ACL:<sid or name>:<type>/<flags>/<mask>
196 </programlisting></para>
199 <para>The revision of the ACL specifies the internal Windows
200 NT ACL revision for the security descriptor.
201 If not specified it defaults to 1. Using values other than 1 may
202 cause strange behaviour. </para>
204 <para>The owner and group specify the owner and group sids for the
205 object. If a SID in the format S-1-x-y-z is specified this is used,
206 otherwise the name specified is resolved using the server on which
207 the file or directory resides. </para>
209 <para>ACEs are specified with an "ACL:" prefix, and define permissions
210 granted to an SID. The SID again can be specified in S-1-x-y-z format
211 or as a name in which case it is resolved against the server on which
212 the file or directory resides. The type, flags and mask values
213 determine the type of access granted to the SID. </para>
215 <para>The type can be either ALLOWED or DENIED to allow/deny access
216 to the SID. The flags values are generally zero for file ACEs and
217 either 9 or 2 for directory ACEs. Some common flags are: </para>
220 <listitem><para><constant>#define SEC_ACE_FLAG_OBJECT_INHERIT 0x1</constant></para></listitem>
221 <listitem><para><constant>#define SEC_ACE_FLAG_CONTAINER_INHERIT 0x2</constant></para></listitem>
222 <listitem><para><constant>#define SEC_ACE_FLAG_NO_PROPAGATE_INHERIT 0x4</constant></para></listitem>
223 <listitem><para><constant>#define SEC_ACE_FLAG_INHERIT_ONLY 0x8</constant></para></listitem>
226 <para>At present, flags can only be specified as decimal or
227 hexadecimal values.</para>
229 <para>The mask is a value which expresses the access right
230 granted to the SID. It can be given as a decimal or hexadecimal value,
231 or by using one of the following text strings which map to the NT
232 file permissions of the same name. </para>
235 <listitem><para><emphasis>R</emphasis> - Allow read access </para></listitem>
236 <listitem><para><emphasis>W</emphasis> - Allow write access</para></listitem>
237 <listitem><para><emphasis>X</emphasis> - Execute permission on the object</para></listitem>
238 <listitem><para><emphasis>D</emphasis> - Delete the object</para></listitem>
239 <listitem><para><emphasis>P</emphasis> - Change permissions</para></listitem>
240 <listitem><para><emphasis>O</emphasis> - Take ownership</para></listitem>
244 <para>The following combined permissions can be specified:</para>
248 <listitem><para><emphasis>READ</emphasis> - Equivalent to 'RX'
249 permissions</para></listitem>
250 <listitem><para><emphasis>CHANGE</emphasis> - Equivalent to 'RXWD' permissions
252 <listitem><para><emphasis>FULL</emphasis> - Equivalent to 'RWXDPO'
253 permissions</para></listitem>
258 <title>EXIT STATUS</title>
260 <para>The <command>smbcacls</command> program sets the exit status
261 depending on the success or otherwise of the operations performed.
262 The exit status may be one of the following values. </para>
264 <para>If the operation succeeded, smbcacls returns and exit
265 status of 0. If <command>smbcacls</command> couldn't connect to the specified server,
266 or there was an error getting or setting the ACLs, an exit status
267 of 1 is returned. If there was an error parsing any command line
268 arguments, an exit status of 2 is returned. </para>
272 <title>VERSION</title>
274 <para>This man page is correct for version 4 of the Samba suite.</para>
278 <title>AUTHOR</title>
280 <para>The original Samba software and related utilities
281 were created by Andrew Tridgell. Samba is now developed
282 by the Samba Team as an Open Source project similar
283 to the way the Linux kernel is developed.</para>
285 <para><command>smbcacls</command> was written by Andrew Tridgell
286 and Tim Potter.</para>
288 <para>The conversion to DocBook for Samba 2.2 was done
289 by Gerald Carter. The conversion to DocBook XML 4.2 for Samba 3.0 was done
290 by Alexander Bokovoy.</para>