source: branches/samba-3.5.x/docs/manpages/smbcacls.1

Last change on this file was 773, checked in by Herwig Bauernfeind, 12 years ago

Samba Server 3.5: Update branch to 3.5.20

File size: 11.1 KB
Line 
1'\" t
2.\" Title: smbcacls
3.\" Author: [see the "AUTHOR" section]
4.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
5.\" Date: 12/14/2012
6.\" Manual: User Commands
7.\" Source: Samba 3.5
8.\" Language: English
9.\"
10.TH "SMBCACLS" "1" "12/14/2012" "Samba 3\&.5" "User Commands"
11.\" -----------------------------------------------------------------
12.\" * set default formatting
13.\" -----------------------------------------------------------------
14.\" disable hyphenation
15.nh
16.\" disable justification (adjust text to left margin only)
17.ad l
18.\" -----------------------------------------------------------------
19.\" * MAIN CONTENT STARTS HERE *
20.\" -----------------------------------------------------------------
21.SH "NAME"
22smbcacls \- Set or get ACLs on an NT file or directory names
23.SH "SYNOPSIS"
24.HP \w'\ 'u
25smbcacls {//server/share} {filename} [\-D\ acls] [\-M\ acls] [\-a\ acls] [\-S\ acls] [\-C\ name] [\-G\ name] [\-\-numeric] [\-t] [\-U\ username] [\-h] [\-d]
26.SH "DESCRIPTION"
27.PP
28This tool is part of the
29\fBsamba\fR(7)
30suite\&.
31.PP
32The
33smbcacls
34program manipulates NT Access Control Lists (ACLs) on SMB file shares\&.
35.SH "OPTIONS"
36.PP
37The following options are available to the
38smbcacls
39program\&. The format of ACLs is described in the section ACL FORMAT
40.PP
41\-a|\-\-add acls
42.RS 4
43Add the ACLs specified to the ACL list\&. Existing access control entries are unchanged\&.
44.RE
45.PP
46\-M|\-\-modify acls
47.RS 4
48Modify the mask value (permissions) for the ACLs specified on the command line\&. An error will be printed for each ACL specified that was not already present in the ACL list
49.RE
50.PP
51\-D|\-\-delete acls
52.RS 4
53Delete any ACLs specified on the command line\&. An error will be printed for each ACL specified that was not already present in the ACL list\&.
54.RE
55.PP
56\-S|\-\-set acls
57.RS 4
58This command sets the ACLs on the file with only the ones specified on the command line\&. All other ACLs are erased\&. Note that the ACL specified must contain at least a revision, type, owner and group for the call to succeed\&.
59.RE
60.PP
61\-C|\-\-chown name
62.RS 4
63The owner of a file or directory can be changed to the name given using the
64\fI\-C\fR
65option\&. The name can be a sid in the form S\-1\-x\-y\-z or a name resolved against the server specified in the first argument\&.
66.sp
67This command is a shortcut for \-M OWNER:name\&.
68.RE
69.PP
70\-G|\-\-chgrp name
71.RS 4
72The group owner of a file or directory can be changed to the name given using the
73\fI\-G\fR
74option\&. The name can be a sid in the form S\-1\-x\-y\-z or a name resolved against the server specified n the first argument\&.
75.sp
76This command is a shortcut for \-M GROUP:name\&.
77.RE
78.PP
79\-\-numeric
80.RS 4
81This option displays all ACL information in numeric format\&. The default is to convert SIDs to names and ACE types and masks to a readable string format\&.
82.RE
83.PP
84\-t|\-\-test\-args
85.RS 4
86Don\'t actually do anything, only validate the correctness of the arguments\&.
87.RE
88.PP
89\-h|\-\-help
90.RS 4
91Print a summary of command line options\&.
92.RE
93.PP
94\-d|\-\-debuglevel=level
95.RS 4
96\fIlevel\fR
97is an integer from 0 to 10\&. The default value if this parameter is not specified is 0\&.
98.sp
99The higher this value, the more detail will be logged to the log files about the activities of the server\&. At level 0, only critical errors and serious warnings will be logged\&. Level 1 is a reasonable level for day\-to\-day running \- it generates a small amount of information about operations carried out\&.
100.sp
101Levels above 1 will generate considerable amounts of log data, and should only be used when investigating a problem\&. Levels above 3 are designed for use only by developers and generate HUGE amounts of log data, most of which is extremely cryptic\&.
102.sp
103Note that specifying this parameter here will override the
104\m[blue]\fBlog level\fR\m[]
105parameter in the
106smb\&.conf
107file\&.
108.RE
109.PP
110\-V|\-\-version
111.RS 4
112Prints the program version number\&.
113.RE
114.PP
115\-s|\-\-configfile <configuration file>
116.RS 4
117The file specified contains the configuration details required by the server\&. The information in this file includes server\-specific information such as what printcap file to use, as well as descriptions of all the services that the server is to provide\&. See
118smb\&.conf
119for more information\&. The default configuration file name is determined at compile time\&.
120.RE
121.PP
122\-l|\-\-log\-basename=logdirectory
123.RS 4
124Base directory name for log/debug files\&. The extension
125\fB"\&.progname"\fR
126will be appended (e\&.g\&. log\&.smbclient, log\&.smbd, etc\&.\&.\&.)\&. The log file is never removed by the client\&.
127.RE
128.PP
129\-N|\-\-no\-pass
130.RS 4
131If specified, this parameter suppresses the normal password prompt from the client to the user\&. This is useful when accessing a service that does not require a password\&.
132.sp
133Unless a password is specified on the command line or this parameter is specified, the client will request a password\&.
134.sp
135If a password is specified on the command line and this option is also defined the password on the command line will be silently ingnored and no password will be used\&.
136.RE
137.PP
138\-k|\-\-kerberos
139.RS 4
140Try to authenticate with kerberos\&. Only useful in an Active Directory environment\&.
141.RE
142.PP
143\-C|\-\-use\-ccache
144.RS 4
145Try to use the credentials cached by winbind\&.
146.RE
147.PP
148\-A|\-\-authentication\-file=filename
149.RS 4
150This option allows you to specify a file from which to read the username and password used in the connection\&. The format of the file is
151.sp
152.if n \{\
153.RS 4
154.\}
155.nf
156username = <value>
157password = <value>
158domain = <value>
159.fi
160.if n \{\
161.RE
162.\}
163.sp
164Make certain that the permissions on the file restrict access from unwanted users\&.
165.RE
166.PP
167\-U|\-\-user=username[%password]
168.RS 4
169Sets the SMB username or username and password\&.
170.sp
171If %password is not specified, the user will be prompted\&. The client will first check the
172\fBUSER\fR
173environment variable, then the
174\fBLOGNAME\fR
175variable and if either exists, the string is uppercased\&. If these environmental variables are not found, the username
176\fBGUEST\fR
177is used\&.
178.sp
179A third option is to use a credentials file which contains the plaintext of the username and password\&. This option is mainly provided for scripts where the admin does not wish to pass the credentials on the command line or via environment variables\&. If this method is used, make certain that the permissions on the file restrict access from unwanted users\&. See the
180\fI\-A\fR
181for more details\&.
182.sp
183Be cautious about including passwords in scripts\&. Also, on many systems the command line of a running process may be seen via the
184ps
185command\&. To be safe always allow
186rpcclient
187to prompt for a password and type it in directly\&.
188.RE
189.SH "ACL FORMAT"
190.PP
191The format of an ACL is one or more ACL entries separated by either commas or newlines\&. An ACL entry is one of the following:
192.PP
193.if n \{\
194.RS 4
195.\}
196.nf
197
198REVISION:<revision number>
199OWNER:<sid or name>
200GROUP:<sid or name>
201ACL:<sid or name>:<type>/<flags>/<mask>
202.fi
203.if n \{\
204.RE
205.\}
206.PP
207The revision of the ACL specifies the internal Windows NT ACL revision for the security descriptor\&. If not specified it defaults to 1\&. Using values other than 1 may cause strange behaviour\&.
208.PP
209The owner and group specify the owner and group sids for the object\&. If a SID in the format S\-1\-x\-y\-z is specified this is used, otherwise the name specified is resolved using the server on which the file or directory resides\&.
210.PP
211ACLs specify permissions granted to the SID\&. This SID again can be specified in S\-1\-x\-y\-z format or as a name in which case it is resolved against the server on which the file or directory resides\&. The type, flags and mask values determine the type of access granted to the SID\&.
212.PP
213The type can be either ALLOWED or DENIED to allow/deny access to the SID\&. The flags values are generally zero for file ACLs and either 9 or 2 for directory ACLs\&. Some common flags are:
214.sp
215.RS 4
216.ie n \{\
217\h'-04'\(bu\h'+03'\c
218.\}
219.el \{\
220.sp -1
221.IP \(bu 2.3
222.\}
223\fB#define SEC_ACE_FLAG_OBJECT_INHERIT 0x1\fR
224.RE
225.sp
226.RS 4
227.ie n \{\
228\h'-04'\(bu\h'+03'\c
229.\}
230.el \{\
231.sp -1
232.IP \(bu 2.3
233.\}
234\fB#define SEC_ACE_FLAG_CONTAINER_INHERIT 0x2\fR
235.RE
236.sp
237.RS 4
238.ie n \{\
239\h'-04'\(bu\h'+03'\c
240.\}
241.el \{\
242.sp -1
243.IP \(bu 2.3
244.\}
245\fB#define SEC_ACE_FLAG_NO_PROPAGATE_INHERIT 0x4\fR
246.RE
247.sp
248.RS 4
249.ie n \{\
250\h'-04'\(bu\h'+03'\c
251.\}
252.el \{\
253.sp -1
254.IP \(bu 2.3
255.\}
256\fB#define SEC_ACE_FLAG_INHERIT_ONLY 0x8\fR
257.sp
258.RE
259.PP
260At present flags can only be specified as decimal or hexadecimal values\&.
261.PP
262The mask is a value which expresses the access right granted to the SID\&. It can be given as a decimal or hexadecimal value, or by using one of the following text strings which map to the NT file permissions of the same name\&.
263.sp
264.RS 4
265.ie n \{\
266\h'-04'\(bu\h'+03'\c
267.\}
268.el \{\
269.sp -1
270.IP \(bu 2.3
271.\}
272\fIR\fR
273\- Allow read access
274.RE
275.sp
276.RS 4
277.ie n \{\
278\h'-04'\(bu\h'+03'\c
279.\}
280.el \{\
281.sp -1
282.IP \(bu 2.3
283.\}
284\fIW\fR
285\- Allow write access
286.RE
287.sp
288.RS 4
289.ie n \{\
290\h'-04'\(bu\h'+03'\c
291.\}
292.el \{\
293.sp -1
294.IP \(bu 2.3
295.\}
296\fIX\fR
297\- Execute permission on the object
298.RE
299.sp
300.RS 4
301.ie n \{\
302\h'-04'\(bu\h'+03'\c
303.\}
304.el \{\
305.sp -1
306.IP \(bu 2.3
307.\}
308\fID\fR
309\- Delete the object
310.RE
311.sp
312.RS 4
313.ie n \{\
314\h'-04'\(bu\h'+03'\c
315.\}
316.el \{\
317.sp -1
318.IP \(bu 2.3
319.\}
320\fIP\fR
321\- Change permissions
322.RE
323.sp
324.RS 4
325.ie n \{\
326\h'-04'\(bu\h'+03'\c
327.\}
328.el \{\
329.sp -1
330.IP \(bu 2.3
331.\}
332\fIO\fR
333\- Take ownership
334.sp
335.RE
336.PP
337The following combined permissions can be specified:
338.sp
339.RS 4
340.ie n \{\
341\h'-04'\(bu\h'+03'\c
342.\}
343.el \{\
344.sp -1
345.IP \(bu 2.3
346.\}
347\fIREAD\fR
348\- Equivalent to \'RX\' permissions
349.RE
350.sp
351.RS 4
352.ie n \{\
353\h'-04'\(bu\h'+03'\c
354.\}
355.el \{\
356.sp -1
357.IP \(bu 2.3
358.\}
359\fICHANGE\fR
360\- Equivalent to \'RXWD\' permissions
361.RE
362.sp
363.RS 4
364.ie n \{\
365\h'-04'\(bu\h'+03'\c
366.\}
367.el \{\
368.sp -1
369.IP \(bu 2.3
370.\}
371\fIFULL\fR
372\- Equivalent to \'RWXDPO\' permissions
373.SH "EXIT STATUS"
374.PP
375The
376smbcacls
377program sets the exit status depending on the success or otherwise of the operations performed\&. The exit status may be one of the following values\&.
378.PP
379If the operation succeeded, smbcacls returns and exit status of 0\&. If
380smbcacls
381couldn\'t connect to the specified server, or there was an error getting or setting the ACLs, an exit status of 1 is returned\&. If there was an error parsing any command line arguments, an exit status of 2 is returned\&.
382.SH "VERSION"
383.PP
384This man page is correct for version 3 of the Samba suite\&.
385.SH "AUTHOR"
386.PP
387The original Samba software and related utilities were created by Andrew Tridgell\&. Samba is now developed by the Samba Team as an Open Source project similar to the way the Linux kernel is developed\&.
388.PP
389smbcacls
390was written by Andrew Tridgell and Tim Potter\&.
391.PP
392The conversion to DocBook for Samba 2\&.2 was done by Gerald Carter\&. The conversion to DocBook XML 4\&.2 for Samba 3\&.0 was done by Alexander Bokovoy\&.
Note: See TracBrowser for help on using the repository browser.