1SMBCACLS(1)                      User Commands                     SMBCACLS(1)
2
3
4

NAME

6       smbcacls - Set or get ACLs on an NT file or directory names
7

SYNOPSIS

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] [--numeric] [-t]
12        [-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

DESCRIPTION

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

OPTIONS

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 acls. Copy will copy all the inherited acls.
67
68       --numeric
69           This option displays all ACL information in numeric format. The
70           default is to convert SIDs to names and ACE types and masks to a
71           readable string format.
72
73       -m|--max-protocol PROTOCOL_NAME
74           This allows the user to select the highest SMB protocol level that
75           smbcacls will use to connect to the server. By default this is set
76           to NT1, which is the highest available SMB1 protocol. To connect
77           using SMB2 or SMB3 protocol, use the strings SMB2 or SMB3
78           respectively. Note that to connect to a Windows 2012 server with
79           encrypted transport selecting a max-protocol of SMB3 is required.
80
81       -t|--test-args
82           Don't actually do anything, only validate the correctness of the
83           arguments.
84
85       --query-security-info FLAGS
86           The security-info flags for queries.
87
88       --set-security-info FLAGS
89           The security-info flags for queries.
90
91       --sddl
92           Output and input acls in sddl format.
93
94       --domain-sid SID
95           SID used for sddl processing.
96
97       -x|--maximum-access
98           When displaying an ACL additionally query the server for effective
99           maximum permissions. Note that this is only supported with SMB
100           protocol version 2 or higher.
101
102       -d|--debuglevel=level
103           level is an integer from 0 to 10. The default value if this
104           parameter is not specified is 0.
105
106           The higher this value, the more detail will be logged to the log
107           files about the activities of the server. At level 0, only critical
108           errors and serious warnings will be logged. Level 1 is a reasonable
109           level for day-to-day running - it generates a small amount of
110           information about operations carried out.
111
112           Levels above 1 will generate considerable amounts of log data, and
113           should only be used when investigating a problem. Levels above 3
114           are designed for use only by developers and generate HUGE amounts
115           of log data, most of which is extremely cryptic.
116
117           Note that specifying this parameter here will override the log
118           level parameter in the smb.conf file.
119
120       -V|--version
121           Prints the program version number.
122
123       -s|--configfile=<configuration file>
124           The file specified contains the configuration details required by
125           the server. The information in this file includes server-specific
126           information such as what printcap file to use, as well as
127           descriptions of all the services that the server is to provide. See
128           smb.conf for more information. The default configuration file name
129           is determined at compile time.
130
131       -l|--log-basename=logdirectory
132           Base directory name for log/debug files. The extension ".progname"
133           will be appended (e.g. log.smbclient, log.smbd, etc...). The log
134           file is never removed by the client.
135
136       --option=<name>=<value>
137           Set the smb.conf(5) option "<name>" to value "<value>" from the
138           command line. This overrides compiled-in defaults and options read
139           from the configuration file.
140
141       -N|--no-pass
142           If specified, this parameter suppresses the normal password prompt
143           from the client to the user. This is useful when accessing a
144           service that does not require a password.
145
146           Unless a password is specified on the command line or this
147           parameter is specified, the client will request a password.
148
149           If a password is specified on the command line and this option is
150           also defined the password on the command line will be silently
151           ignored and no password will be used.
152
153       -k|--kerberos
154           Try to authenticate with kerberos. Only useful in an Active
155           Directory environment.
156
157       -C|--use-ccache
158           Try to use the credentials cached by winbind.
159
160       -A|--authentication-file=filename
161           This option allows you to specify a file from which to read the
162           username and password used in the connection. The format of the
163           file is
164
165               username = <value>
166               password = <value>
167               domain   = <value>
168
169           Make certain that the permissions on the file restrict access from
170           unwanted users.
171
172       -U|--user=username[%password]
173           Sets the SMB username or username and password.
174
175           If %password is not specified, the user will be prompted. The
176           client will first check the USER environment variable, then the
177           LOGNAME variable and if either exists, the string is uppercased. If
178           these environmental variables are not found, the username GUEST is
179           used.
180
181           A third option is to use a credentials file which contains the
182           plaintext of the username and password. This option is mainly
183           provided for scripts where the admin does not wish to pass the
184           credentials on the command line or via environment variables. If
185           this method is used, make certain that the permissions on the file
186           restrict access from unwanted users. See the -A for more details.
187
188           Be cautious about including passwords in scripts. Also, on many
189           systems the command line of a running process may be seen via the
190           ps command. To be safe always allow rpcclient to prompt for a
191           password and type it in directly.
192
193       -S|--signing on|off|required
194           Set the client signing state.
195
196       -P|--machine-pass
197           Use stored machine account password.
198
199       -e|--encrypt
200           This command line parameter requires the remote server support the
201           UNIX extensions or that the SMB3 protocol has been selected.
202           Requests that the connection be encrypted. Negotiates SMB
203           encryption using either SMB3 or POSIX extensions via GSSAPI. Uses
204           the given credentials for the encryption negotiation (either
205           kerberos or NTLMv1/v2 if given domain/username/password triple.
206           Fails the connection if encryption cannot be negotiated.
207
208       --pw-nt-hash
209           The supplied password is the NT hash.
210
211       -n|--netbiosname <primary NetBIOS name>
212           This option allows you to override the NetBIOS name that Samba uses
213           for itself. This is identical to setting the netbios name parameter
214           in the smb.conf file. However, a command line setting will take
215           precedence over settings in smb.conf.
216
217       -i|--scope <scope>
218           This specifies a NetBIOS scope that nmblookup will use to
219           communicate with when generating NetBIOS names. For details on the
220           use of NetBIOS scopes, see rfc1001.txt and rfc1002.txt. NetBIOS
221           scopes are very rarely used, only set this parameter if you are the
222           system administrator in charge of all the NetBIOS systems you
223           communicate with.
224
225       -W|--workgroup=domain
226           Set the SMB domain of the username. This overrides the default
227           domain which is the domain defined in smb.conf. If the domain
228           specified is the same as the servers NetBIOS name, it causes the
229           client to log on using the servers local SAM (as opposed to the
230           Domain SAM).
231
232       -O|--socket-options socket options
233           TCP socket options to set on the client socket. See the socket
234           options parameter in the smb.conf manual page for the list of valid
235           options.
236
237       -?|--help
238           Print a summary of command line options.
239
240       --usage
241           Display brief usage message.
242

ACL FORMAT

244       The format of an ACL is one or more entries separated by either commas
245       or newlines. An ACL entry is one of the following:
246
247           REVISION:<revision number>
248           OWNER:<sid or name>
249           GROUP:<sid or name>
250           ACL:<sid or name>:<type>/<flags>/<mask>
251
252       The revision of the ACL specifies the internal Windows NT ACL revision
253       for the security descriptor. If not specified it defaults to 1. Using
254       values other than 1 may cause strange behaviour.
255
256       The owner and group specify the owner and group sids for the object. If
257       a SID in the format S-1-x-y-z is specified this is used, otherwise the
258       name specified is resolved using the server on which the file or
259       directory resides.
260
261       ACEs are specified with an "ACL:" prefix, and define permissions
262       granted to an SID. The SID again can be specified in S-1-x-y-z format
263       or as a name in which case it is resolved against the server on which
264       the file or directory resides. The type, flags and mask values
265       determine the type of access granted to the SID.
266
267       The type can be either ALLOWED or DENIED to allow/deny access to the
268       SID. The flags values are generally zero for file ACEs and either 9 or
269       2 for directory ACEs. Some common flags are:
270
271              ·   #define SEC_ACE_FLAG_OBJECT_INHERIT 0x1
272
273              ·   #define SEC_ACE_FLAG_CONTAINER_INHERIT 0x2
274
275              ·   #define SEC_ACE_FLAG_NO_PROPAGATE_INHERIT 0x4
276
277              ·   #define SEC_ACE_FLAG_INHERIT_ONLY 0x8
278
279
280       At present, flags can only be specified as decimal or hexadecimal
281       values.
282
283       The mask is a value which expresses the access right granted to the
284       SID. It can be given as a decimal or hexadecimal value, or by using one
285       of the following text strings which map to the NT file permissions of
286       the same name.
287
288              ·   R - Allow read access
289
290              ·   W - Allow write access
291
292              ·   X - Execute permission on the object
293
294              ·   D - Delete the object
295
296              ·   P - Change permissions
297
298              ·   O - Take ownership
299
300
301       The following combined permissions can be specified:
302
303              ·   READ - Equivalent to 'RX' permissions
304
305              ·   CHANGE - Equivalent to 'RXWD' permissions
306
307              ·   FULL - Equivalent to 'RWXDPO' permissions
308

EXIT STATUS

310       The smbcacls program sets the exit status depending on the success or
311       otherwise of the operations performed. The exit status may be one of
312       the following values.
313
314       If the operation succeeded, smbcacls returns and exit status of 0. If
315       smbcacls couldn't connect to the specified server, or there was an
316       error getting or setting the ACLs, an exit status of 1 is returned. If
317       there was an error parsing any command line arguments, an exit status
318       of 2 is returned.
319

VERSION

321       This man page is part of version 4.12.2 of the Samba suite.
322

AUTHOR

324       The original Samba software and related utilities were created by
325       Andrew Tridgell. Samba is now developed by the Samba Team as an Open
326       Source project similar to the way the Linux kernel is developed.
327
328       smbcacls was written by Andrew Tridgell and Tim Potter.
329
330       The conversion to DocBook for Samba 2.2 was done by Gerald Carter. The
331       conversion to DocBook XML 4.2 for Samba 3.0 was done by Alexander
332       Bokovoy.
333
334
335
336Samba 4.12.2                      04/28/2020                       SMBCACLS(1)
Impressum