| 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: 10/29/2012
|
|---|
| 6 | .\" Manual: User Commands
|
|---|
| 7 | .\" Source: Samba 3.6
|
|---|
| 8 | .\" Language: English
|
|---|
| 9 | .\"
|
|---|
| 10 | .TH "SMBCACLS" "1" "10/29/2012" "Samba 3\&.6" "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"
|
|---|
| 22 | smbcacls \- Set or get ACLs on an NT file or directory names
|
|---|
| 23 | .SH "SYNOPSIS"
|
|---|
| 24 | .HP \w'\ 'u
|
|---|
| 25 | smbcacls {//server/share} {/filename} [\-D|\-\-delete\ acls] [\-M|\-\-modify\ acls] [\-a|\-\-add\ acls] [\-S|\-\-set\ acls] [\-C|\-\-chown\ name] [\-G|\-\-chgrp\ name] [\-I\ allow|romove|copy] [\-\-numeric] [\-t] [\-U\ username] [\-h] [\-d]
|
|---|
| 26 | .SH "DESCRIPTION"
|
|---|
| 27 | .PP
|
|---|
| 28 | This tool is part of the
|
|---|
| 29 | \fBsamba\fR(7)
|
|---|
| 30 | suite\&.
|
|---|
| 31 | .PP
|
|---|
| 32 | The
|
|---|
| 33 | smbcacls
|
|---|
| 34 | program manipulates NT Access Control Lists (ACLs) on SMB file shares\&.
|
|---|
| 35 | .SH "OPTIONS"
|
|---|
| 36 | .PP
|
|---|
| 37 | The following options are available to the
|
|---|
| 38 | smbcacls
|
|---|
| 39 | program\&. The format of ACLs is described in the section ACL FORMAT
|
|---|
| 40 | .PP
|
|---|
| 41 | \-a|\-\-add acls
|
|---|
| 42 | .RS 4
|
|---|
| 43 | Add the ACLs specified to the ACL list\&. Existing access control entries are unchanged\&.
|
|---|
| 44 | .RE
|
|---|
| 45 | .PP
|
|---|
| 46 | \-M|\-\-modify acls
|
|---|
| 47 | .RS 4
|
|---|
| 48 | Modify 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
|
|---|
| 53 | Delete 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
|
|---|
| 58 | This 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
|
|---|
| 63 | The owner of a file or directory can be changed to the name given using the
|
|---|
| 64 | \fI\-C\fR
|
|---|
| 65 | option\&. 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
|
|---|
| 67 | This command is a shortcut for \-M OWNER:name\&.
|
|---|
| 68 | .RE
|
|---|
| 69 | .PP
|
|---|
| 70 | \-G|\-\-chgrp name
|
|---|
| 71 | .RS 4
|
|---|
| 72 | The group owner of a file or directory can be changed to the name given using the
|
|---|
| 73 | \fI\-G\fR
|
|---|
| 74 | option\&. 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
|
|---|
| 76 | This command is a shortcut for \-M GROUP:name\&.
|
|---|
| 77 | .RE
|
|---|
| 78 | .PP
|
|---|
| 79 | \-I|\-\-inherit allow|remove|copy
|
|---|
| 80 | .RS 4
|
|---|
| 81 | Set or unset the windows "Allow inheritable permissions" check box using the
|
|---|
| 82 | \fI\-I\fR
|
|---|
| 83 | option\&. To set the check box pass allow\&. To unset the check box pass either remove or copy\&. Remove will remove all inherited acls\&. Copy will copy all the inherited acls\&.
|
|---|
| 84 | .RE
|
|---|
| 85 | .PP
|
|---|
| 86 | \-\-numeric
|
|---|
| 87 | .RS 4
|
|---|
| 88 | This 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\&.
|
|---|
| 89 | .RE
|
|---|
| 90 | .PP
|
|---|
| 91 | \-t|\-\-test\-args
|
|---|
| 92 | .RS 4
|
|---|
| 93 | Don\'t actually do anything, only validate the correctness of the arguments\&.
|
|---|
| 94 | .RE
|
|---|
| 95 | .PP
|
|---|
| 96 | \-h|\-\-help
|
|---|
| 97 | .RS 4
|
|---|
| 98 | Print a summary of command line options\&.
|
|---|
| 99 | .RE
|
|---|
| 100 | .PP
|
|---|
| 101 | \-d|\-\-debuglevel=level
|
|---|
| 102 | .RS 4
|
|---|
| 103 | \fIlevel\fR
|
|---|
| 104 | is an integer from 0 to 10\&. The default value if this parameter is not specified is 0\&.
|
|---|
| 105 | .sp
|
|---|
| 106 | The 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\&.
|
|---|
| 107 | .sp
|
|---|
| 108 | Levels 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\&.
|
|---|
| 109 | .sp
|
|---|
| 110 | Note that specifying this parameter here will override the
|
|---|
| 111 | \m[blue]\fB\%smb.conf.5.html#\fR\m[]
|
|---|
| 112 | parameter in the
|
|---|
| 113 | smb\&.conf
|
|---|
| 114 | file\&.
|
|---|
| 115 | .RE
|
|---|
| 116 | .PP
|
|---|
| 117 | \-V|\-\-version
|
|---|
| 118 | .RS 4
|
|---|
| 119 | Prints the program version number\&.
|
|---|
| 120 | .RE
|
|---|
| 121 | .PP
|
|---|
| 122 | \-s|\-\-configfile <configuration file>
|
|---|
| 123 | .RS 4
|
|---|
| 124 | The 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
|
|---|
| 125 | smb\&.conf
|
|---|
| 126 | for more information\&. The default configuration file name is determined at compile time\&.
|
|---|
| 127 | .RE
|
|---|
| 128 | .PP
|
|---|
| 129 | \-l|\-\-log\-basename=logdirectory
|
|---|
| 130 | .RS 4
|
|---|
| 131 | Base directory name for log/debug files\&. The extension
|
|---|
| 132 | \fB"\&.progname"\fR
|
|---|
| 133 | will be appended (e\&.g\&. log\&.smbclient, log\&.smbd, etc\&.\&.\&.)\&. The log file is never removed by the client\&.
|
|---|
| 134 | .RE
|
|---|
| 135 | .PP
|
|---|
| 136 | \-N|\-\-no\-pass
|
|---|
| 137 | .RS 4
|
|---|
| 138 | If 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\&.
|
|---|
| 139 | .sp
|
|---|
| 140 | Unless a password is specified on the command line or this parameter is specified, the client will request a password\&.
|
|---|
| 141 | .sp
|
|---|
| 142 | If 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\&.
|
|---|
| 143 | .RE
|
|---|
| 144 | .PP
|
|---|
| 145 | \-k|\-\-kerberos
|
|---|
| 146 | .RS 4
|
|---|
| 147 | Try to authenticate with kerberos\&. Only useful in an Active Directory environment\&.
|
|---|
| 148 | .RE
|
|---|
| 149 | .PP
|
|---|
| 150 | \-C|\-\-use\-ccache
|
|---|
| 151 | .RS 4
|
|---|
| 152 | Try to use the credentials cached by winbind\&.
|
|---|
| 153 | .RE
|
|---|
| 154 | .PP
|
|---|
| 155 | \-A|\-\-authentication\-file=filename
|
|---|
| 156 | .RS 4
|
|---|
| 157 | This 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
|
|---|
| 158 | .sp
|
|---|
| 159 | .if n \{\
|
|---|
| 160 | .RS 4
|
|---|
| 161 | .\}
|
|---|
| 162 | .nf
|
|---|
| 163 | username = <value>
|
|---|
| 164 | password = <value>
|
|---|
| 165 | domain = <value>
|
|---|
| 166 | .fi
|
|---|
| 167 | .if n \{\
|
|---|
| 168 | .RE
|
|---|
| 169 | .\}
|
|---|
| 170 | .sp
|
|---|
| 171 | Make certain that the permissions on the file restrict access from unwanted users\&.
|
|---|
| 172 | .RE
|
|---|
| 173 | .PP
|
|---|
| 174 | \-U|\-\-user=username[%password]
|
|---|
| 175 | .RS 4
|
|---|
| 176 | Sets the SMB username or username and password\&.
|
|---|
| 177 | .sp
|
|---|
| 178 | If %password is not specified, the user will be prompted\&. The client will first check the
|
|---|
| 179 | \fBUSER\fR
|
|---|
| 180 | environment variable, then the
|
|---|
| 181 | \fBLOGNAME\fR
|
|---|
| 182 | variable and if either exists, the string is uppercased\&. If these environmental variables are not found, the username
|
|---|
| 183 | \fBGUEST\fR
|
|---|
| 184 | is used\&.
|
|---|
| 185 | .sp
|
|---|
| 186 | A 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
|
|---|
| 187 | \fI\-A\fR
|
|---|
| 188 | for more details\&.
|
|---|
| 189 | .sp
|
|---|
| 190 | Be cautious about including passwords in scripts\&. Also, on many systems the command line of a running process may be seen via the
|
|---|
| 191 | ps
|
|---|
| 192 | command\&. To be safe always allow
|
|---|
| 193 | rpcclient
|
|---|
| 194 | to prompt for a password and type it in directly\&.
|
|---|
| 195 | .RE
|
|---|
| 196 | .SH "ACL FORMAT"
|
|---|
| 197 | .PP
|
|---|
| 198 | The format of an ACL is one or more ACL entries separated by either commas or newlines\&. An ACL entry is one of the following:
|
|---|
| 199 | .PP
|
|---|
| 200 | .if n \{\
|
|---|
| 201 | .RS 4
|
|---|
| 202 | .\}
|
|---|
| 203 | .nf
|
|---|
| 204 |
|
|---|
| 205 | REVISION:<revision number>
|
|---|
| 206 | OWNER:<sid or name>
|
|---|
| 207 | GROUP:<sid or name>
|
|---|
| 208 | ACL:<sid or name>:<type>/<flags>/<mask>
|
|---|
| 209 | .fi
|
|---|
| 210 | .if n \{\
|
|---|
| 211 | .RE
|
|---|
| 212 | .\}
|
|---|
| 213 | .PP
|
|---|
| 214 | The 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\&.
|
|---|
| 215 | .PP
|
|---|
| 216 | The 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\&.
|
|---|
| 217 | .PP
|
|---|
| 218 | ACLs 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\&.
|
|---|
| 219 | .PP
|
|---|
| 220 | The 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:
|
|---|
| 221 | .sp
|
|---|
| 222 | .RS 4
|
|---|
| 223 | .ie n \{\
|
|---|
| 224 | \h'-04'\(bu\h'+03'\c
|
|---|
| 225 | .\}
|
|---|
| 226 | .el \{\
|
|---|
| 227 | .sp -1
|
|---|
| 228 | .IP \(bu 2.3
|
|---|
| 229 | .\}
|
|---|
| 230 | \fB#define SEC_ACE_FLAG_OBJECT_INHERIT 0x1\fR
|
|---|
| 231 | .RE
|
|---|
| 232 | .sp
|
|---|
| 233 | .RS 4
|
|---|
| 234 | .ie n \{\
|
|---|
| 235 | \h'-04'\(bu\h'+03'\c
|
|---|
| 236 | .\}
|
|---|
| 237 | .el \{\
|
|---|
| 238 | .sp -1
|
|---|
| 239 | .IP \(bu 2.3
|
|---|
| 240 | .\}
|
|---|
| 241 | \fB#define SEC_ACE_FLAG_CONTAINER_INHERIT 0x2\fR
|
|---|
| 242 | .RE
|
|---|
| 243 | .sp
|
|---|
| 244 | .RS 4
|
|---|
| 245 | .ie n \{\
|
|---|
| 246 | \h'-04'\(bu\h'+03'\c
|
|---|
| 247 | .\}
|
|---|
| 248 | .el \{\
|
|---|
| 249 | .sp -1
|
|---|
| 250 | .IP \(bu 2.3
|
|---|
| 251 | .\}
|
|---|
| 252 | \fB#define SEC_ACE_FLAG_NO_PROPAGATE_INHERIT 0x4\fR
|
|---|
| 253 | .RE
|
|---|
| 254 | .sp
|
|---|
| 255 | .RS 4
|
|---|
| 256 | .ie n \{\
|
|---|
| 257 | \h'-04'\(bu\h'+03'\c
|
|---|
| 258 | .\}
|
|---|
| 259 | .el \{\
|
|---|
| 260 | .sp -1
|
|---|
| 261 | .IP \(bu 2.3
|
|---|
| 262 | .\}
|
|---|
| 263 | \fB#define SEC_ACE_FLAG_INHERIT_ONLY 0x8\fR
|
|---|
| 264 | .RE
|
|---|
| 265 | .sp
|
|---|
| 266 | .RE
|
|---|
| 267 | .PP
|
|---|
| 268 | At present flags can only be specified as decimal or hexadecimal values\&.
|
|---|
| 269 | .PP
|
|---|
| 270 | The 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\&.
|
|---|
| 271 | .sp
|
|---|
| 272 | .RS 4
|
|---|
| 273 | .ie n \{\
|
|---|
| 274 | \h'-04'\(bu\h'+03'\c
|
|---|
| 275 | .\}
|
|---|
| 276 | .el \{\
|
|---|
| 277 | .sp -1
|
|---|
| 278 | .IP \(bu 2.3
|
|---|
| 279 | .\}
|
|---|
| 280 | \fIR\fR
|
|---|
| 281 | \- Allow read access
|
|---|
| 282 | .RE
|
|---|
| 283 | .sp
|
|---|
| 284 | .RS 4
|
|---|
| 285 | .ie n \{\
|
|---|
| 286 | \h'-04'\(bu\h'+03'\c
|
|---|
| 287 | .\}
|
|---|
| 288 | .el \{\
|
|---|
| 289 | .sp -1
|
|---|
| 290 | .IP \(bu 2.3
|
|---|
| 291 | .\}
|
|---|
| 292 | \fIW\fR
|
|---|
| 293 | \- Allow write access
|
|---|
| 294 | .RE
|
|---|
| 295 | .sp
|
|---|
| 296 | .RS 4
|
|---|
| 297 | .ie n \{\
|
|---|
| 298 | \h'-04'\(bu\h'+03'\c
|
|---|
| 299 | .\}
|
|---|
| 300 | .el \{\
|
|---|
| 301 | .sp -1
|
|---|
| 302 | .IP \(bu 2.3
|
|---|
| 303 | .\}
|
|---|
| 304 | \fIX\fR
|
|---|
| 305 | \- Execute permission on the object
|
|---|
| 306 | .RE
|
|---|
| 307 | .sp
|
|---|
| 308 | .RS 4
|
|---|
| 309 | .ie n \{\
|
|---|
| 310 | \h'-04'\(bu\h'+03'\c
|
|---|
| 311 | .\}
|
|---|
| 312 | .el \{\
|
|---|
| 313 | .sp -1
|
|---|
| 314 | .IP \(bu 2.3
|
|---|
| 315 | .\}
|
|---|
| 316 | \fID\fR
|
|---|
| 317 | \- Delete the object
|
|---|
| 318 | .RE
|
|---|
| 319 | .sp
|
|---|
| 320 | .RS 4
|
|---|
| 321 | .ie n \{\
|
|---|
| 322 | \h'-04'\(bu\h'+03'\c
|
|---|
| 323 | .\}
|
|---|
| 324 | .el \{\
|
|---|
| 325 | .sp -1
|
|---|
| 326 | .IP \(bu 2.3
|
|---|
| 327 | .\}
|
|---|
| 328 | \fIP\fR
|
|---|
| 329 | \- Change permissions
|
|---|
| 330 | .RE
|
|---|
| 331 | .sp
|
|---|
| 332 | .RS 4
|
|---|
| 333 | .ie n \{\
|
|---|
| 334 | \h'-04'\(bu\h'+03'\c
|
|---|
| 335 | .\}
|
|---|
| 336 | .el \{\
|
|---|
| 337 | .sp -1
|
|---|
| 338 | .IP \(bu 2.3
|
|---|
| 339 | .\}
|
|---|
| 340 | \fIO\fR
|
|---|
| 341 | \- Take ownership
|
|---|
| 342 | .RE
|
|---|
| 343 | .sp
|
|---|
| 344 | .RE
|
|---|
| 345 | .PP
|
|---|
| 346 | The following combined permissions can be specified:
|
|---|
| 347 | .sp
|
|---|
| 348 | .RS 4
|
|---|
| 349 | .ie n \{\
|
|---|
| 350 | \h'-04'\(bu\h'+03'\c
|
|---|
| 351 | .\}
|
|---|
| 352 | .el \{\
|
|---|
| 353 | .sp -1
|
|---|
| 354 | .IP \(bu 2.3
|
|---|
| 355 | .\}
|
|---|
| 356 | \fIREAD\fR
|
|---|
| 357 | \- Equivalent to \'RX\' permissions
|
|---|
| 358 | .RE
|
|---|
| 359 | .sp
|
|---|
| 360 | .RS 4
|
|---|
| 361 | .ie n \{\
|
|---|
| 362 | \h'-04'\(bu\h'+03'\c
|
|---|
| 363 | .\}
|
|---|
| 364 | .el \{\
|
|---|
| 365 | .sp -1
|
|---|
| 366 | .IP \(bu 2.3
|
|---|
| 367 | .\}
|
|---|
| 368 | \fICHANGE\fR
|
|---|
| 369 | \- Equivalent to \'RXWD\' permissions
|
|---|
| 370 | .RE
|
|---|
| 371 | .sp
|
|---|
| 372 | .RS 4
|
|---|
| 373 | .ie n \{\
|
|---|
| 374 | \h'-04'\(bu\h'+03'\c
|
|---|
| 375 | .\}
|
|---|
| 376 | .el \{\
|
|---|
| 377 | .sp -1
|
|---|
| 378 | .IP \(bu 2.3
|
|---|
| 379 | .\}
|
|---|
| 380 | \fIFULL\fR
|
|---|
| 381 | \- Equivalent to \'RWXDPO\' permissions
|
|---|
| 382 | .RE
|
|---|
| 383 | .SH "EXIT STATUS"
|
|---|
| 384 | .PP
|
|---|
| 385 | The
|
|---|
| 386 | smbcacls
|
|---|
| 387 | program sets the exit status depending on the success or otherwise of the operations performed\&. The exit status may be one of the following values\&.
|
|---|
| 388 | .PP
|
|---|
| 389 | If the operation succeeded, smbcacls returns and exit status of 0\&. If
|
|---|
| 390 | smbcacls
|
|---|
| 391 | couldn\'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\&.
|
|---|
| 392 | .SH "VERSION"
|
|---|
| 393 | .PP
|
|---|
| 394 | This man page is correct for version 3 of the Samba suite\&.
|
|---|
| 395 | .SH "AUTHOR"
|
|---|
| 396 | .PP
|
|---|
| 397 | The 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\&.
|
|---|
| 398 | .PP
|
|---|
| 399 | smbcacls
|
|---|
| 400 | was written by Andrew Tridgell and Tim Potter\&.
|
|---|
| 401 | .PP
|
|---|
| 402 | The 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\&.
|
|---|