7364ddb25cac8af26afd53182a5b25c5404167c5
[sfrench/samba-autobuild/.git] / docs-xml / manpages / sharesec.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="sharesec.1">
4
5 <refmeta>
6         <refentrytitle>sharesec</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>
12
13
14 <refnamediv>
15         <refname>sharesec</refname>
16         <refpurpose>Set or get share ACLs</refpurpose>
17 </refnamediv>
18
19 <refsynopsisdiv>
20         <cmdsynopsis>
21                 <command>sharesec</command>
22                 <arg choice="req">sharename</arg>
23                 <arg choice="opt">-r, --remove=ACL</arg>
24                 <arg choice="opt">-m, --modify=ACL</arg>
25                 <arg choice="opt">-a, --add=ACL</arg>
26                 <arg choice="opt">-R, --replace=ACLs</arg>
27                 <arg choice="opt">-D, --delete</arg>
28                 <arg choice="opt">-v, --view</arg>
29                 <arg choice="opt">--view-all</arg>
30                 <arg choice="opt">-M, --machine-sid</arg>
31                 <arg choice="opt">-F, --force</arg>
32                 <arg choice="opt">-d, --debuglevel=DEBUGLEVEL</arg>
33                 <arg choice="opt">-s, --configfile=CONFIGFILE</arg>
34                 <arg choice="opt">-l, --log-basename=LOGFILEBASE</arg>
35                 <arg choice="opt">--version</arg>
36                 <arg choice="opt">-?, --help</arg>
37                 <arg choice="opt">--usage</arg>
38                 <arg choice="opt">-S, --setsddl=STRING</arg>
39                 <arg choice="opt">-V, --viewsddl</arg>
40         </cmdsynopsis>
41 </refsynopsisdiv>
42
43 <refsect1>
44         <title>DESCRIPTION</title>
45
46         <para>This tool is part of the <citerefentry><refentrytitle>samba</refentrytitle>
47         <manvolnum>7</manvolnum></citerefentry> suite.</para>
48
49         <para>The <command>sharesec</command> program manipulates share permissions
50         on SMB file shares.</para>
51 </refsect1>
52
53
54 <refsect1>
55         <title>OPTIONS</title>
56
57         <para>The following options are available to the <command>sharesec</command> program.
58         The format of ACLs is described in the section ACL FORMAT </para>
59
60         <variablelist>
61                 <varlistentry>
62                 <term>-a|--add=ACL</term>
63                 <listitem><para>Add the ACEs specified to the ACL list.
64                 </para></listitem>
65                 </varlistentry>
66
67                 <varlistentry>
68                 <term>-D|--delete</term>
69                 <listitem><para>Delete the entire security descriptor.
70                 </para></listitem>
71                 </varlistentry>
72
73                 <varlistentry>
74                 <term>-F|--force</term>
75                 <listitem><para>Force storing the ACL.
76                 </para></listitem>
77                 </varlistentry>
78
79                 <varlistentry>
80                 <term>-m|--modify=ACL</term>
81                 <listitem><para>Modify existing ACEs.
82                 </para></listitem>
83                 </varlistentry>
84
85                 <varlistentry>
86                 <term>-M|--machine-sid</term>
87                 <listitem><para>Initialize the machine SID.
88                 </para></listitem>
89                 </varlistentry>
90
91                 <varlistentry>
92                 <term>-r|--remove=ACL</term>
93                 <listitem><para>Remove ACEs.
94                 </para></listitem>
95                 </varlistentry>
96
97                 <varlistentry>
98                 <term>-R|--replace=ACLS</term>
99                 <listitem><para>
100                 Overwrite an existing share permission ACL.
101                 </para></listitem>
102                 </varlistentry>
103
104                 <varlistentry>
105                 <term>-v|--view</term>
106                 <listitem><para>
107                 List a share acl
108                 </para></listitem>
109                 </varlistentry>
110
111                 <varlistentry>
112                 <term>--view-all</term>
113                 <listitem><para>
114                 List all share acls
115                 </para></listitem>
116                 </varlistentry>
117
118                 <varlistentry>
119                 <term>-S|--setsddl=STRING</term>
120                 <listitem><para>
121                 Set security descriptor by providing ACL in SDDL format.
122                 </para></listitem>
123                 </varlistentry>
124
125                 <varlistentry>
126                 <term>-V|--viewsddl</term>
127                 <listitem><para>
128                 List a share acl in SDDL format.
129                 </para></listitem>
130                 </varlistentry>
131
132                 &stdarg.help;
133                 &stdarg.server.debug;
134                 &popt.common.samba;
135         </variablelist>
136 </refsect1>
137
138
139 <refsect1>
140         <title>ACL FORMAT</title>
141
142         <para>The format of an ACL is one or more ACL entries separated by
143         either commas or newlines.  An ACL entry is one of the following: </para>
144
145         <para><programlisting>
146         REVISION:&lt;revision number&gt;
147         OWNER:&lt;sid or name&gt;
148         GROUP:&lt;sid or name&gt;
149         ACL:&lt;sid or name&gt;:&lt;type&gt;/&lt;flags&gt;/&lt;mask&gt;
150         </programlisting></para>
151
152         <para>The revision of the ACL specifies the internal Windows
153         NT ACL revision for the security descriptor.
154         If not specified it defaults to 1. Using values other than 1 may
155         cause strange behaviour.</para>
156
157         <para>The owner and group specify the owner and group SIDs for
158         the object. Share ACLs do not specify an owner or a group, so
159         these fields are empty.</para>
160
161         <para>ACLs specify permissions granted to the SID. This SID
162         can be specified in S-1-x-y-z format or as a name in which case
163         it is resolved against the server on which the file or directory
164         resides.  The type, flags and mask values determine the type of
165         access granted to the SID.</para>
166
167         <para>The type can be either ALLOWED or DENIED to allow/deny access
168         to the SID. The flags values are generally zero for share ACLs.
169         </para>
170
171         <para>The mask is a value which expresses the access right
172         granted to the SID. It can be given as a decimal or hexadecimal value,
173         or by using one of the following text strings which map to the NT
174         file permissions of the same name.</para>
175
176         <itemizedlist>
177                 <listitem><para><emphasis>R</emphasis> - Allow read access </para></listitem>
178                 <listitem><para><emphasis>W</emphasis> - Allow write access</para></listitem>
179                 <listitem><para><emphasis>X</emphasis> - Execute permission on the object</para></listitem>
180                 <listitem><para><emphasis>D</emphasis> - Delete the object</para></listitem>
181                 <listitem><para><emphasis>P</emphasis> - Change permissions</para></listitem>
182                 <listitem><para><emphasis>O</emphasis> - Take ownership</para></listitem>
183         </itemizedlist>
184
185         <para>The following combined permissions can be specified:</para>
186
187         <itemizedlist>
188                 <listitem><para><emphasis>READ</emphasis> -  Equivalent to 'RX'
189                 permissions</para></listitem>
190                 <listitem><para><emphasis>CHANGE</emphasis> - Equivalent to 'RXWD' permissions
191                 </para></listitem>
192                 <listitem><para><emphasis>FULL</emphasis> - Equivalent to 'RWXDPO'
193                 permissions</para></listitem>
194         </itemizedlist>
195         </refsect1>
196
197 <refsect1>
198         <title>EXIT STATUS</title>
199
200         <para>The <command>sharesec</command> program sets the exit status
201         depending on the success or otherwise of the operations performed.
202         The exit status may be one of the following values. </para>
203
204         <para>If the operation succeeded, sharesec returns and exit
205         status of 0.  If <command>sharesec</command> couldn't connect to the specified server,
206         or there was an error getting or setting the ACLs, an exit status
207         of 1 is returned.  If there was an error parsing any command line
208         arguments, an exit status of 2 is returned. </para>
209 </refsect1>
210
211 <refsect1>
212         <title>EXAMPLES</title>
213
214         <para>Add full access for SID
215         <parameter>S-1-5-21-1866488690-1365729215-3963860297-17724</parameter> on
216         <parameter>share</parameter>:
217         </para>
218
219         <programlisting>
220         host:~ # sharesec share -a S-1-5-21-1866488690-1365729215-3963860297-17724:ALLOWED/0/FULL
221         </programlisting>
222
223         <para>List all ACEs for <parameter>share</parameter>:
224         </para>
225
226         <programlisting>
227         host:~ # sharesec share -v
228         REVISION:1
229         CONTROL:SR|DP
230         OWNER:
231         GROUP:
232         ACL:S-1-1-0:ALLOWED/0x0/FULL
233         ACL:S-1-5-21-1866488690-1365729215-3963860297-17724:ALLOWED/0x0/FULL
234         </programlisting>
235 </refsect1>
236
237 <refsect1>
238         <title>VERSION</title>
239
240         <para>This man page is correct for version &doc.version; of the Samba suite.</para>
241 </refsect1>
242
243 <refsect1>
244         <title>AUTHOR</title>
245         <para>The original Samba software and related utilities
246         were created by Andrew Tridgell. Samba is now developed
247         by the Samba Team as an Open Source project similar
248         to the way the Linux kernel is developed.</para>
249 </refsect1>
250
251 </refentry>