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

ACL FORMAT

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

EXIT STATUS

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

VERSION

316       This man page is part of version 4.9.1 of the Samba suite.
317

AUTHOR

319       The original Samba software and related utilities were created by
320       Andrew Tridgell. Samba is now developed by the Samba Team as an Open
321       Source project similar to the way the Linux kernel is developed.
322
323       smbcacls was written by Andrew Tridgell and Tim Potter.
324
325       The conversion to DocBook for Samba 2.2 was done by Gerald Carter. The
326       conversion to DocBook XML 4.2 for Samba 3.0 was done by Alexander
327       Bokovoy.
328
329
330
331Samba 4.9.1                       05/11/2019                       SMBCACLS(1)
Impressum