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=ACLS] [-C|--chown=USERNAME]
11 [-G|--chgrp=GROUPNAME] [-I|--inherit=STRING] [--propagate-inheritance]
12 [--numeric] [--sddl] [--query-security-info=INT]
13 [--set-security-info=INT] [-t|--test-args] [--domain-sid=SID]
14 [-x|--maximum-access] [-?|--help] [--usage]
15 [-d|--debuglevel=DEBUGLEVEL] [--debug-stdout]
16 [--configfile=CONFIGFILE] [--option=name=value]
17 [-l|--log-basename=LOGFILEBASE] [--leak-report] [--leak-report-full]
18 [-R|--name-resolve=NAME-RESOLVE-ORDER]
19 [-O|--socket-options=SOCKETOPTIONS] [-m|--max-protocol=MAXPROTOCOL]
20 [-n|--netbiosname=NETBIOSNAME] [--netbios-scope=SCOPE]
21 [-W|--workgroup=WORKGROUP] [--realm=REALM]
22 [-U|--user=[DOMAIN/]USERNAME[%PASSWORD]] [-N|--no-pass]
23 [--password=STRING] [--pw-nt-hash] [-A|--authentication-file=FILE]
24 [-P|--machine-pass] [--simple-bind-dn=DN]
25 [--use-kerberos=desired|required|off] [--use-krb5-ccache=CCACHE]
26 [--use-winbind-ccache] [--client-protection=sign|encrypt|off]
27 [-V|--version]
28
30 This tool is part of the samba(7) suite.
31
32 The smbcacls program manipulates NT Access Control Lists (ACLs) on SMB
33 file shares. An ACL is comprised zero or more Access Control Entries
34 (ACEs), which define access restrictions for a specific user or group.
35
37 The following options are available to the smbcacls program. The format
38 of ACLs is described in the section ACL FORMAT
39
40 -a|--add acl
41 Add the entries specified to the ACL. Existing access control
42 entries are unchanged.
43
44 -M|--modify acl
45 Modify the mask value (permissions) for the ACEs specified on the
46 command line. An error will be printed for each ACE specified that
47 was not already present in the object's ACL.
48
49 -D|--delete acl
50 Delete any ACEs specified on the command line. An error will be
51 printed for each ACE specified that was not already present in the
52 object's ACL.
53
54 -S|--set acl
55 This command sets the ACL on the object with only what is specified
56 on the command line. Any existing ACL is erased. Note that the ACL
57 specified must contain at least a revision, type, owner and group
58 for the call to succeed.
59
60 -C|--chown name
61 The owner of a file or directory can be changed to the name given
62 using the -C option. The name can be a sid in the form S-1-x-y-z or
63 a name resolved against the server specified in the first argument.
64
65 This command is a shortcut for -M OWNER:name.
66
67 -G|--chgrp name
68 The group owner of a file or directory can be changed to the name
69 given using the -G option. The name can be a sid in the form
70 S-1-x-y-z or a name resolved against the server specified n the
71 first argument.
72
73 This command is a shortcut for -M GROUP:name.
74
75 -I|--inherit allow|remove|copy
76 Set or unset the windows "Allow inheritable permissions" check box
77 using the -I option. To set the check box pass allow. To unset the
78 check box pass either remove or copy. Remove will remove all
79 inherited ACEs. Copy will copy all the inherited ACEs.
80
81 --propagate-inheritance
82 Add, modify, delete or set ACEs on an entire directory tree
83 according to the inheritance flags. Refer to the INHERITANCE
84 section for details.
85
86 --numeric
87 This option displays all ACL information in numeric format. The
88 default is to convert SIDs to names and ACE types and masks to a
89 readable string format.
90
91 -m|--max-protocol PROTOCOL_NAME
92 This allows the user to select the highest SMB protocol level that
93 smbcacls will use to connect to the server. By default this is set
94 to NT1, which is the highest available SMB1 protocol. To connect
95 using SMB2 or SMB3 protocol, use the strings SMB2 or SMB3
96 respectively. Note that to connect to a Windows 2012 server with
97 encrypted transport selecting a max-protocol of SMB3 is required.
98
99 -t|--test-args
100 Don't actually do anything, only validate the correctness of the
101 arguments.
102
103 --query-security-info FLAGS
104 The security-info flags for queries.
105
106 --set-security-info FLAGS
107 The security-info flags for queries.
108
109 --sddl
110 Output and input acls in sddl format.
111
112 --domain-sid SID
113 SID used for sddl processing.
114
115 -x|--maximum-access
116 When displaying an ACL additionally query the server for effective
117 maximum permissions. Note that this is only supported with SMB
118 protocol version 2 or higher.
119
120 -?|--help
121 Print a summary of command line options.
122
123 --usage
124 Display brief usage message.
125
126 -d|--debuglevel=DEBUGLEVEL
127 level is an integer from 0 to 10. The default value if this
128 parameter is not specified is 1 for client applications.
129
130 The higher this value, the more detail will be logged to the log
131 files about the activities of the server. At level 0, only critical
132 errors and serious warnings will be logged. Level 1 is a reasonable
133 level for day-to-day running - it generates a small amount of
134 information about operations carried out.
135
136 Levels above 1 will generate considerable amounts of log data, and
137 should only be used when investigating a problem. Levels above 3
138 are designed for use only by developers and generate HUGE amounts
139 of log data, most of which is extremely cryptic.
140
141 Note that specifying this parameter here will override the log
142 level parameter in the /etc/samba/smb.conf file.
143
144 --debug-stdout
145 This will redirect debug output to STDOUT. By default all clients
146 are logging to STDERR.
147
148 --configfile=<configuration file>
149 The file specified contains the configuration details required by
150 the client. The information in this file can be general for client
151 and server or only provide client specific like options such as
152 client smb encrypt. See /etc/samba/smb.conf for more information.
153 The default configuration file name is determined at compile time.
154
155 --option=<name>=<value>
156 Set the smb.conf(5) option "<name>" to value "<value>" from the
157 command line. This overrides compiled-in defaults and options read
158 from the configuration file. If a name or a value includes a space,
159 wrap whole --option=name=value into quotes.
160
161 -l|--log-basename=logdirectory
162 Base directory name for log/debug files. The extension ".progname"
163 will be appended (e.g. log.smbclient, log.smbd, etc...). The log
164 file is never removed by the client.
165
166 --leak-report
167 Enable talloc leak reporting on exit.
168
169 --leak-report-full
170 Enable full talloc leak reporting on exit.
171
172 -V|--version
173 Prints the program version number.
174
175 -R|--name-resolve=NAME-RESOLVE-ORDER
176 This option is used to determine what naming services and in what
177 order to resolve host names to IP addresses. The option takes a
178 space-separated string of different name resolution options. The
179 best ist to wrap the whole --name-resolve=NAME-RESOLVE-ORDER into
180 quotes.
181
182 The options are: "lmhosts", "host", "wins" and "bcast". They cause
183 names to be resolved as follows:
184
185 • lmhosts: Lookup an IP address in the Samba lmhosts file.
186 If the line in lmhosts has no name type attached to the
187 NetBIOS name (see the lmhosts(5) for details) then any
188 name type matches for lookup.
189
190 • host: Do a standard host name to IP address resolution,
191 using the system /etc/hosts, NIS, or DNS lookups. This
192 method of name resolution is operating system dependent,
193 for instance on IRIX or Solaris this may be controlled
194 by the /etc/nsswitch.conf file). Note that this method
195 is only used if the NetBIOS name type being queried is
196 the 0x20 (server) name type, otherwise it is ignored.
197
198 • wins: Query a name with the IP address listed in the
199 wins server parameter. If no WINS server has been
200 specified this method will be ignored.
201
202 • bcast: Do a broadcast on each of the known local
203 interfaces listed in the interfaces parameter. This is
204 the least reliable of the name resolution methods as it
205 depends on the target host being on a locally connected
206 subnet.
207
208 If this parameter is not set then the name resolve order defined in
209 the /etc/samba/smb.conf file parameter (name resolve order) will be
210 used.
211
212 The default order is lmhosts, host, wins, bcast. Without this
213 parameter or any entry in the name resolve order parameter of the
214 /etc/samba/smb.conf file, the name resolution methods will be
215 attempted in this order.
216
217 -O|--socket-options=SOCKETOPTIONS
218 TCP socket options to set on the client socket. See the socket
219 options parameter in the /etc/samba/smb.conf manual page for the
220 list of valid options.
221
222 -m|--max-protocol=MAXPROTOCOL
223 The value of the parameter (a string) is the highest protocol level
224 that will be supported by the client.
225
226 Note that specifying this parameter here will override the client
227 max protocol parameter in the /etc/samba/smb.conf file.
228
229 -n|--netbiosname=NETBIOSNAME
230 This option allows you to override the NetBIOS name that Samba uses
231 for itself. This is identical to setting the netbios name parameter
232 in the /etc/samba/smb.conf file. However, a command line setting
233 will take precedence over settings in /etc/samba/smb.conf.
234
235 --netbios-scope=SCOPE
236 This specifies a NetBIOS scope that nmblookup will use to
237 communicate with when generating NetBIOS names. For details on the
238 use of NetBIOS scopes, see rfc1001.txt and rfc1002.txt. NetBIOS
239 scopes are very rarely used, only set this parameter if you are the
240 system administrator in charge of all the NetBIOS systems you
241 communicate with.
242
243 -W|--workgroup=WORKGROUP
244 Set the SMB domain of the username. This overrides the default
245 domain which is the domain defined in smb.conf. If the domain
246 specified is the same as the servers NetBIOS name, it causes the
247 client to log on using the servers local SAM (as opposed to the
248 Domain SAM).
249
250 Note that specifying this parameter here will override the
251 workgroup parameter in the /etc/samba/smb.conf file.
252
253 -r|--realm=REALM
254 Set the realm for the domain.
255
256 Note that specifying this parameter here will override the realm
257 parameter in the /etc/samba/smb.conf file.
258
259 -U|--user=[DOMAIN\]USERNAME[%PASSWORD]
260 Sets the SMB username or username and password.
261
262 If %PASSWORD is not specified, the user will be prompted. The
263 client will first check the USER environment variable (which is
264 also permitted to also contain the password separated by a %), then
265 the LOGNAME variable (which is not permitted to contain a password)
266 and if either exists, the value is used. If these environmental
267 variables are not found, the username found in a Kerberos
268 Credentials cache may be used.
269
270 A third option is to use a credentials file which contains the
271 plaintext of the username and password. This option is mainly
272 provided for scripts where the admin does not wish to pass the
273 credentials on the command line or via environment variables. If
274 this method is used, make certain that the permissions on the file
275 restrict access from unwanted users. See the -A for more details.
276
277 Be cautious about including passwords in scripts or passing
278 user-supplied values onto the command line. For security it is
279 better to let the Samba client tool ask for the password if needed,
280 or obtain the password once with kinit.
281
282 While Samba will attempt to scrub the password from the process
283 title (as seen in ps), this is after startup and so is subject to a
284 race.
285
286 -N|--no-pass
287 If specified, this parameter suppresses the normal password prompt
288 from the client to the user. This is useful when accessing a
289 service that does not require a password.
290
291 Unless a password is specified on the command line or this
292 parameter is specified, the client will request a password.
293
294 If a password is specified on the command line and this option is
295 also defined the password on the command line will be silently
296 ignored and no password will be used.
297
298 --password
299 Specify the password on the commandline.
300
301 Be cautious about including passwords in scripts or passing
302 user-supplied values onto the command line. For security it is
303 better to let the Samba client tool ask for the password if needed,
304 or obtain the password once with kinit.
305
306 If --password is not specified, the tool will check the PASSWD
307 environment variable, followed by PASSWD_FD which is expected to
308 contain an open file descriptor (FD) number.
309
310 Finally it will check PASSWD_FILE (containing a file path to be
311 opened). The file should only contain the password. Make certain
312 that the permissions on the file restrict access from unwanted
313 users!
314
315 While Samba will attempt to scrub the password from the process
316 title (as seen in ps), this is after startup and so is subject to a
317 race.
318
319 --pw-nt-hash
320 The supplied password is the NT hash.
321
322 -A|--authentication-file=filename
323 This option allows you to specify a file from which to read the
324 username and password used in the connection. The format of the
325 file is:
326
327 username = <value>
328 password = <value>
329 domain = <value>
330
331
332 Make certain that the permissions on the file restrict access from
333 unwanted users!
334
335 -P|--machine-pass
336 Use stored machine account password.
337
338 --simple-bind-dn=DN
339 DN to use for a simple bind.
340
341 --use-kerberos=desired|required|off
342 This parameter determines whether Samba client tools will try to
343 authenticate using Kerberos. For Kerberos authentication you need
344 to use dns names instead of IP addresses when connecting to a
345 service.
346
347 Note that specifying this parameter here will override the client
348 use kerberos parameter in the /etc/samba/smb.conf file.
349
350 --use-krb5-ccache=CCACHE
351 Specifies the credential cache location for Kerberos
352 authentication.
353
354 This will set --use-kerberos=required too.
355
356 --use-winbind-ccache
357 Try to use the credential cache by winbind.
358
359 --client-protection=sign|encrypt|off
360 Sets the connection protection the client tool should use.
361
362 Note that specifying this parameter here will override the client
363 protection parameter in the /etc/samba/smb.conf file.
364
365 In case you need more fine grained control you can use:
366 --option=clientsmbencrypt=OPTION, --option=clientipcsigning=OPTION,
367 --option=clientsigning=OPTION.
368
370 The format of an ACL is one or more entries separated by either commas
371 or newlines. An ACL entry is one of the following:
372
373 REVISION:<revision number>
374 OWNER:<sid or name>
375 GROUP:<sid or name>
376 ACL:<sid or name>:<type>/<flags>/<mask>
377
378 Control bits related to automatic inheritance
379
380 • OD - "Owner Defaulted" - Indicates that the SID of the owner
381 of the security descriptor was provided by a default
382 mechanism.
383
384 • GD - "Group Defaulted" - Indicates that the SID of the
385 security descriptor group was provided by a default
386 mechanism.
387
388 • DP - "DACL Present" - Indicates a security descriptor that
389 has a discretionary access control list (DACL).
390
391 • DD - "DACL Defaulted" - Indicates a security descriptor with
392 a default DACL.
393
394 • SP - "SACL Present" - Indicates a security descriptor that
395 has a system access control list (SACL).
396
397 • SD - "SACL Defaulted" - A default mechanism, rather than the
398 original provider of the security descriptor, provided the
399 SACL.
400
401 • DT - "DACL Trusted"
402
403 • SS - "Server Security"
404
405 • DR - "DACL Inheritance Required" - Indicates a required
406 security descriptor in which the DACL is set up to support
407 automatic propagation of inheritable access control entries
408 (ACEs) to existing child objects.
409
410 • SR - "SACL Inheritance Required" - Indicates a required
411 security descriptor in which the SACL is set up to support
412 automatic propagation of inheritable ACEs to existing child
413 objects.
414
415 • DI - "DACL Auto Inherited" - Indicates a security descriptor
416 in which the DACL is set up to support automatic propagation
417 of inheritable access control entries (ACEs) to existing
418 child objects.
419
420 • SI - "SACL Auto Inherited" - Indicates a security descriptor
421 in which the SACL is set up to support automatic propagation
422 of inheritable ACEs to existing child objects.
423
424 • PD - "DACL Protected" - Prevents the DACL of the security
425 descriptor from being modified by inheritable ACEs.
426
427 • PS - "SACL Protected" - Prevents the SACL of the security
428 descriptor from being modified by inheritable ACEs.
429
430 • RM - "RM Control Valid" - Indicates that the resource
431 manager control is valid.
432
433 • SR - "Self Relative" - Indicates a self-relative security
434 descriptor.
435
436
437 The revision of the ACL specifies the internal Windows NT ACL revision
438 for the security descriptor. If not specified it defaults to 1. Using
439 values other than 1 may cause strange behaviour.
440
441 The owner and group specify the owner and group sids for the object. If
442 a SID in the format S-1-x-y-z is specified this is used, otherwise the
443 name specified is resolved using the server on which the file or
444 directory resides.
445
446 ACEs are specified with an "ACL:" prefix, and define permissions
447 granted to an SID. The SID again can be specified in S-1-x-y-z format
448 or as a name in which case it is resolved against the server on which
449 the file or directory resides. The type, flags and mask values
450 determine the type of access granted to the SID.
451
452 The type can be either ALLOWED or DENIED to allow/deny access to the
453 SID.
454
455 The flags field defines how the ACE should be considered when
456 performing inheritance. smbcacls uses these flags when run with
457 --propagate-inheritance.
458
459 Flags can be specified as decimal or hexadecimal values, or with the
460 respective (XX) aliases, separated by a vertical bar "|".
461
462 • (OI) Object Inherit 0x1
463
464 • (CI) Container Inherit 0x2
465
466 • (NP) No Propagate Inherit 0x4
467
468 • (IO) Inherit Only 0x8
469
470 • (I) ACE was inherited 0x10
471
472
473 The mask is a value which expresses the access right granted to the
474 SID. It can be given as a decimal or hexadecimal value, or by using one
475 of the following text strings which map to the NT file permissions of
476 the same name.
477
478 • R - Allow read access
479
480 • W - Allow write access
481
482 • X - Execute permission on the object
483
484 • D - Delete the object
485
486 • P - Change permissions
487
488 • O - Take ownership
489
490
491 The following combined permissions can be specified:
492
493 • READ - Equivalent to 'RX' permissions
494
495 • CHANGE - Equivalent to 'RXWD' permissions
496
497 • FULL - Equivalent to 'RWXDPO' permissions
498
500 Per-ACE inheritance flags can be set in the ACE flags field. By
501 default, inheritable ACEs e.g. those marked for object inheritance (OI)
502 or container inheritance (CI), are not propagated to sub-files or
503 folders. However, with the --propagate-inheritance argument specified,
504 such ACEs are automatically propagated according to some inheritance
505 rules.
506
507 • Inheritable (OI)(OI) ACE flags can only be applied to
508 folders.
509
510 • Any inheritable ACEs applied to sub-files or folders are
511 marked with the inherited (I) flag. Inheritable ACE(s) are
512 applied to folders unless the no propagation (NP) flag is
513 set.
514
515 • When an ACE with the (OI) flag alone set is propagated to a
516 child folder the inheritance only flag (IO) is also applied.
517 This indicates the permissions associated with the ACE don't
518 apply to the folder itself (only to it's child files). When
519 applying the ACE to a child file the ACE is inherited as
520 normal.
521
522 • When an ace with the (CI) flag alone set is propagated to a
523 child file there is no effect, when propagated to a child
524 folder it is inherited as normal.
525
526 • When an ACE that has both (OI) & (CI) flags set the ACE is
527 inherited as normal by both folders and files.
528
529
530 (OI)(READ) added to parent folder
531
532 +-parent/ (OI)(READ)
533 | +-file.1 (I)(READ)
534 | +-nested/ (OI)(IO)(I)(READ)
535 | +-file.2 (I)(READ)
536
537 (CI)(READ) added to parent folder
538
539 +-parent/ (CI)(READ)
540 | +-file.1
541 | +-nested/ (CI)(I)(READ)
542 | +-file.2
543
544 (OI)(CI)(READ) added to parent folder
545
546 +-parent/ (OI)(CI)(READ)
547 | +-file.1 (I)(READ)
548 | +-nested/ (OI)(CI)(I)(READ)
549 | +-file.2 (I)(READ)
550
551 (OI)(NP)(READ) added to parent folder
552
553 +-oi_dir/ (OI)(NP)(READ)
554 | +-file.1 (I)(READ)
555 | +-nested/
556 | +-file.2
557
558 (CI)(NP)(READ) added to parent folder
559
560 +-oi_dir/ (CI)(NP)(READ)
561 | +-file.1
562 | +-nested/ (I)(READ)
563 | +-file.2
564
565 (OI)(CI)(NP)(READ) added to parent folder
566
567 +-parent/ (CI)(OI)(NP)(READ)
568 | +-file.1 (I)(READ)
569 | +-nested/ (I)(READ)
570 | +-file.2
571
572 Files and folders with protected ACLs do not allow inheritable
573 permissions (set with -I). Such objects will not receive ACEs flagged
574 for inheritance with (CI) or (OI).
575
577 The smbcacls program sets the exit status depending on the success or
578 otherwise of the operations performed. The exit status may be one of
579 the following values.
580
581 If the operation succeeded, smbcacls returns and exit status of 0. If
582 smbcacls couldn't connect to the specified server, or there was an
583 error getting or setting the ACLs, an exit status of 1 is returned. If
584 there was an error parsing any command line arguments, an exit status
585 of 2 is returned.
586
588 This man page is part of version 4.17.5 of the Samba suite.
589
591 The original Samba software and related utilities were created by
592 Andrew Tridgell. Samba is now developed by the Samba Team as an Open
593 Source project similar to the way the Linux kernel is developed.
594
595 smbcacls was written by Andrew Tridgell and Tim Potter.
596
597 The conversion to DocBook for Samba 2.2 was done by Gerald Carter. The
598 conversion to DocBook XML 4.2 for Samba 3.0 was done by Alexander
599 Bokovoy.
600
601
602
603Samba 4.17.5 01/26/2023 SMBCACLS(1)