s3/selftest: Move samba3.raw.samba3posixtimedlock to ad_dc_smb1
[Samba.git] / docs-xml / manpages / smbcacls.1.xml
blob7f87da80329c44aaa77af5776db0cb7170531c3e
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">--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>
42         </cmdsynopsis>
43 </refsynopsisdiv>
45 <refsect1>
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
54         user or group.</para>
55 </refsect1>
58 <refsect1>
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>
65         <variablelist>
66                 <varlistentry>
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>
70                 </varlistentry>
71                 
72                 
73                 
74                 <varlistentry>
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.
79                 </para></listitem>
80                 </varlistentry>
81                 
82                 
83                 
84                 <varlistentry>
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>
89                 </varlistentry>
90                 
91                 
92                 
93                 <varlistentry>
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>
99                 </varlistentry>
100                 
101                 
102                 
103                 <varlistentry>
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>
109                 
110                 <para>This command is a shortcut for -M OWNER:name. 
111                 </para></listitem>
112                 </varlistentry>
113                 
114                 
115                 
116                 <varlistentry>
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.
122                 </para>
123                 
124                 <para>This command is a shortcut for -M GROUP:name.</para></listitem>
125                 </varlistentry>
126                 
127                 
128                 
129                 <varlistentry>
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.
136                 </para></listitem>
138                 </varlistentry>
141                 <varlistentry>
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>
146                 </varlistentry>
147                 
148                 <varlistentry>
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.
158                 </para></listitem>
159                 </varlistentry>
161                 <varlistentry>
162                 <term>-t|--test-args</term>
163                 <listitem><para>
164                 Don't actually do anything, only validate the correctness of 
165                 the arguments.
166                 </para></listitem>
167                 </varlistentry>
169                 <varlistentry>
170                 <term>--query-security-info FLAGS</term>
171                 <listitem><para>The security-info flags for queries.
172                 </para></listitem>
173                 </varlistentry>
175                 <varlistentry>
176                 <term>--set-security-info FLAGS</term>
177                 <listitem><para>The security-info flags for queries.
178                 </para></listitem>
179                 </varlistentry>
181                 <varlistentry>
182                 <term>--sddl</term>
183                 <listitem><para>Output and input acls in sddl format.
184                 </para></listitem>
185                 </varlistentry>
187                 <varlistentry>
188                 <term>--domain-sid SID</term>
189                 <listitem><para>SID used for sddl processing.
190                 </para></listitem>
191                 </varlistentry>
193                 <varlistentry>
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.
198                 </para></listitem>
199                 </varlistentry>
201                 &stdarg.server.debug;
202                 &popt.common.samba;
203                 &popt.common.credentials;
204                 &popt.common.connection;
205                 &popt.autohelp;
206         </variablelist>
207 </refsect1>
210 <refsect1>
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:&lt;revision number&gt;
218 OWNER:&lt;sid or name&gt;
219 GROUP:&lt;sid or name&gt;
220 ACL:&lt;sid or name&gt;:&lt;type&gt;/&lt;flags&gt;/&lt;mask&gt;
221 </programlisting></para>
222   
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>
244         <itemizedlist> 
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>
249         </itemizedlist>
250   
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>
259         <itemizedlist>
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>
266         </itemizedlist>
269         <para>The following combined permissions can be specified:</para>
272         <itemizedlist>
273                 <listitem><para><emphasis>READ</emphasis> -  Equivalent to 'RX'
274                 permissions</para></listitem>
275                 <listitem><para><emphasis>CHANGE</emphasis> - Equivalent to 'RXWD' permissions
276                 </para></listitem>
277                 <listitem><para><emphasis>FULL</emphasis> - Equivalent to 'RWXDPO' 
278                 permissions</para></listitem>
279         </itemizedlist>
280         </refsect1>
282 <refsect1>
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>
294 </refsect1>
296 <refsect1>
297         <title>VERSION</title>
299         <para>This man page is part of version &doc.version; of the Samba suite.</para>
300 </refsect1>
302 <refsect1>
303         <title>AUTHOR</title>
304         
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>
309         
310         <para><command>smbcacls</command> was written by Andrew Tridgell 
311         and Tim Potter.</para>
312         
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>
316 </refsect1>
318 </refentry>