| 1 | .\" Title: rpcclient
|
|---|
| 2 | .\" Author:
|
|---|
| 3 | .\" Generator: DocBook XSL Stylesheets v1.73.1 <http://docbook.sf.net/>
|
|---|
| 4 | .\" Date: 09/18/2008
|
|---|
| 5 | .\" Manual: User Commands
|
|---|
| 6 | .\" Source: Samba 3.2
|
|---|
| 7 | .\"
|
|---|
| 8 | .TH "RPCCLIENT" "1" "09/18/2008" "Samba 3\.2" "User Commands"
|
|---|
| 9 | .\" disable hyphenation
|
|---|
| 10 | .nh
|
|---|
| 11 | .\" disable justification (adjust text to left margin only)
|
|---|
| 12 | .ad l
|
|---|
| 13 | .SH "NAME"
|
|---|
| 14 | rpcclient - tool for executing client side MS-RPC functions
|
|---|
| 15 | .SH "SYNOPSIS"
|
|---|
| 16 | .HP 1
|
|---|
| 17 | rpcclient [\-A\ authfile] [\-c\ <command\ string>] [\-d\ debuglevel] [\-h] [\-l\ logdir] [\-N] [\-s\ <smb\ config\ file>] [\-U\ username[%password]] [\-W\ workgroup] [\-N] [\-I\ destinationIP] {server}
|
|---|
| 18 | .SH "DESCRIPTION"
|
|---|
| 19 | .PP
|
|---|
| 20 | This tool is part of the
|
|---|
| 21 | \fBsamba\fR(7)
|
|---|
| 22 | suite\.
|
|---|
| 23 | .PP
|
|---|
| 24 | rpcclient
|
|---|
| 25 | is a utility initially developed to test MS\-RPC functionality in Samba itself\. It has undergone several stages of development and stability\. Many system administrators have now written scripts around it to manage Windows NT clients from their UNIX workstation\.
|
|---|
| 26 | .SH "OPTIONS"
|
|---|
| 27 | .PP
|
|---|
| 28 | server
|
|---|
| 29 | .RS 4
|
|---|
| 30 | NetBIOS name of Server to which to connect\. The server can be any SMB/CIFS server\. The name is resolved using the
|
|---|
| 31 | \fIname resolve order\fR
|
|---|
| 32 | line from
|
|---|
| 33 | \fBsmb.conf\fR(5)\.
|
|---|
| 34 | .RE
|
|---|
| 35 | .PP
|
|---|
| 36 | \-c|\-\-command=\'command string\'
|
|---|
| 37 | .RS 4
|
|---|
| 38 | execute semicolon separated commands (listed below))
|
|---|
| 39 | .RE
|
|---|
| 40 | .PP
|
|---|
| 41 | \-I IP\-address
|
|---|
| 42 | .RS 4
|
|---|
| 43 | \fIIP address\fR
|
|---|
| 44 | is the address of the server to connect to\. It should be specified in standard "a\.b\.c\.d" notation\.
|
|---|
| 45 | .sp
|
|---|
| 46 | Normally the client would attempt to locate a named SMB/CIFS server by looking it up via the NetBIOS name resolution mechanism described above in the
|
|---|
| 47 | \fIname resolve order\fR
|
|---|
| 48 | parameter above\. Using this parameter will force the client to assume that the server is on the machine with the specified IP address and the NetBIOS name component of the resource being connected to will be ignored\.
|
|---|
| 49 | .sp
|
|---|
| 50 | There is no default for this parameter\. If not supplied, it will be determined automatically by the client as described above\.
|
|---|
| 51 | .RE
|
|---|
| 52 | .PP
|
|---|
| 53 | \-d|\-\-debuglevel=level
|
|---|
| 54 | .RS 4
|
|---|
| 55 | \fIlevel\fR
|
|---|
| 56 | is an integer from 0 to 10\. The default value if this parameter is not specified is 0\.
|
|---|
| 57 | .sp
|
|---|
| 58 | 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\.
|
|---|
| 59 | .sp
|
|---|
| 60 | 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\.
|
|---|
| 61 | .sp
|
|---|
| 62 | Note that specifying this parameter here will override the
|
|---|
| 63 | \fIlog level\fR
|
|---|
| 64 | parameter in the
|
|---|
| 65 | \fIsmb\.conf\fR
|
|---|
| 66 | file\.
|
|---|
| 67 | .RE
|
|---|
| 68 | .PP
|
|---|
| 69 | \-V
|
|---|
| 70 | .RS 4
|
|---|
| 71 | Prints the program version number\.
|
|---|
| 72 | .RE
|
|---|
| 73 | .PP
|
|---|
| 74 | \-s <configuration file>
|
|---|
| 75 | .RS 4
|
|---|
| 76 | 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
|
|---|
| 77 | \fIsmb\.conf\fR
|
|---|
| 78 | for more information\. The default configuration file name is determined at compile time\.
|
|---|
| 79 | .RE
|
|---|
| 80 | .PP
|
|---|
| 81 | \-l|\-\-log\-basename=logdirectory
|
|---|
| 82 | .RS 4
|
|---|
| 83 | Base directory name for log/debug files\. The extension
|
|---|
| 84 | \fB"\.progname"\fR
|
|---|
| 85 | will be appended (e\.g\. log\.smbclient, log\.smbd, etc\.\.\.)\. The log file is never removed by the client\.
|
|---|
| 86 | .RE
|
|---|
| 87 | .PP
|
|---|
| 88 | \-N
|
|---|
| 89 | .RS 4
|
|---|
| 90 | 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\.
|
|---|
| 91 | .sp
|
|---|
| 92 | Unless a password is specified on the command line or this parameter is specified, the client will request a password\.
|
|---|
| 93 | .sp
|
|---|
| 94 | 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\.
|
|---|
| 95 | .RE
|
|---|
| 96 | .PP
|
|---|
| 97 | \-k
|
|---|
| 98 | .RS 4
|
|---|
| 99 | Try to authenticate with kerberos\. Only useful in an Active Directory environment\.
|
|---|
| 100 | .RE
|
|---|
| 101 | .PP
|
|---|
| 102 | \-A|\-\-authentication\-file=filename
|
|---|
| 103 | .RS 4
|
|---|
| 104 | 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
|
|---|
| 105 | .sp
|
|---|
| 106 | .sp
|
|---|
| 107 | .RS 4
|
|---|
| 108 | .nf
|
|---|
| 109 | username = <value>
|
|---|
| 110 | password = <value>
|
|---|
| 111 | domain = <value>
|
|---|
| 112 | .fi
|
|---|
| 113 | .RE
|
|---|
| 114 | .sp
|
|---|
| 115 | Make certain that the permissions on the file restrict access from unwanted users\.
|
|---|
| 116 | .RE
|
|---|
| 117 | .PP
|
|---|
| 118 | \-U|\-\-user=username[%password]
|
|---|
| 119 | .RS 4
|
|---|
| 120 | Sets the SMB username or username and password\.
|
|---|
| 121 | .sp
|
|---|
| 122 | If %password is not specified, the user will be prompted\. The client will first check the
|
|---|
| 123 | \fBUSER\fR
|
|---|
| 124 | environment variable, then the
|
|---|
| 125 | \fBLOGNAME\fR
|
|---|
| 126 | variable and if either exists, the string is uppercased\. If these environmental variables are not found, the username
|
|---|
| 127 | \fBGUEST\fR
|
|---|
| 128 | is used\.
|
|---|
| 129 | .sp
|
|---|
| 130 | 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
|
|---|
| 131 | \fI\-A\fR
|
|---|
| 132 | for more details\.
|
|---|
| 133 | .sp
|
|---|
| 134 | Be cautious about including passwords in scripts\. Also, on many systems the command line of a running process may be seen via the
|
|---|
| 135 | ps
|
|---|
| 136 | command\. To be safe always allow
|
|---|
| 137 | rpcclient
|
|---|
| 138 | to prompt for a password and type it in directly\.
|
|---|
| 139 | .RE
|
|---|
| 140 | .PP
|
|---|
| 141 | \-n <primary NetBIOS name>
|
|---|
| 142 | .RS 4
|
|---|
| 143 | This option allows you to override the NetBIOS name that Samba uses for itself\. This is identical to setting the
|
|---|
| 144 | \fInetbios name\fR
|
|---|
| 145 | parameter in the
|
|---|
| 146 | \fIsmb\.conf\fR
|
|---|
| 147 | file\. However, a command line setting will take precedence over settings in
|
|---|
| 148 | \fIsmb\.conf\fR\.
|
|---|
| 149 | .RE
|
|---|
| 150 | .PP
|
|---|
| 151 | \-i <scope>
|
|---|
| 152 | .RS 4
|
|---|
| 153 | This specifies a NetBIOS scope that
|
|---|
| 154 | nmblookup
|
|---|
| 155 | will use to communicate with when generating NetBIOS names\. For details on the use of NetBIOS scopes, see rfc1001\.txt and rfc1002\.txt\. NetBIOS scopes are
|
|---|
| 156 | \fIvery\fR
|
|---|
| 157 | rarely used, only set this parameter if you are the system administrator in charge of all the NetBIOS systems you communicate with\.
|
|---|
| 158 | .RE
|
|---|
| 159 | .PP
|
|---|
| 160 | \-W|\-\-workgroup=domain
|
|---|
| 161 | .RS 4
|
|---|
| 162 | Set the SMB domain of the username\. This overrides the default domain which is the domain defined in smb\.conf\. If the domain specified is the same as the servers NetBIOS name, it causes the client to log on using the servers local SAM (as opposed to the Domain SAM)\.
|
|---|
| 163 | .RE
|
|---|
| 164 | .PP
|
|---|
| 165 | \-O socket options
|
|---|
| 166 | .RS 4
|
|---|
| 167 | TCP socket options to set on the client socket\. See the socket options parameter in the
|
|---|
| 168 | \fIsmb\.conf\fR
|
|---|
| 169 | manual page for the list of valid options\.
|
|---|
| 170 | .RE
|
|---|
| 171 | .PP
|
|---|
| 172 | \-h|\-\-help
|
|---|
| 173 | .RS 4
|
|---|
| 174 | Print a summary of command line options\.
|
|---|
| 175 | .RE
|
|---|
| 176 | .SH "COMMANDS"
|
|---|
| 177 | .SS "LSARPC"
|
|---|
| 178 | .PP
|
|---|
| 179 | lsaquery
|
|---|
| 180 | .RS 4
|
|---|
| 181 | Query info policy
|
|---|
| 182 | .RE
|
|---|
| 183 | .PP
|
|---|
| 184 | lookupsids
|
|---|
| 185 | .RS 4
|
|---|
| 186 | Resolve a list of SIDs to usernames\.
|
|---|
| 187 | .RE
|
|---|
| 188 | .PP
|
|---|
| 189 | lookupnames
|
|---|
| 190 | .RS 4
|
|---|
| 191 | Resolve a list of usernames to SIDs\.
|
|---|
| 192 | .RE
|
|---|
| 193 | .PP
|
|---|
| 194 | enumtrusts
|
|---|
| 195 | .RS 4
|
|---|
| 196 | Enumerate trusted domains
|
|---|
| 197 | .RE
|
|---|
| 198 | .PP
|
|---|
| 199 | enumprivs
|
|---|
| 200 | .RS 4
|
|---|
| 201 | Enumerate privileges
|
|---|
| 202 | .RE
|
|---|
| 203 | .PP
|
|---|
| 204 | getdispname
|
|---|
| 205 | .RS 4
|
|---|
| 206 | Get the privilege name
|
|---|
| 207 | .RE
|
|---|
| 208 | .PP
|
|---|
| 209 | lsaenumsid
|
|---|
| 210 | .RS 4
|
|---|
| 211 | Enumerate the LSA SIDS
|
|---|
| 212 | .RE
|
|---|
| 213 | .PP
|
|---|
| 214 | lsaenumprivsaccount
|
|---|
| 215 | .RS 4
|
|---|
| 216 | Enumerate the privileges of an SID
|
|---|
| 217 | .RE
|
|---|
| 218 | .PP
|
|---|
| 219 | lsaenumacctrights
|
|---|
| 220 | .RS 4
|
|---|
| 221 | Enumerate the rights of an SID
|
|---|
| 222 | .RE
|
|---|
| 223 | .PP
|
|---|
| 224 | lsaenumacctwithright
|
|---|
| 225 | .RS 4
|
|---|
| 226 | Enumerate accounts with a right
|
|---|
| 227 | .RE
|
|---|
| 228 | .PP
|
|---|
| 229 | lsaaddacctrights
|
|---|
| 230 | .RS 4
|
|---|
| 231 | Add rights to an account
|
|---|
| 232 | .RE
|
|---|
| 233 | .PP
|
|---|
| 234 | lsaremoveacctrights
|
|---|
| 235 | .RS 4
|
|---|
| 236 | Remove rights from an account
|
|---|
| 237 | .RE
|
|---|
| 238 | .PP
|
|---|
| 239 | lsalookupprivvalue
|
|---|
| 240 | .RS 4
|
|---|
| 241 | Get a privilege value given its name
|
|---|
| 242 | .RE
|
|---|
| 243 | .PP
|
|---|
| 244 | lsaquerysecobj
|
|---|
| 245 | .RS 4
|
|---|
| 246 | Query LSA security object
|
|---|
| 247 | .RE
|
|---|
| 248 | .SS "LSARPC\-DS"
|
|---|
| 249 | .PP
|
|---|
| 250 | dsroledominfo
|
|---|
| 251 | .RS 4
|
|---|
| 252 | Get Primary Domain Information
|
|---|
| 253 | .RE
|
|---|
| 254 | .PP
|
|---|
| 255 | .PP
|
|---|
| 256 | \fIDFS\fR
|
|---|
| 257 | .PP
|
|---|
| 258 | dfsexist
|
|---|
| 259 | .RS 4
|
|---|
| 260 | Query DFS support
|
|---|
| 261 | .RE
|
|---|
| 262 | .PP
|
|---|
| 263 | dfsadd
|
|---|
| 264 | .RS 4
|
|---|
| 265 | Add a DFS share
|
|---|
| 266 | .RE
|
|---|
| 267 | .PP
|
|---|
| 268 | dfsremove
|
|---|
| 269 | .RS 4
|
|---|
| 270 | Remove a DFS share
|
|---|
| 271 | .RE
|
|---|
| 272 | .PP
|
|---|
| 273 | dfsgetinfo
|
|---|
| 274 | .RS 4
|
|---|
| 275 | Query DFS share info
|
|---|
| 276 | .RE
|
|---|
| 277 | .PP
|
|---|
| 278 | dfsenum
|
|---|
| 279 | .RS 4
|
|---|
| 280 | Enumerate dfs shares
|
|---|
| 281 | .RE
|
|---|
| 282 | .SS "REG"
|
|---|
| 283 | .PP
|
|---|
| 284 | shutdown
|
|---|
| 285 | .RS 4
|
|---|
| 286 | Remote Shutdown
|
|---|
| 287 | .RE
|
|---|
| 288 | .PP
|
|---|
| 289 | abortshutdown
|
|---|
| 290 | .RS 4
|
|---|
| 291 | Abort Shutdown
|
|---|
| 292 | .RE
|
|---|
| 293 | .SS "SRVSVC"
|
|---|
| 294 | .PP
|
|---|
| 295 | srvinfo
|
|---|
| 296 | .RS 4
|
|---|
| 297 | Server query info
|
|---|
| 298 | .RE
|
|---|
| 299 | .PP
|
|---|
| 300 | netshareenum
|
|---|
| 301 | .RS 4
|
|---|
| 302 | Enumerate shares
|
|---|
| 303 | .RE
|
|---|
| 304 | .PP
|
|---|
| 305 | netfileenum
|
|---|
| 306 | .RS 4
|
|---|
| 307 | Enumerate open files
|
|---|
| 308 | .RE
|
|---|
| 309 | .PP
|
|---|
| 310 | netremotetod
|
|---|
| 311 | .RS 4
|
|---|
| 312 | Fetch remote time of day
|
|---|
| 313 | .RE
|
|---|
| 314 | .SS "SAMR"
|
|---|
| 315 | .PP
|
|---|
| 316 | queryuser
|
|---|
| 317 | .RS 4
|
|---|
| 318 | Query user info
|
|---|
| 319 | .RE
|
|---|
| 320 | .PP
|
|---|
| 321 | querygroup
|
|---|
| 322 | .RS 4
|
|---|
| 323 | Query group info
|
|---|
| 324 | .RE
|
|---|
| 325 | .PP
|
|---|
| 326 | queryusergroups
|
|---|
| 327 | .RS 4
|
|---|
| 328 | Query user groups
|
|---|
| 329 | .RE
|
|---|
| 330 | .PP
|
|---|
| 331 | querygroupmem
|
|---|
| 332 | .RS 4
|
|---|
| 333 | Query group membership
|
|---|
| 334 | .RE
|
|---|
| 335 | .PP
|
|---|
| 336 | queryaliasmem
|
|---|
| 337 | .RS 4
|
|---|
| 338 | Query alias membership
|
|---|
| 339 | .RE
|
|---|
| 340 | .PP
|
|---|
| 341 | querydispinfo
|
|---|
| 342 | .RS 4
|
|---|
| 343 | Query display info
|
|---|
| 344 | .RE
|
|---|
| 345 | .PP
|
|---|
| 346 | querydominfo
|
|---|
| 347 | .RS 4
|
|---|
| 348 | Query domain info
|
|---|
| 349 | .RE
|
|---|
| 350 | .PP
|
|---|
| 351 | enumdomusers
|
|---|
| 352 | .RS 4
|
|---|
| 353 | Enumerate domain users
|
|---|
| 354 | .RE
|
|---|
| 355 | .PP
|
|---|
| 356 | enumdomgroups
|
|---|
| 357 | .RS 4
|
|---|
| 358 | Enumerate domain groups
|
|---|
| 359 | .RE
|
|---|
| 360 | .PP
|
|---|
| 361 | enumalsgroups
|
|---|
| 362 | .RS 4
|
|---|
| 363 | Enumerate alias groups
|
|---|
| 364 | .RE
|
|---|
| 365 | .PP
|
|---|
| 366 | createdomuser
|
|---|
| 367 | .RS 4
|
|---|
| 368 | Create domain user
|
|---|
| 369 | .RE
|
|---|
| 370 | .PP
|
|---|
| 371 | samlookupnames
|
|---|
| 372 | .RS 4
|
|---|
| 373 | Look up names
|
|---|
| 374 | .RE
|
|---|
| 375 | .PP
|
|---|
| 376 | samlookuprids
|
|---|
| 377 | .RS 4
|
|---|
| 378 | Look up names
|
|---|
| 379 | .RE
|
|---|
| 380 | .PP
|
|---|
| 381 | deletedomuser
|
|---|
| 382 | .RS 4
|
|---|
| 383 | Delete domain user
|
|---|
| 384 | .RE
|
|---|
| 385 | .PP
|
|---|
| 386 | samquerysecobj
|
|---|
| 387 | .RS 4
|
|---|
| 388 | Query SAMR security object
|
|---|
| 389 | .RE
|
|---|
| 390 | .PP
|
|---|
| 391 | getdompwinfo
|
|---|
| 392 | .RS 4
|
|---|
| 393 | Retrieve domain password info
|
|---|
| 394 | .RE
|
|---|
| 395 | .PP
|
|---|
| 396 | lookupdomain
|
|---|
| 397 | .RS 4
|
|---|
| 398 | Look up domain
|
|---|
| 399 | .RE
|
|---|
| 400 | .SS "SPOOLSS"
|
|---|
| 401 | .PP
|
|---|
| 402 | adddriver <arch> <config> [<version>]
|
|---|
| 403 | .RS 4
|
|---|
| 404 | Execute an AddPrinterDriver() RPC to install the printer driver information on the server\. Note that the driver files should already exist in the directory returned by
|
|---|
| 405 | getdriverdir\. Possible values for
|
|---|
| 406 | \fIarch\fR
|
|---|
| 407 | are the same as those for the
|
|---|
| 408 | getdriverdir
|
|---|
| 409 | command\. The
|
|---|
| 410 | \fIconfig\fR
|
|---|
| 411 | parameter is defined as follows:
|
|---|
| 412 | .sp
|
|---|
| 413 | .sp
|
|---|
|
|---|