1SMBCLIENT(1) User Commands SMBCLIENT(1)
2
3
4
6 smbclient - ftp-like client to access SMB/CIFS resources on servers
7
9 smbclient [-b <buffer size>] [-d debuglevel] [-e] [-L <netbios name>]
10 [-U username] [-I destinationIP] [-M <netbios name>] [-m maxprotocol]
11 [-A authfile] [-N] [-C] [-g] [-i scope] [-O <socket options>]
12 [-p port] [-R <name resolve order>] [-s <smb config file>] [-k] [-P]
13 [-c <command>]
14
15 smbclient {servicename} [password] [-b <buffer size>] [-d debuglevel]
16 [-e] [-D Directory] [-U username] [-W workgroup] [-M <netbios name>]
17 [-m maxprotocol] [-A authfile] [-N] [-C] [-g] [-l log-basename]
18 [-I destinationIP] [-E] [-c <command string>] [-i scope]
19 [-O <socket options>] [-p port] [-R <name resolve order>]
20 [-s <smb config file>] [-T<c|x>IXFqgbNan] [-k]
21
23 This tool is part of the samba(7) suite.
24
25 smbclient is a client that can 'talk' to an SMB/CIFS server. It offers
26 an interface similar to that of the ftp program (see ftp(1)).
27 Operations include things like getting files from the server to the
28 local machine, putting files from the local machine to the server,
29 retrieving directory information from the server and so on.
30
32 servicename
33 servicename is the name of the service you want to use on the
34 server. A service name takes the form //server/service where server
35 is the NetBIOS name of the SMB/CIFS server offering the desired
36 service and service is the name of the service offered. Thus to
37 connect to the service "printer" on the SMB/CIFS server
38 "smbserver", you would use the servicename //smbserver/printer
39
40 Note that the server name required is NOT necessarily the IP (DNS)
41 host name of the server ! The name required is a NetBIOS server
42 name, which may or may not be the same as the IP hostname of the
43 machine running the server.
44
45 The server name is looked up according to either the -R parameter
46 to smbclient or using the name resolve order parameter in the
47 smb.conf(5) file, allowing an administrator to change the order and
48 methods by which server names are looked up.
49
50 password
51 The password required to access the specified service on the
52 specified server. If this parameter is supplied, the -N option
53 (suppress password prompt) is assumed.
54
55 There is no default password. If no password is supplied on the
56 command line (either by using this parameter or adding a password
57 to the -U option (see below)) and the -N option is not specified,
58 the client will prompt for a password, even if the desired service
59 does not require one. (If no password is required, simply press
60 ENTER to provide a null password.)
61
62 Note: Some servers (including OS/2 and Windows for Workgroups)
63 insist on an uppercase password. Lowercase or mixed case passwords
64 may be rejected by these servers.
65
66 Be cautious about including passwords in scripts.
67
68 -R|--name-resolve <name resolve order>
69 This option is used by the programs in the Samba suite to determine
70 what naming services and in what order to resolve host names to IP
71 addresses. The option takes a space-separated string of different
72 name resolution options.
73
74 The options are :"lmhosts", "host", "wins" and "bcast". They cause
75 names to be resolved as follows:
76
77 · lmhosts: Lookup an IP address in the Samba lmhosts file. If the
78 line in lmhosts has no name type attached to the NetBIOS name
79 (see the lmhosts(5) for details) then any name type matches for
80 lookup.
81
82 · host: Do a standard host name to IP address resolution, using
83 the system /etc/hosts, NIS, or DNS lookups. This method of name
84 resolution is operating system dependent, for instance on IRIX
85 or Solaris this may be controlled by the /etc/nsswitch.conf
86 file). Note that this method is only used if the NetBIOS name
87 type being queried is the 0x20 (server) name type, otherwise it
88 is ignored.
89
90 · wins: Query a name with the IP address listed in the wins
91 server parameter. If no WINS server has been specified this
92 method will be ignored.
93
94 · bcast: Do a broadcast on each of the known local interfaces
95 listed in the interfaces parameter. This is the least reliable
96 of the name resolution methods as it depends on the target host
97 being on a locally connected subnet.
98
99 If this parameter is not set then the name resolve order defined in the
100 smb.conf(5) file parameter (name resolve order) will be used.
101
102 The default order is lmhosts, host, wins, bcast and without this
103 parameter or any entry in the name resolve order parameter of the
104 smb.conf(5) file the name resolution methods will be attempted in this
105 order.
106
107 -M|--message NetBIOS name
108 This options allows you to send messages, using the "WinPopup"
109 protocol, to another computer. Once a connection is established you
110 then type your message, pressing ^D (control-D) to end.
111
112 If the receiving computer is running WinPopup the user will receive
113 the message and probably a beep. If they are not running WinPopup
114 the message will be lost, and no error message will occur.
115
116 The message is also automatically truncated if the message is over
117 1600 bytes, as this is the limit of the protocol.
118
119 One useful trick is to pipe the message through smbclient. For
120 example: smbclient -M FRED < mymessage.txt will send the message in
121 the file mymessage.txt to the machine FRED.
122
123 You may also find the -U and -I options useful, as they allow you
124 to control the FROM and TO parts of the message.
125
126 See the message command parameter in the smb.conf(5) for a
127 description of how to handle incoming WinPopup messages in Samba.
128
129 Note: Copy WinPopup into the startup group on your WfWg PCs if you
130 want them to always be able to receive messages.
131
132 -p|--port port
133 This number is the TCP port number that will be used when making
134 connections to the server. The standard (well-known) TCP port
135 number for an SMB/CIFS server is 139, which is the default.
136
137 -g|--grepable
138 This parameter provides combined with -L easy parseable output that
139 allows processing with utilities such as grep and cut.
140
141 -m|--max-protocol protocol
142 This parameter sets the maximum protocol version announced by the
143 client.
144
145 -P|--machine-pass
146 Make queries to the external server using the machine account of
147 the local server.
148
149 -?|--help
150 Print a summary of command line options.
151
152 -I|--ip-address IP-address
153 IP address is the address of the server to connect to. It should be
154 specified in standard "a.b.c.d" notation.
155
156 Normally the client would attempt to locate a named SMB/CIFS server
157 by looking it up via the NetBIOS name resolution mechanism
158 described above in the name resolve order parameter above. Using
159 this parameter will force the client to assume that the server is
160 on the machine with the specified IP address and the NetBIOS name
161 component of the resource being connected to will be ignored.
162
163 There is no default for this parameter. If not supplied, it will be
164 determined automatically by the client as described above.
165
166 -E|--stderr
167 This parameter causes the client to write messages to the standard
168 error stream (stderr) rather than to the standard output stream.
169
170 By default, the client writes messages to standard output -
171 typically the user's tty.
172
173 -L|--list
174 This option allows you to look at what services are available on a
175 server. You use it as smbclient -L host and a list should appear.
176 The -I option may be useful if your NetBIOS names don't match your
177 TCP/IP DNS host names or if you are trying to reach a host on
178 another network.
179
180 -b|--send-buffer buffersize
181 This option changes the transmit/send buffer size when getting or
182 putting a file from/to the server. The default is 65520 bytes.
183 Setting this value smaller (to 1200 bytes) has been observed to
184 speed up file transfers to and from a Win9x server.
185
186 -e|--encrypt
187 This command line parameter requires the remote server support the
188 UNIX extensions. Request that the connection be encrypted. This is
189 new for Samba 3.2 and will only work with Samba 3.2 or above
190 servers. Negotiates SMB encryption using GSSAPI. Uses the given
191 credentials for the encryption negotiation (either kerberos or
192 NTLMv1/v2 if given domain/username/password triple. Fails the
193 connection if encryption cannot be negotiated.
194
195 -d|--debuglevel=level
196 level is an integer from 0 to 10. The default value if this
197 parameter is not specified is 1.
198
199 The higher this value, the more detail will be logged to the log
200 files about the activities of the server. At level 0, only critical
201 errors and serious warnings will be logged. Level 1 is a reasonable
202 level for day-to-day running - it generates a small amount of
203 information about operations carried out.
204
205 Levels above 1 will generate considerable amounts of log data, and
206 should only be used when investigating a problem. Levels above 3
207 are designed for use only by developers and generate HUGE amounts
208 of log data, most of which is extremely cryptic.
209
210 Note that specifying this parameter here will override the log
211 level parameter in the smb.conf file.
212
213 -V|--version
214 Prints the program version number.
215
216 -s|--configfile <configuration file>
217 The file specified contains the configuration details required by
218 the server. The information in this file includes server-specific
219 information such as what printcap file to use, as well as
220 descriptions of all the services that the server is to provide. See
221 smb.conf for more information. The default configuration file name
222 is determined at compile time.
223
224 -l|--log-basename=logdirectory
225 Base directory name for log/debug files. The extension ".progname"
226 will be appended (e.g. log.smbclient, log.smbd, etc...). The log
227 file is never removed by the client.
228
229 -N|--no-pass
230 If specified, this parameter suppresses the normal password prompt
231 from the client to the user. This is useful when accessing a
232 service that does not require a password.
233
234 Unless a password is specified on the command line or this
235 parameter is specified, the client will request a password.
236
237 If a password is specified on the command line and this option is
238 also defined the password on the command line will be silently
239 ingnored and no password will be used.
240
241 -k|--kerberos
242 Try to authenticate with kerberos. Only useful in an Active
243 Directory environment.
244
245 -C|--use-ccache
246 Try to use the credentials cached by winbind.
247
248 -A|--authentication-file=filename
249 This option allows you to specify a file from which to read the
250 username and password used in the connection. The format of the
251 file is
252
253 username = <value>
254 password = <value>
255 domain = <value>
256
257 Make certain that the permissions on the file restrict access from
258 unwanted users.
259
260 -U|--user=username[%password]
261 Sets the SMB username or username and password.
262
263 If %password is not specified, the user will be prompted. The
264 client will first check the USER environment variable, then the
265 LOGNAME variable and if either exists, the string is uppercased. If
266 these environmental variables are not found, the username GUEST is
267 used.
268
269 A third option is to use a credentials file which contains the
270 plaintext of the username and password. This option is mainly
271 provided for scripts where the admin does not wish to pass the
272 credentials on the command line or via environment variables. If
273 this method is used, make certain that the permissions on the file
274 restrict access from unwanted users. See the -A for more details.
275
276 Be cautious about including passwords in scripts. Also, on many
277 systems the command line of a running process may be seen via the
278 ps command. To be safe always allow rpcclient to prompt for a
279 password and type it in directly.
280
281 -n|--netbiosname <primary NetBIOS name>
282 This option allows you to override the NetBIOS name that Samba uses
283 for itself. This is identical to setting the netbios name parameter
284 in the smb.conf file. However, a command line setting will take
285 precedence over settings in smb.conf.
286
287 -i|--scope <scope>
288 This specifies a NetBIOS scope that nmblookup will use to
289 communicate with when generating NetBIOS names. For details on the
290 use of NetBIOS scopes, see rfc1001.txt and rfc1002.txt. NetBIOS
291 scopes are very rarely used, only set this parameter if you are the
292 system administrator in charge of all the NetBIOS systems you
293 communicate with.
294
295 -W|--workgroup=domain
296 Set the SMB domain of the username. This overrides the default
297 domain which is the domain defined in smb.conf. If the domain
298 specified is the same as the servers NetBIOS name, it causes the
299 client to log on using the servers local SAM (as opposed to the
300 Domain SAM).
301
302 -O|--socket-options socket options
303 TCP socket options to set on the client socket. See the socket
304 options parameter in the smb.conf manual page for the list of valid
305 options.
306
307 -T|--tar tar options
308 smbclient may be used to create tar(1) compatible backups of all
309 the files on an SMB/CIFS share. The secondary tar flags that can be
310 given to this option are :
311
312 · c - Create a tar file on UNIX. Must be followed by the name of
313 a tar file, tape device or "-" for standard output. If using
314 standard output you must turn the log level to its lowest value
315 -d0 to avoid corrupting your tar file. This flag is mutually
316 exclusive with the x flag.
317
318 · x - Extract (restore) a local tar file back to a share. Unless
319 the -D option is given, the tar files will be restored from the
320 top level of the share. Must be followed by the name of the tar
321 file, device or "-" for standard input. Mutually exclusive with
322 the c flag. Restored files have their creation times (mtime)
323 set to the date saved in the tar file. Directories currently do
324 not get their creation dates restored properly.
325
326 · I - Include files and directories. Is the default behavior when
327 filenames are specified above. Causes files to be included in
328 an extract or create (and therefore everything else to be
329 excluded). See example below. Filename globbing works in one of
330 two ways. See r below.
331
332 · X - Exclude files and directories. Causes files to be excluded
333 from an extract or create. See example below. Filename globbing
334 works in one of two ways now. See r below.
335
336 · F - File containing a list of files and directories. The F
337 causes the name following the tarfile to create to be read as a
338 filename that contains a list of files and directories to be
339 included in an extract or create (and therefore everything else
340 to be excluded). See example below. Filename globbing works in
341 one of two ways. See r below.
342
343 · b - Blocksize. Must be followed by a valid (greater than zero)
344 blocksize. Causes tar file to be written out in
345 blocksize*TBLOCK (usually 512 byte) blocks.
346
347 · g - Incremental. Only back up files that have the archive bit
348 set. Useful only with the c flag.
349
350 · q - Quiet. Keeps tar from printing diagnostics as it works.
351 This is the same as tarmode quiet.
352
353 · r - Regular expression include or exclude. Uses regular
354 expression matching for excluding or excluding files if
355 compiled with HAVE_REGEX_H. However this mode can be very slow.
356 If not compiled with HAVE_REGEX_H, does a limited wildcard
357 match on '*' and '?'.
358
359 · N - Newer than. Must be followed by the name of a file whose
360 date is compared against files found on the share during a
361 create. Only files newer than the file specified are backed up
362 to the tar file. Useful only with the c flag.
363
364 · a - Set archive bit. Causes the archive bit to be reset when a
365 file is backed up. Useful with the g and c flags.
366
367 Tar Long File Names
368
369 smbclient's tar option now supports long file names both on backup and
370 restore. However, the full path name of the file must be less than 1024
371 bytes. Also, when a tar archive is created, smbclient's tar option
372 places all files in the archive with relative names, not absolute
373 names.
374
375 Tar Filenames
376
377 All file names can be given as DOS path names (with '\\' as the
378 component separator) or as UNIX path names (with '/' as the component
379 separator).
380
381 Examples
382
383 Restore from tar file backup.tar into myshare on mypc (no password on
384 share).
385
386 smbclient //mypc/myshare "" -N -Tx backup.tar
387
388 Restore everything except users/docs
389
390 smbclient //mypc/myshare "" -N -TXx backup.tar users/docs
391
392 Create a tar file of the files beneath users/docs.
393
394 smbclient //mypc/myshare "" -N -Tc backup.tar users/docs
395
396 Create the same tar file as above, but now use a DOS path name.
397
398 smbclient //mypc/myshare "" -N -tc backup.tar users\edocs
399
400 Create a tar file of the files listed in the file tarlist.
401
402 smbclient //mypc/myshare "" -N -TcF backup.tar tarlist
403
404 Create a tar file of all the files and directories in the share.
405
406 smbclient //mypc/myshare "" -N -Tc backup.tar *
407
408 -D|--directory initial directory
409 Change to initial directory before starting. Probably only of any
410 use with the tar -T option.
411
412 -c|--command command string
413 command string is a semicolon-separated list of commands to be
414 executed instead of prompting from stdin.
415 -N is implied by -c.
416
417 This is particularly useful in scripts and for printing stdin to
418 the server, e.g. -c 'print -'.
419
421 Once the client is running, the user is presented with a prompt :
422
423 smb:\>
424
425 The backslash ("\\") indicates the current working directory on the
426 server, and will change if the current working directory is changed.
427
428 The prompt indicates that the client is ready and waiting to carry out
429 a user command. Each command is a single word, optionally followed by
430 parameters specific to that command. Command and parameters are
431 space-delimited unless these notes specifically state otherwise. All
432 commands are case-insensitive. Parameters to commands may or may not be
433 case sensitive, depending on the command.
434
435 You can specify file names which have spaces in them by quoting the
436 name with double quotes, for example "a long file name".
437
438 Parameters shown in square brackets (e.g., "[parameter]") are optional.
439 If not given, the command will use suitable defaults. Parameters shown
440 in angle brackets (e.g., "<parameter>") are required.
441
442 Note that all commands operating on the server are actually performed
443 by issuing a request to the server. Thus the behavior may vary from
444 server to server, depending on how the server was implemented.
445
446 The commands available are given here in alphabetical order.
447
448 ? [command]
449 If command is specified, the ? command will display a brief
450 informative message about the specified command. If no command is
451 specified, a list of available commands will be displayed.
452
453 ! [shell command]
454 If shell command is specified, the ! command will execute a shell
455 locally and run the specified shell command. If no command is
456 specified, a local shell will be run.
457
458 allinfo file
459 The client will request that the server return all known
460 information about a file or directory (including streams).
461
462 altname file
463 The client will request that the server return the "alternate" name
464 (the 8.3 name) for a file or directory.
465
466 archive <number>
467 Sets the archive level when operating on files. 0 means ignore the
468 archive bit, 1 means only operate on files with this bit set, 2
469 means only operate on files with this bit set and reset it after
470 operation, 3 means operate on all files and reset it after
471 operation. The default is 0.
472
473 blocksize <number>
474 Sets the blocksize parameter for a tar operation. The default is
475 20. Causes tar file to be written out in blocksize*TBLOCK (normally
476 512 byte) units.
477
478 cancel jobid0 [jobid1] ... [jobidN]
479 The client will request that the server cancel the printjobs
480 identified by the given numeric print job ids.
481
482 case_sensitive
483 Toggles the setting of the flag in SMB packets that tells the
484 server to treat filenames as case sensitive. Set to OFF by default
485 (tells file server to treat filenames as case insensitive). Only
486 currently affects Samba 3.0.5 and above file servers with the case
487 sensitive parameter set to auto in the smb.conf.
488
489 cd <directory name>
490 If "directory name" is specified, the current working directory on
491 the server will be changed to the directory specified. This
492 operation will fail if for any reason the specified directory is
493 inaccessible.
494
495 If no directory name is specified, the current working directory on
496 the server will be reported.
497
498 chmod file mode in octal
499 This command depends on the server supporting the CIFS UNIX
500 extensions and will fail if the server does not. The client
501 requests that the server change the UNIX permissions to the given
502 octal mode, in standard UNIX format.
503
504 chown file uid gid
505 This command depends on the server supporting the CIFS UNIX
506 extensions and will fail if the server does not. The client
507 requests that the server change the UNIX user and group ownership
508 to the given decimal values. Note there is currently no way to
509 remotely look up the UNIX uid and gid values for a given name. This
510 may be addressed in future versions of the CIFS UNIX extensions.
511
512 close <fileid>
513 Closes a file explicitly opened by the open command. Used for
514 internal Samba testing purposes.
515
516 del <mask>
517 The client will request that the server attempt to delete all files
518 matching mask from the current working directory on the server.
519
520 dir <mask>
521 A list of the files matching mask in the current working directory
522 on the server will be retrieved from the server and displayed.
523
524 du <filename>
525 Does a directory listing and then prints out the current disk usage
526 and free space on a share.
527
528 echo <number> <data>
529 Does an SMBecho request to ping the server. Used for internal Samba
530 testing purposes.
531
532 exit
533 Terminate the connection with the server and exit from the program.
534
535 get <remote file name> [local file name]
536 Copy the file called remote file name from the server to the
537 machine running the client. If specified, name the local copy local
538 file name. Note that all transfers in smbclient are binary. See
539 also the lowercase command.
540
541 getfacl <filename>
542 Requires the server support the UNIX extensions. Requests and
543 prints the POSIX ACL on a file.
544
545 hardlink <src> <dest>
546 Creates a hardlink on the server using Windows CIFS semantics.
547
548 help [command]
549 See the ? command above.
550
551 history
552 Displays the command history.
553
554 iosize <bytes>
555 When sending or receiving files, smbclient uses an internal memory
556 buffer by default of size 64512 bytes. This command allows this
557 size to be set to any range between 16384 (0x4000) bytes and
558 16776960 (0xFFFF00) bytes. Larger sizes may mean more efficient
559 data transfer as smbclient will try and use the most efficient read
560 and write calls for the connected server.
561
562 lcd [directory name]
563 If directory name is specified, the current working directory on
564 the local machine will be changed to the directory specified. This
565 operation will fail if for any reason the specified directory is
566 inaccessible.
567
568 If no directory name is specified, the name of the current working
569 directory on the local machine will be reported.
570
571 link target linkname
572 This command depends on the server supporting the CIFS UNIX
573 extensions and will fail if the server does not. The client
574 requests that the server create a hard link between the linkname
575 and target files. The linkname file must not exist.
576
577 listconnect
578 Show the current connections held for DFS purposes.
579
580 lock <filenum> <r|w> <hex-start> <hex-len>
581 This command depends on the server supporting the CIFS UNIX
582 extensions and will fail if the server does not. Tries to set a
583 POSIX fcntl lock of the given type on the given range. Used for
584 internal Samba testing purposes.
585
586 logon <username> <password>
587 Establishes a new vuid for this session by logging on again.
588 Replaces the current vuid. Prints out the new vuid. Used for
589 internal Samba testing purposes.
590
591 lowercase
592 Toggle lowercasing of filenames for the get and mget commands.
593
594 When lowercasing is toggled ON, local filenames are converted to
595 lowercase when using the get and mget commands. This is often
596 useful when copying (say) MSDOS files from a server, because
597 lowercase filenames are the norm on UNIX systems.
598
599 ls <mask>
600 See the dir command above.
601
602 mask <mask>
603 This command allows the user to set up a mask which will be used
604 during recursive operation of the mget and mput commands.
605
606 The masks specified to the mget and mput commands act as filters
607 for directories rather than files when recursion is toggled ON.
608
609 The mask specified with the mask command is necessary to filter
610 files within those directories. For example, if the mask specified
611 in an mget command is "source*" and the mask specified with the
612 mask command is "*.c" and recursion is toggled ON, the mget command
613 will retrieve all files matching "*.c" in all directories below and
614 including all directories matching "source*" in the current working
615 directory.
616
617 Note that the value for mask defaults to blank (equivalent to "*")
618 and remains so until the mask command is used to change it. It
619 retains the most recently specified value indefinitely. To avoid
620 unexpected results it would be wise to change the value of mask
621 back to "*" after using the mget or mput commands.
622
623 md <directory name>
624 See the mkdir command.
625
626 mget <mask>
627 Copy all files matching mask from the server to the machine running
628 the client.
629
630 Note that mask is interpreted differently during recursive
631 operation and non-recursive operation - refer to the recurse and
632 mask commands for more information. Note that all transfers in
633 smbclient are binary. See also the lowercase command.
634
635 mkdir <directory name>
636 Create a new directory on the server (user access privileges
637 permitting) with the specified name.
638
639 more <file name>
640 Fetch a remote file and view it with the contents of your PAGER
641 environment variable.
642
643 mput <mask>
644 Copy all files matching mask in the current working directory on
645 the local machine to the current working directory on the server.
646
647 Note that mask is interpreted differently during recursive
648 operation and non-recursive operation - refer to the recurse and
649 mask commands for more information. Note that all transfers in
650 smbclient are binary.
651
652 posix
653 Query the remote server to see if it supports the CIFS UNIX
654 extensions and prints out the list of capabilities supported. If
655 so, turn on POSIX pathname processing and large file read/writes
656 (if available),.
657
658 posix_encrypt <domain> <username> <password>
659 This command depends on the server supporting the CIFS UNIX
660 extensions and will fail if the server does not. Attempt to
661 negotiate SMB encryption on this connection. If smbclient connected
662 with kerberos credentials (-k) the arguments to this command are
663 ignored and the kerberos credentials are used to negotiate GSSAPI
664 signing and sealing instead. See also the -e option to smbclient to
665 force encryption on initial connection. This command is new with
666 Samba 3.2.
667
668 posix_open <filename> <octal mode>
669 This command depends on the server supporting the CIFS UNIX
670 extensions and will fail if the server does not. Opens a remote
671 file using the CIFS UNIX extensions and prints a fileid. Used for
672 internal Samba testing purposes.
673
674 posix_mkdir <directoryname> <octal mode>
675 This command depends on the server supporting the CIFS UNIX
676 extensions and will fail if the server does not. Creates a remote
677 directory using the CIFS UNIX extensions with the given mode.
678
679 posix_rmdir <directoryname>
680 This command depends on the server supporting the CIFS UNIX
681 extensions and will fail if the server does not. Deletes a remote
682 directory using the CIFS UNIX extensions.
683
684 posix_unlink <filename>
685 This command depends on the server supporting the CIFS UNIX
686 extensions and will fail if the server does not. Deletes a remote
687 file using the CIFS UNIX extensions.
688
689 print <file name>
690 Print the specified file from the local machine through a printable
691 service on the server.
692
693 prompt
694 Toggle prompting for filenames during operation of the mget and
695 mput commands.
696
697 When toggled ON, the user will be prompted to confirm the transfer
698 of each file during these commands. When toggled OFF, all specified
699 files will be transferred without prompting.
700
701 put <local file name> [remote file name]
702 Copy the file called local file name from the machine running the
703 client to the server. If specified, name the remote copy remote
704 file name. Note that all transfers in smbclient are binary. See
705 also the lowercase command.
706
707 queue
708 Displays the print queue, showing the job id, name, size and
709 current status.
710
711 quit
712 See the exit command.
713
714 readlink symlinkname
715 This command depends on the server supporting the CIFS UNIX
716 extensions and will fail if the server does not. Print the value of
717 the symlink "symlinkname".
718
719 rd <directory name>
720 See the rmdir command.
721
722 recurse
723 Toggle directory recursion for the commands mget and mput.
724
725 When toggled ON, these commands will process all directories in the
726 source directory (i.e., the directory they are copying from ) and
727 will recurse into any that match the mask specified to the command.
728 Only files that match the mask specified using the mask command
729 will be retrieved. See also the mask command.
730
731 When recursion is toggled OFF, only files from the current working
732 directory on the source machine that match the mask specified to
733 the mget or mput commands will be copied, and any mask specified
734 using the mask command will be ignored.
735
736 rename <old filename> <new filename>
737 Rename files in the current working directory on the server from
738 old filename to new filename.
739
740 rm <mask>
741 Remove all files matching mask from the current working directory
742 on the server.
743
744 rmdir <directory name>
745 Remove the specified directory (user access privileges permitting)
746 from the server.
747
748 setmode <filename> <perm=[+|\-]rsha>
749 A version of the DOS attrib command to set file permissions. For
750 example:
751
752 setmode myfile +r
753
754 would make myfile read only.
755
756 showconnect
757 Show the currently active connection held for DFS purposes.
758
759 stat file
760 This command depends on the server supporting the CIFS UNIX
761 extensions and will fail if the server does not. The client
762 requests the UNIX basic info level and prints out the same info
763 that the Linux stat command would about the file. This includes the
764 size, blocks used on disk, file type, permissions, inode number,
765 number of links and finally the three timestamps (access, modify
766 and change). If the file is a special file (symlink, character or
767 block device, fifo or socket) then extra information may also be
768 printed.
769
770 symlink target linkname
771 This command depends on the server supporting the CIFS UNIX
772 extensions and will fail if the server does not. The client
773 requests that the server create a symbolic hard link between the
774 target and linkname files. The linkname file must not exist. Note
775 that the server will not create a link to any path that lies
776 outside the currently connected share. This is enforced by the
777 Samba server.
778
779 tar <c|x>[IXbgNa]
780 Performs a tar operation - see the -T command line option above.
781 Behavior may be affected by the tarmode command (see below). Using
782 g (incremental) and N (newer) will affect tarmode settings. Note
783 that using the "-" option with tar x may not work - use the command
784 line option instead.
785
786 blocksize <blocksize>
787 Blocksize. Must be followed by a valid (greater than zero)
788 blocksize. Causes tar file to be written out in blocksize*TBLOCK
789 (usually 512 byte) blocks.
790
791 tarmode <full|inc|reset|noreset>
792 Changes tar's behavior with regard to archive bits. In full mode,
793 tar will back up everything regardless of the archive bit setting
794 (this is the default mode). In incremental mode, tar will only back
795 up files with the archive bit set. In reset mode, tar will reset
796 the archive bit on all files it backs up (implies read/write
797 share).
798
799 unlock <filenum> <hex-start> <hex-len>
800 This command depends on the server supporting the CIFS UNIX
801 extensions and will fail if the server does not. Tries to unlock a
802 POSIX fcntl lock on the given range. Used for internal Samba
803 testing purposes.
804
805 volume
806 Prints the current volume name of the share.
807
808 vuid <number>
809 Changes the currently used vuid in the protocol to the given
810 arbitrary number. Without an argument prints out the current vuid
811 being used. Used for internal Samba testing purposes.
812
814 Some servers are fussy about the case of supplied usernames, passwords,
815 share names (AKA service names) and machine names. If you fail to
816 connect try giving all parameters in uppercase.
817
818 It is often necessary to use the -n option when connecting to some
819 types of servers. For example OS/2 LanManager insists on a valid
820 NetBIOS name being used, so you need to supply a valid name that would
821 be known to the server.
822
823 smbclient supports long file names where the server supports the
824 LANMAN2 protocol or above.
825
827 The variable USER may contain the username of the person using the
828 client. This information is used only if the protocol level is high
829 enough to support session-level passwords.
830
831 The variable PASSWD may contain the password of the person using the
832 client. This information is used only if the protocol level is high
833 enough to support session-level passwords.
834
835 The variable LIBSMB_PROG may contain the path, executed with system(),
836 which the client should connect to instead of connecting to a server.
837 This functionality is primarily intended as a development aid, and
838 works best when using a LMHOSTS file
839
841 The location of the client program is a matter for individual system
842 administrators. The following are thus suggestions only.
843
844 It is recommended that the smbclient software be installed in the
845 /usr/local/samba/bin/ or /usr/samba/bin/ directory, this directory
846 readable by all, writeable only by root. The client program itself
847 should be executable by all. The client should NOT be setuid or setgid!
848
849 The client log files should be put in a directory readable and
850 writeable only by the user.
851
852 To test the client, you will need to know the name of a running
853 SMB/CIFS server. It is possible to run smbd(8) as an ordinary user -
854 running that server as a daemon on a user-accessible port (typically
855 any port number over 1024) would provide a suitable test server.
856
858 Most diagnostics issued by the client are logged in a specified log
859 file. The log file name is specified at compile time, but may be
860 overridden on the command line.
861
862 The number and nature of diagnostics available depends on the debug
863 level used by the client. If you have problems, set the debug level to
864 3 and peruse the log files.
865
867 This man page is correct for version 3.2 of the Samba suite.
868
870 The original Samba software and related utilities were created by
871 Andrew Tridgell. Samba is now developed by the Samba Team as an Open
872 Source project similar to the way the Linux kernel is developed.
873
874 The original Samba man pages were written by Karl Auer. The man page
875 sources were converted to YODL format (another excellent piece of Open
876 Source software, available at ftp://ftp.icce.rug.nl/pub/unix/) and
877 updated for the Samba 2.0 release by Jeremy Allison. The conversion to
878 DocBook for Samba 2.2 was done by Gerald Carter. The conversion to
879 DocBook XML 4.2 for Samba 3.0 was done by Alexander Bokovoy.
880
881
882
883Samba 3.6 04/11/2016 SMBCLIENT(1)