1SMBCACLS(1) User Commands SMBCACLS(1)
2
3
4
6 smbcacls - Set or get ACLs on an NT file or directory names
7
9 smbcacls {//server/share} {/filename} [-D|--delete acl]
10 [-M|--modify acl] [-a|--add acl] [-S|--set acl] [-C|--chown name]
11 [-G|--chgrp name] [-I allow|remove|copy] [--propagate-inheritance]
12 [--numeric] [-t] [-U username] [-d] [-e] [-m|--max-protocol LEVEL]
13 [--query-security-info FLAGS] [--set-security-info FLAGS] [--sddl]
14 [--domain-sid SID] [-x|--maximum-access]
15
17 This tool is part of the samba(7) suite.
18
19 The smbcacls program manipulates NT Access Control Lists (ACLs) on SMB
20 file shares. An ACL is comprised zero or more Access Control Entries
21 (ACEs), which define access restrictions for a specific user or group.
22
24 The following options are available to the smbcacls program. The format
25 of ACLs is described in the section ACL FORMAT
26
27 -a|--add acl
28 Add the entries specified to the ACL. Existing access control
29 entries are unchanged.
30
31 -M|--modify acl
32 Modify the mask value (permissions) for the ACEs specified on the
33 command line. An error will be printed for each ACE specified that
34 was not already present in the object's ACL.
35
36 -D|--delete acl
37 Delete any ACEs specified on the command line. An error will be
38 printed for each ACE specified that was not already present in the
39 object's ACL.
40
41 -S|--set acl
42 This command sets the ACL on the object with only what is specified
43 on the command line. Any existing ACL is erased. Note that the ACL
44 specified must contain at least a revision, type, owner and group
45 for the call to succeed.
46
47 -C|--chown name
48 The owner of a file or directory can be changed to the name given
49 using the -C option. The name can be a sid in the form S-1-x-y-z or
50 a name resolved against the server specified in the first argument.
51
52 This command is a shortcut for -M OWNER:name.
53
54 -G|--chgrp name
55 The group owner of a file or directory can be changed to the name
56 given using the -G option. The name can be a sid in the form
57 S-1-x-y-z or a name resolved against the server specified n the
58 first argument.
59
60 This command is a shortcut for -M GROUP:name.
61
62 -I|--inherit allow|remove|copy
63 Set or unset the windows "Allow inheritable permissions" check box
64 using the -I option. To set the check box pass allow. To unset the
65 check box pass either remove or copy. Remove will remove all
66 inherited ACEs. Copy will copy all the inherited ACEs.
67
68 --propagate-inheritance
69 Add, modify, delete or set ACEs on an entire directory tree
70 according to the inheritance flags. Refer to the INHERITANCE
71 section for details.
72
73 --numeric
74 This option displays all ACL information in numeric format. The
75 default is to convert SIDs to names and ACE types and masks to a
76 readable string format.
77
78 -m|--max-protocol PROTOCOL_NAME
79 This allows the user to select the highest SMB protocol level that
80 smbcacls will use to connect to the server. By default this is set
81 to NT1, which is the highest available SMB1 protocol. To connect
82 using SMB2 or SMB3 protocol, use the strings SMB2 or SMB3
83 respectively. Note that to connect to a Windows 2012 server with
84 encrypted transport selecting a max-protocol of SMB3 is required.
85
86 -t|--test-args
87 Don't actually do anything, only validate the correctness of the
88 arguments.
89
90 --query-security-info FLAGS
91 The security-info flags for queries.
92
93 --set-security-info FLAGS
94 The security-info flags for queries.
95
96 --sddl
97 Output and input acls in sddl format.
98
99 --domain-sid SID
100 SID used for sddl processing.
101
102 -x|--maximum-access
103 When displaying an ACL additionally query the server for effective
104 maximum permissions. Note that this is only supported with SMB
105 protocol version 2 or higher.
106
107 -d|--debuglevel=level
108 level is an integer from 0 to 10. The default value if this
109 parameter is not specified is 0.
110
111 The higher this value, the more detail will be logged to the log
112 files about the activities of the server. At level 0, only critical
113 errors and serious warnings will be logged. Level 1 is a reasonable
114 level for day-to-day running - it generates a small amount of
115 information about operations carried out.
116
117 Levels above 1 will generate considerable amounts of log data, and
118 should only be used when investigating a problem. Levels above 3
119 are designed for use only by developers and generate HUGE amounts
120 of log data, most of which is extremely cryptic.
121
122 Note that specifying this parameter here will override the log
123 level parameter in the smb.conf file.
124
125 -V|--version
126 Prints the program version number.
127
128 -s|--configfile=<configuration file>
129 The file specified contains the configuration details required by
130 the server. The information in this file includes server-specific
131 information such as what printcap file to use, as well as
132 descriptions of all the services that the server is to provide. See
133 smb.conf for more information. The default configuration file name
134 is determined at compile time.
135
136 -l|--log-basename=logdirectory
137 Base directory name for log/debug files. The extension ".progname"
138 will be appended (e.g. log.smbclient, log.smbd, etc...). The log
139 file is never removed by the client.
140
141 --option=<name>=<value>
142 Set the smb.conf(5) option "<name>" to value "<value>" from the
143 command line. This overrides compiled-in defaults and options read
144 from the configuration file.
145
146 -N|--no-pass
147 If specified, this parameter suppresses the normal password prompt
148 from the client to the user. This is useful when accessing a
149 service that does not require a password.
150
151 Unless a password is specified on the command line or this
152 parameter is specified, the client will request a password.
153
154 If a password is specified on the command line and this option is
155 also defined the password on the command line will be silently
156 ignored and no password will be used.
157
158 -k|--kerberos
159 Try to authenticate with kerberos. Only useful in an Active
160 Directory environment.
161
162 -C|--use-ccache
163 Try to use the credentials cached by winbind.
164
165 -A|--authentication-file=filename
166 This option allows you to specify a file from which to read the
167 username and password used in the connection. The format of the
168 file is
169
170 username = <value>
171 password = <value>
172 domain = <value>
173
174 Make certain that the permissions on the file restrict access from
175 unwanted users.
176
177 -U|--user=username[%password]
178 Sets the SMB username or username and password.
179
180 If %password is not specified, the user will be prompted. The
181 client will first check the USER environment variable, then the
182 LOGNAME variable and if either exists, the string is uppercased. If
183 these environmental variables are not found, the username GUEST is
184 used.
185
186 A third option is to use a credentials file which contains the
187 plaintext of the username and password. This option is mainly
188 provided for scripts where the admin does not wish to pass the
189 credentials on the command line or via environment variables. If
190 this method is used, make certain that the permissions on the file
191 restrict access from unwanted users. See the -A for more details.
192
193 Be cautious about including passwords in scripts. Also, on many
194 systems the command line of a running process may be seen via the
195 ps command. To be safe always allow rpcclient to prompt for a
196 password and type it in directly.
197
198 -S|--signing on|off|required
199 Set the client signing state.
200
201 -P|--machine-pass
202 Use stored machine account password.
203
204 -e|--encrypt
205 This command line parameter requires the remote server support the
206 UNIX extensions or that the SMB3 protocol has been selected.
207 Requests that the connection be encrypted. Negotiates SMB
208 encryption using either SMB3 or POSIX extensions via GSSAPI. Uses
209 the given credentials for the encryption negotiation (either
210 kerberos or NTLMv1/v2 if given domain/username/password triple.
211 Fails the connection if encryption cannot be negotiated.
212
213 --pw-nt-hash
214 The supplied password is the NT hash.
215
216 -n|--netbiosname <primary NetBIOS name>
217 This option allows you to override the NetBIOS name that Samba uses
218 for itself. This is identical to setting the netbios name parameter
219 in the smb.conf file. However, a command line setting will take
220 precedence over settings in smb.conf.
221
222 -i|--scope <scope>
223 This specifies a NetBIOS scope that nmblookup will use to
224 communicate with when generating NetBIOS names. For details on the
225 use of NetBIOS scopes, see rfc1001.txt and rfc1002.txt. NetBIOS
226 scopes are very rarely used, only set this parameter if you are the
227 system administrator in charge of all the NetBIOS systems you
228 communicate with.
229
230 -W|--workgroup=domain
231 Set the SMB domain of the username. This overrides the default
232 domain which is the domain defined in smb.conf. If the domain
233 specified is the same as the servers NetBIOS name, it causes the
234 client to log on using the servers local SAM (as opposed to the
235 Domain SAM).
236
237 -O|--socket-options socket options
238 TCP socket options to set on the client socket. See the socket
239 options parameter in the smb.conf manual page for the list of valid
240 options.
241
242 -?|--help
243 Print a summary of command line options.
244
245 --usage
246 Display brief usage message.
247
249 The format of an ACL is one or more entries separated by either commas
250 or newlines. An ACL entry is one of the following:
251
252 REVISION:<revision number>
253 OWNER:<sid or name>
254 GROUP:<sid or name>
255 ACL:<sid or name>:<type>/<flags>/<mask>
256
257 Control bits related to automatic inheritance
258
259 • OD - "Owner Defaulted" - Indicates that the SID of the owner
260 of the security descriptor was provided by a default
261 mechanism.
262
263 • GD - "Group Defaulted" - Indicates that the SID of the
264 security descriptor group was provided by a default
265 mechanism.
266
267 • DP - "DACL Present" - Indicates a security descriptor that
268 has a discretionary access control list (DACL).
269
270 • DD - "DACL Defaulted" - Indicates a security descriptor with
271 a default DACL.
272
273 • SP - "SACL Present" - Indicates a security descriptor that
274 has a system access control list (SACL).
275
276 • SD - "SACL Defaulted" - A default mechanism, rather than the
277 original provider of the security descriptor, provided the
278 SACL.
279
280 • DT - "DACL Trusted"
281
282 • SS - "Server Security"
283
284 • DR - "DACL Inheritance Required" - Indicates a required
285 security descriptor in which the DACL is set up to support
286 automatic propagation of inheritable access control entries
287 (ACEs) to existing child objects.
288
289 • SR - "SACL Inheritance Required" - Indicates a required
290 security descriptor in which the SACL is set up to support
291 automatic propagation of inheritable ACEs to existing child
292 objects.
293
294 • DI - "DACL Auto Inherited" - Indicates a security descriptor
295 in which the DACL is set up to support automatic propagation
296 of inheritable access control entries (ACEs) to existing
297 child objects.
298
299 • SI - "SACL Auto Inherited" - Indicates a security descriptor
300 in which the SACL is set up to support automatic propagation
301 of inheritable ACEs to existing child objects.
302
303 • PD - "DACL Protected" - Prevents the DACL of the security
304 descriptor from being modified by inheritable ACEs.
305
306 • PS - "SACL Protected" - Prevents the SACL of the security
307 descriptor from being modified by inheritable ACEs.
308
309 • RM - "RM Control Valid" - Indicates that the resource
310 manager control is valid.
311
312 • SR - "Self Relative" - Indicates a self-relative security
313 descriptor.
314
315
316 The revision of the ACL specifies the internal Windows NT ACL revision
317 for the security descriptor. If not specified it defaults to 1. Using
318 values other than 1 may cause strange behaviour.
319
320 The owner and group specify the owner and group sids for the object. If
321 a SID in the format S-1-x-y-z is specified this is used, otherwise the
322 name specified is resolved using the server on which the file or
323 directory resides.
324
325 ACEs are specified with an "ACL:" prefix, and define permissions
326 granted to an SID. The SID again can be specified in S-1-x-y-z format
327 or as a name in which case it is resolved against the server on which
328 the file or directory resides. The type, flags and mask values
329 determine the type of access granted to the SID.
330
331 The type can be either ALLOWED or DENIED to allow/deny access to the
332 SID.
333
334 The flags field defines how the ACE should be considered when
335 performing inheritance. smbcacls uses these flags when run with
336 --propagate-inheritance.
337
338 Flags can be specified as decimal or hexadecimal values, or with the
339 respective (XX) aliases, separated by a vertical bar "|".
340
341 • (OI) Object Inherit 0x1
342
343 • (CI) Container Inherit 0x2
344
345 • (NP) No Propagate Inherit 0x4
346
347 • (IO) Inherit Only 0x8
348
349 • (I) ACE was inherited 0x10
350
351
352 The mask is a value which expresses the access right granted to the
353 SID. It can be given as a decimal or hexadecimal value, or by using one
354 of the following text strings which map to the NT file permissions of
355 the same name.
356
357 • R - Allow read access
358
359 • W - Allow write access
360
361 • X - Execute permission on the object
362
363 • D - Delete the object
364
365 • P - Change permissions
366
367 • O - Take ownership
368
369
370 The following combined permissions can be specified:
371
372 • READ - Equivalent to 'RX' permissions
373
374 • CHANGE - Equivalent to 'RXWD' permissions
375
376 • FULL - Equivalent to 'RWXDPO' permissions
377
379 Per-ACE inheritance flags can be set in the ACE flags field. By
380 default, inheritable ACEs e.g. those marked for object inheritance (OI)
381 or container inheritance (CI), are not propagated to sub-files or
382 folders. However, with the --propagate-inheritance argument specified,
383 such ACEs are automatically propagated according to some inheritance
384 rules.
385
386 • Inheritable (OI)(OI) ACE flags can only be applied to
387 folders.
388
389 • Any inheritable ACEs applied to sub-files or folders are
390 marked with the inherited (I) flag. Inheritable ACE(s) are
391 applied to folders unless the no propagation (NP) flag is
392 set.
393
394 • When an ACE with the (OI) flag alone set is progagated to a
395 child folder the inheritance only flag (IO) is also applied.
396 This indicates the permissions associated with the ACE don't
397 apply to the folder itself (only to it's child files). When
398 applying the ACE to a child file the ACE is inherited as
399 normal.
400
401 • When an ace with the (CI) flag alone set is propagated to a
402 child file there is no effect, when propagated to a child
403 folder it is inherited as normal.
404
405 • When an ACE that has both (OI) & (CI) flags set the ACE is
406 inherited as normal by both folders and files.
407
408
409 (OI)(READ) added to parent folder
410
411 +-parent/ (OI)(READ)
412 | +-file.1 (I)(READ)
413 | +-nested/ (OI)(IO)(I)(READ)
414 | +-file.2 (I)(READ)
415
416 (CI)(READ) added to parent folder
417
418 +-parent/ (CI)(READ)
419 | +-file.1
420 | +-nested/ (CI)(I)(READ)
421 | +-file.2
422
423 (OI)(CI)(READ) added to parent folder
424
425 +-parent/ (OI)(CI)(READ)
426 | +-file.1 (I)(READ)
427 | +-nested/ (OI)(CI)(I)(READ)
428 | +-file.2 (I)(READ)
429
430 (OI)(NP)(READ) added to parent folder
431
432 +-oi_dir/ (OI)(NP)(READ)
433 | +-file.1 (I)(READ)
434 | +-nested/
435 | +-file.2
436
437 (CI)(NP)(READ) added to parent folder
438
439 +-oi_dir/ (CI)(NP)(READ)
440 | +-file.1
441 | +-nested/ (I)(READ)
442 | +-file.2
443
444 (OI)(CI)(NP)(READ) added to parent folder
445
446 +-parent/ (CI)(OI)(NP)(READ)
447 | +-file.1 (I)(READ)
448 | +-nested/ (I)(READ)
449 | +-file.2
450
451 Files and folders with protected ACLs do not allow inheritable
452 permissions (set with -I). Such objects will not receive ACEs flagged
453 for inheritance with (CI) or (OI).
454
456 The smbcacls program sets the exit status depending on the success or
457 otherwise of the operations performed. The exit status may be one of
458 the following values.
459
460 If the operation succeeded, smbcacls returns and exit status of 0. If
461 smbcacls couldn't connect to the specified server, or there was an
462 error getting or setting the ACLs, an exit status of 1 is returned. If
463 there was an error parsing any command line arguments, an exit status
464 of 2 is returned.
465
467 This man page is part of version 4.14.5 of the Samba suite.
468
470 The original Samba software and related utilities were created by
471 Andrew Tridgell. Samba is now developed by the Samba Team as an Open
472 Source project similar to the way the Linux kernel is developed.
473
474 smbcacls was written by Andrew Tridgell and Tim Potter.
475
476 The conversion to DocBook for Samba 2.2 was done by Gerald Carter. The
477 conversion to DocBook XML 4.2 for Samba 3.0 was done by Alexander
478 Bokovoy.
479
480
481
482Samba 4.14.5 06/01/2021 SMBCACLS(1)