71e3f503123b9461459d11816703ac6cb1507a32
[metze/samba/wip.git] / docs-xml / manpages / smbcacls.1.xml
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">
4
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">4.1</refmiscinfo>
11 </refmeta>
12
13
14 <refnamediv>
15         <refname>smbcacls</refname>
16         <refpurpose>Set or get ACLs on an NT file or directory names</refpurpose>
17 </refnamediv>
18
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         </cmdsynopsis>
38 </refsynopsisdiv>
39
40 <refsect1>
41         <title>DESCRIPTION</title>
42
43         <para>This tool is part of the <citerefentry><refentrytitle>samba</refentrytitle>
44         <manvolnum>7</manvolnum></citerefentry> suite.</para>
45
46         <para>The <command>smbcacls</command> program manipulates NT Access Control
47         Lists (ACLs) on SMB file shares. An ACL is comprised zero or more Access
48         Control Entries (ACEs), which define access restrictions for a specific
49         user or group.</para>
50 </refsect1>
51
52
53 <refsect1>
54         <title>OPTIONS</title>
55
56         <para>The following options are available to the <command>smbcacls</command> program.  
57         The format of ACLs is described in the section ACL FORMAT </para>
58
59
60         <variablelist>
61                 <varlistentry>
62                 <term>-a|--add acl</term>
63                 <listitem><para>Add the entries specified to the ACL.  Existing
64                 access control entries are unchanged.</para></listitem>
65                 </varlistentry>
66                 
67                 
68                 
69                 <varlistentry>
70                 <term>-M|--modify acl</term>
71                 <listitem><para>Modify the mask value (permissions) for the ACEs
72                 specified on the command line.  An error will be printed for each 
73                 ACE specified that was not already present in the object's ACL.
74                 </para></listitem>
75                 </varlistentry>
76                 
77                 
78                 
79                 <varlistentry>
80                 <term>-D|--delete acl</term>
81                 <listitem><para>Delete any ACEs specified on the command line.
82                 An error will be printed for each ACE specified that was not
83                 already present in the object's ACL. </para></listitem>
84                 </varlistentry>
85                 
86                 
87                 
88                 <varlistentry>
89                 <term>-S|--set acl</term>
90                 <listitem><para>This command sets the ACL on the object with
91                 only what is specified on the command line.  Any existing ACL
92                 is erased. Note that the ACL specified must contain at least a revision,
93                 type, owner and group for the call to succeed. </para></listitem>
94                 </varlistentry>
95                 
96                 
97                 
98                 <varlistentry>
99                 <term>-C|--chown name</term>
100                 <listitem><para>The owner of a file or directory can be changed 
101                 to the name given using the <parameter>-C</parameter> option.  
102                 The name can be a sid in the form S-1-x-y-z or a name resolved 
103                 against the server specified in the first argument. </para>
104                 
105                 <para>This command is a shortcut for -M OWNER:name. 
106                 </para></listitem>
107                 </varlistentry>
108                 
109                 
110                 
111                 <varlistentry>
112                 <term>-G|--chgrp name</term>
113                 <listitem><para>The group owner of a file or directory can 
114                 be changed to the name given using the <parameter>-G</parameter> 
115                 option.  The name can be a sid in the form S-1-x-y-z or a name 
116                 resolved against the server specified n the first argument.
117                 </para>
118                 
119                 <para>This command is a shortcut for -M GROUP:name.</para></listitem>
120                 </varlistentry>
121                 
122                 
123                 
124                 <varlistentry>
125                 <term>-I|--inherit allow|remove|copy</term>
126                 <listitem><para>Set or unset the windows "Allow inheritable
127                 permissions" check box using the <parameter>-I</parameter>
128                 option.  To set the check box pass allow. To unset the check
129                 box pass either remove or copy. Remove will remove all
130                 inherited acls. Copy will copy all the inherited acls.
131                 </para></listitem>
132
133                 </varlistentry>
134
135
136                 <varlistentry>
137                 <term>--numeric</term>
138                 <listitem><para>This option displays all ACL information in numeric 
139                 format.  The default is to convert SIDs to names and ACE types 
140                 and masks to a readable string format.  </para></listitem>
141                 </varlistentry>
142                 
143                 <varlistentry>
144                 <term>-e</term>
145                 <listitem><para>This command line parameter requires the remote
146                 server support the UNIX extensions or that the SMB3 protocol has been selected.
147                 Requests that the connection be encrypted. Negotiates SMB encryption using either
148                 SMB3 or POSIX extensions via GSSAPI. Uses the given credentials for
149                 the encryption negotiation (either kerberos or NTLMv1/v2 if given
150                 domain/username/password triple. Fails the connection if encryption
151                 cannot be negotiated.
152                 </para></listitem>
153                 </varlistentry>
154
155                 <varlistentry>
156                 <term>-m|--max-protocol PROTOCOL_NAME</term>
157                 <listitem><para>This allows the user to select the
158                 highest SMB protocol level that smbcacls will use to
159                 connect to the server. By default this is set to
160                 NT1, which is the highest available SMB1 protocol.
161                 To connect using SMB2 or SMB3 protocol, use the
162                 strings SMB2 or SMB3 respectively. Note that to connect
163                 to a Windows 2012 server with encrypted transport selecting
164                 a max-protocol of SMB3 is required.
165                 </para></listitem>
166                 </varlistentry>
167
168                 <varlistentry>
169                 <term>-t|--test-args</term>
170                 <listitem><para>
171                 Don't actually do anything, only validate the correctness of 
172                 the arguments.
173                 </para></listitem>
174                 </varlistentry>
175                                 
176                 &stdarg.help;
177                 &stdarg.server.debug;
178                 &popt.common.samba;
179                 &popt.common.credentials;
180                 &popt.common.connection;
181         </variablelist>
182 </refsect1>
183
184
185 <refsect1>
186         <title>ACL FORMAT</title>
187
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>
190
191 <para><programlisting> 
192 REVISION:&lt;revision number&gt;
193 OWNER:&lt;sid or name&gt;
194 GROUP:&lt;sid or name&gt;
195 ACL:&lt;sid or name&gt;:&lt;type&gt;/&lt;flags&gt;/&lt;mask&gt;
196 </programlisting></para>
197   
198
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>
203
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>
208
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>
214
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>
218
219         <itemizedlist> 
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>
224         </itemizedlist>
225   
226         <para>At present, flags can only be specified as decimal or
227         hexadecimal values.</para>
228  
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>
233
234         <itemizedlist>
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>
241         </itemizedlist>
242
243
244         <para>The following combined permissions can be specified:</para>
245
246
247         <itemizedlist>
248                 <listitem><para><emphasis>READ</emphasis> -  Equivalent to 'RX'
249                 permissions</para></listitem>
250                 <listitem><para><emphasis>CHANGE</emphasis> - Equivalent to 'RXWD' permissions
251                 </para></listitem>
252                 <listitem><para><emphasis>FULL</emphasis> - Equivalent to 'RWXDPO' 
253                 permissions</para></listitem>
254         </itemizedlist>
255         </refsect1>
256
257 <refsect1>
258         <title>EXIT STATUS</title>
259
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>
263
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>
269 </refsect1>
270
271 <refsect1>
272         <title>VERSION</title>
273
274         <para>This man page is correct for version 4 of the Samba suite.</para>
275 </refsect1>
276
277 <refsect1>
278         <title>AUTHOR</title>
279         
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>
284         
285         <para><command>smbcacls</command> was written by Andrew Tridgell 
286         and Tim Potter.</para>
287         
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>
291 </refsect1>
292
293 </refentry>