docs: mention -V|--viewsddl in sharesec manpage.
[bbaumbach/samba-autobuild/.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">-h</arg>
35                 <arg choice="opt">-d</arg>
36                 <arg choice="opt">-e</arg>
37                 <arg choice="opt">-m|--max-protocol LEVEL</arg>
38         </cmdsynopsis>
39 </refsynopsisdiv>
40
41 <refsect1>
42         <title>DESCRIPTION</title>
43
44         <para>This tool is part of the <citerefentry><refentrytitle>samba</refentrytitle>
45         <manvolnum>7</manvolnum></citerefentry> suite.</para>
46
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
50         user or group.</para>
51 </refsect1>
52
53
54 <refsect1>
55         <title>OPTIONS</title>
56
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>
59
60
61         <variablelist>
62                 <varlistentry>
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>
66                 </varlistentry>
67                 
68                 
69                 
70                 <varlistentry>
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.
75                 </para></listitem>
76                 </varlistentry>
77                 
78                 
79                 
80                 <varlistentry>
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>
85                 </varlistentry>
86                 
87                 
88                 
89                 <varlistentry>
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>
95                 </varlistentry>
96                 
97                 
98                 
99                 <varlistentry>
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>
105                 
106                 <para>This command is a shortcut for -M OWNER:name. 
107                 </para></listitem>
108                 </varlistentry>
109                 
110                 
111                 
112                 <varlistentry>
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.
118                 </para>
119                 
120                 <para>This command is a shortcut for -M GROUP:name.</para></listitem>
121                 </varlistentry>
122                 
123                 
124                 
125                 <varlistentry>
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.
132                 </para></listitem>
133
134                 </varlistentry>
135
136
137                 <varlistentry>
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>
142                 </varlistentry>
143                 
144                 <varlistentry>
145                 <term>-e</term>
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.
153                 </para></listitem>
154                 </varlistentry>
155
156                 <varlistentry>
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.
166                 </para></listitem>
167                 </varlistentry>
168
169                 <varlistentry>
170                 <term>-t|--test-args</term>
171                 <listitem><para>
172                 Don't actually do anything, only validate the correctness of 
173                 the arguments.
174                 </para></listitem>
175                 </varlistentry>
176                                 
177                 &stdarg.help;
178                 &stdarg.server.debug;
179                 &popt.common.samba;
180                 &popt.common.credentials;
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>