1mailto(samba@samba.org) 
2
3manpage(smbclient htmlcommand((1)))(1)(23 Oct 1998)(Samba)(SAMBA)
4
5label(NAME)
6manpagename(smbclient)(ftp-like client to access SMB/CIFS resources on servers)
7
8label(SYNOPSIS)
9manpagesynopsis()
10
11bf(smbclient) link(servicename)(servicename) [link(password)(password)] [link(-s smb.conf)(minuss)] [link(-O socket options)(minusO)][link(-R name resolve order)(minusR)] [link(-M NetBIOS name)(minusM)] [link(-i scope)(minusi)] [link(-N)(minusN)] [link(-n NetBIOS name)(minusn)] [link(-d debuglevel)(minusd)] [link(-P)(minusP)] [link(-p port)(minusp)] [link(-l log basename)(minusl)] [link(-h)(minush)] [link(-I dest IP)(minusI)] [link(-E)(minusE)] [link(-U username)(minusU)] [link(-L NetBIOS name)(minusL)] [link(-t terminal code)(minust)] [link(-m max protocol)(minusm)] [link(-b buffersize)(minusb)] [link(-W workgroup)(minusW)] [link(-T<c|x>IXFqgbNan)(minusT)] [link(-D directory)(minusD)] [link(-c command string)(minusc)]
12
13label(DESCRIPTION)
14manpagedescription()
15
16This program is part of the bf(Samba) suite.
17
18bf(smbclient) is a client that can 'talk' to an SMB/CIFS server. It
19offers an interface similar to that of the ftp program (see bf(ftp
20(1))).  Operations include things like getting files from the server
21to the local machine, putting files from the local machine to the
22server, retrieving directory information from the server and so on.
23
24label(OPTIONS)
25manpageoptions()
26
27startdit()
28
29label(servicename)
30dit(bf(servicename)) servicename is the name of the service you want
31to use on the server. A service name takes the form
32tt(//server/service) where em(server) is the NetBIOS name of the SMB/CIFS
33server offering the desired service and em(service) is the name
34of the service offered. Thus to connect to the service em(printer) on
35the SMB/CIFS server em(smbserver), you would use the servicename
36
37tt(//smbserver/printer)
38
39Note that the server name required is NOT necessarily the IP (DNS)
40host name of the server ! The name required is a NetBIOS server name,
41which may or may not be the same as the IP hostname of the machine
42running the server.
43
44The server name is looked up according to either the
45link(bf(-R))(minusR) parameter to bf(smbclient) or using the
46url(bf(name resolve order))(smb.conf.5.html#nameresolveorder)
47parameter in the smb.conf file, allowing an administrator to change
48the order and methods by which server names are looked up.
49
50label(password)
51dit(bf(password)) password is the password required to access the
52specified service on the specified server. If this parameter is
53supplied, the link(bf(-N))(minusN) option (suppress password prompt) is assumed.
54
55There is no default password. If no password is supplied on the
56command line (either by using this parameter or adding a password to
57the link(bf(-U))(minusU) option (see below)) and the link(bf(-N))(minusN) option is not specified,
58the client will prompt for a password, even if the desired service
59does not require one. (If no password is required, simply press ENTER
60to provide a null password.)
61
62Note: Some servers (including OS/2 and Windows for Workgroups) insist
63on an uppercase password. Lowercase or mixed case passwords may be
64rejected by these servers.
65
66Be cautious about including passwords in scripts.
67
68label(minuss)
69dit(bf(-s smb.conf)) This parameter specifies the pathname to the
70Samba configuration file, smb.conf. This file controls all aspects of
71the Samba setup on the machine and smbclient also needs to read this
72file.
73
74label(minusO)
75dit(bf(-O socket options)) TCP socket options to set on the client
76socket. See the url(socket options)(smb.conf.5.html#socketoptions)
77parameter in the url(bf(smb.conf (5)))(smb.conf.5.html) manpage for
78the list of valid options.
79
80label(minusR)
81dit(bf(-R name resolve order)) This option allows the user of
82smbclient to determine what name resolution services to use when
83looking up the NetBIOS name of the host being connected to.
84
85The options are :"lmhosts", "host", "wins" and "bcast". They cause
86names to be resolved as follows :
87
88startit()
89
90it() bf(lmhosts) : Lookup an IP address in the Samba lmhosts file.
91The lmhosts file is stored in the same directory as the
92url(bf(smb.conf))(smb.conf.5.html) file.
93
94it() bf(host) : Do a standard host name to IP address resolution,
95using the system /etc/hosts, NIS, or DNS lookups. This method of name
96resolution is operating system depended for instance on IRIX or
97Solaris this may be controlled by the em(/etc/nsswitch.conf) file).  
98
99it() bf(wins) : Query a name with the IP address listed in the url(bf(wins
100server))(smb.conf.5.html#winsserver) parameter in the smb.conf file. If 
101no WINS server has been specified this method will be ignored.
102
103it() bf(bcast) : Do a broadcast on each of the known local interfaces
104listed in the url(bf(interfaces))(smb.conf.5.html#interfaces) parameter
105in the smb.conf file. This is the least reliable of the name resolution
106methods as it depends on the target host being on a locally connected
107subnet. 
108
109endit()
110
111If this parameter is not set then the name resolve order defined
112in the url(bf(smb.conf))(smb.conf.5.html) file parameter 
113url((bf(name resolve order)))(smb.conf.5.html#nameresolveorder)
114will be used.
115
116The default order is lmhosts, host, wins, bcast and without this
117parameter or any entry in the url(bf("name resolve
118order"))(smb.conf.5.html#nameresolveorder) parameter of the
119url(bf(smb.conf))(smb.conf.5.html) file the name resolution methods
120will be attempted in this order.
121
122label(minusM)
123dit(bf(-M NetBIOS name)) This options allows you to send messages,
124using the "WinPopup" protocol, to another computer. Once a connection
125is established you then type your message, pressing ^D (control-D) to
126end.
127
128If the receiving computer is running WinPopup the user will receive
129the message and probably a beep. If they are not running WinPopup the
130message will be lost, and no error message will occur.
131
132The message is also automatically truncated if the message is over
1331600 bytes, as this is the limit of the protocol.
134
135One useful trick is to cat the message through bf(smbclient).
136For example:
137
138tt(cat mymessage.txt | smbclient -M FRED)
139
140will send the message in the file em(mymessage.txt) to the machine FRED.
141
142You may also find the link(bf(-U))(minusU) and link(bf(-I))(minusI) options useful, as they allow
143you to control the FROM and TO parts of the message.
144
145See the url(bf(message command))(smb.conf.5.html#messagecommand)
146parameter in the bf(smb.conf (5)) for a description of how to handle
147incoming WinPopup messages in Samba.
148
149Note: Copy WinPopup into the startup group on your WfWg PCs if you
150want them to always be able to receive messages.
151
152label(minusi)
153dit(bf(-i scope)) This specifies a NetBIOS scope that smbclient will use
154to communicate with when generating NetBIOS names. For details on the
155use of NetBIOS scopes, see rfc1001.txt and rfc1002.txt. NetBIOS scopes
156are em(very) rarely used, only set this parameter if you are the
157system administrator in charge of all the NetBIOS systems you
158communicate with.
159
160label(minusN)
161dit(bf(-N)) If specified, this parameter suppresses the normal
162password prompt from the client to the user. This is useful when
163accessing a service that does not require a password.
164
165Unless a password is specified on the command line or this parameter
166is specified, the client will request a password.
167
168label(minusn)
169dit(bf(-n NetBIOS name)) By default, the client will use the local
170machine's hostname (in uppercase) as its NetBIOS name. This parameter
171allows you to override the host name and use whatever NetBIOS name you
172wish.
173
174label(minusd)
175dit(bf(-d debuglevel)) debuglevel is an integer from 0 to 10, or the
176letter 'A'.
177
178The default value if this parameter is not specified is zero.
179
180The higher this value, the more detail will be logged to the log files
181about the activities of the client. At level 0, only critical errors
182and serious warnings will be logged. Level 1 is a reasonable level for
183day to day running - it generates a small amount of information about
184operations carried out.
185
186Levels above 1 will generate considerable amounts of log data, and
187should only be used when investigating a problem. Levels above 3 are
188designed for use only by developers and generate HUGE amounts of log
189data, most of which is extremely cryptic. If debuglevel is set to the
190letter 'A', then em(all) debug messages will be printed. This setting
191is for developers only (and people who em(really) want to know how the
192code works internally).
193
194Note that specifying this parameter here will override the url(bf(log
195level))(smb.conf.5.html#loglevel) parameter in the url(bf(smb.conf
196(5)))(smb.conf.5.html) file.
197
198label(minusP)
199dit(bf(-P)) This option is no longer used. The code in Samba2.0
200now lets the server decide the device type, so no printer specific
201flag is needed.
202
203label(minusp)
204dit(bf(-p port)) This number is the TCP port number that will be used
205when making connections to the server. The standard (well-known) TCP
206port number for an SMB/CIFS server is 139, which is the default.
207
208label(minusl)
209dit(bf(-l logfilename)) If specified, logfilename specifies a base
210filename into which operational data from the running client will be
211logged.
212
213The default base name is specified at compile time.
214
215The base name is used to generate actual log file names. For example,
216if the name specified was "log", the debug file would be
217tt(log.client).
218
219The log file generated is never removed by the client.
220
221label(minush)
222dit(bf(-h)) Print the usage message for the client.
223
224label(minusI)
225dit(bf(-I IP address)) IP address is the address of the server to
226connect to. It should be specified in standard "a.b.c.d" notation.
227
228Normally the client would attempt to locate a named SMB/CIFS server by
229looking it up via the NetBIOS name resolution mechanism described
230above in the link(bf(name resolve order))(minusR) parameter
231above. Using this parameter will force the client to assume that the
232server is on the machine with the specified IP address and the NetBIOS
233name component of the resource being connected to will be ignored.
234
235There is no default for this parameter. If not supplied, it will be
236determined automatically by the client as described above.
237
238label(minusE)
239dit(bf(-E)) This parameter causes the client to write messages to the
240standard error stream (stderr) rather than to the standard output
241stream.
242
243By default, the client writes messages to standard output - typically
244the user's tty.
245
246label(minusU)
247dit(bf(-U username)) This specifies the user name that will be used by
248the client to make a connection, assuming your server is not a downlevel
249server that is running a protocol level that uses passwords on shares,
250not on usernames.
251
252Some servers are fussy about the case of this name, and some insist
253that it must be a valid NetBIOS name.
254
255If no username is supplied, it will default to an uppercase version of
256the environment variable tt(USER) or tt(LOGNAME) in that order.  If no
257username is supplied and neither environment variable exists the
258username "GUEST" will be used.
259
260If the tt(USER) environment variable contains a '%' character,
261everything after that will be treated as a password. This allows you
262to set the environment variable to be tt(USER=username%password) so
263that a password is not passed on the command line (where it may be
264seen by the ps command).
265
266If the service you are connecting to requires a password, it can be
267supplied using the link(bf(-U))(minusU) option, by appending a percent symbol ("%")
268then the password to username.  For example, to attach to a service as
269user tt("fred") with password tt("secret"), you would specify. nl()
270
271tt(-U fred%secret) nl()
272
273on the command line. Note that there are no spaces around the percent
274symbol.
275
276If you specify the password as part of username then the link(bf(-N))(minusN) option
277(suppress password prompt) is assumed.
278
279If you specify the password as a parameter em(AND) as part of username
280then the password as part of username will take precedence. Putting
281nothing before or nothing after the percent symbol will cause an empty
282username or an empty password to be used, respectively.
283
284The password may also be specified by setting up an environment
285variable called tt(PASSWD) that contains the users password. Note
286that this may be very insecure on some systems but on others allows
287users to script smbclient commands without having a password appear in
288the command line of a process listing.
289
290Note: Some servers (including OS/2 and Windows for Workgroups) insist
291on an uppercase password. Lowercase or mixed case passwords may be
292rejected by these servers.
293
294Be cautious about including passwords in scripts or in the
295tt(PASSWD) environment variable. Also, on many systems the command
296line of a running process may be seen via the tt(ps) command to be
297safe always allow smbclient to prompt for a password and type it in
298directly.
299
300label(minusL)
301dit(bf(-L)) This option allows you to look at what services are
302available on a server. You use it as tt("smbclient -L host") and a
303list should appear.  The link(bf(-I))(minusI) option may be useful if your NetBIOS
304names don't match your tcp/ip dns host names or if you are trying to
305reach a host on another network.
306
307label(minust)
308dit(bf(-t terminal code)) This option tells smbclient how to interpret
309filenames coming from the remote server. Usually Asian language
310multibyte UNIX implementations use different character sets than
311SMB/CIFS servers (em(EUC) instead of em(SJIS) for example). Setting
312this parameter will let smbclient convert between the UNIX filenames
313and the SMB filenames correctly. This option has not been seriously
314tested and may have some problems.
315
316The terminal codes include tt(sjis), tt(euc), tt(jis7), tt(jis8),
317tt(junet), tt(hex), tt(cap). This is not a complete list, check the
318Samba source code for the complete list.
319
320label(minusm)
321dit(bf(-m max protocol level)) With the new code in Samba2.0,
322bf(smbclient) always attempts to connect at the maximum
323protocols level the server supports. This parameter is
324preserved for backwards compatibility, but any string
325following the bf(-m) will be ignored.
326
327label(minusb)
328dit(bf(-b buffersize)) This option changes the transmit/send buffer
329size when getting or putting a file from/to the server. The default
330is 65520 bytes. Setting this value smaller (to 1200 bytes) has been
331observed to speed up file transfers to and from a Win9x server.
332
333label(minusW)
334dit(bf(-W WORKGROUP)) Override the default workgroup specified in the
335url(bf(workgroup))(smb.conf.5.html#workgroup) parameter of the
336url(bf(smb.conf))(smb.conf.5.html) file for this connection. This may
337be needed to connect to some servers.
338
339label(minusT) dit(bf(-T tar options)) smbclient may be used to create
340bf(tar (1)) compatible backups of all the files on an SMB/CIFS
341share. The secondary tar flags that can be given to this option are :
342
343	startdit()
344
345	dit(bf(c)) Create a tar file on UNIX. Must be followed by the
346	name of a tar file, tape device or tt("-") for standard output. If
347	using standard output you must turn the log level to its lowest value
348    tt(-d0) to avoid corrupting your tar file. This flag is
349	mutually exclusive with the bf(x) flag.
350
351	dit(bf(x)) Extract (restore) a local tar file back to a
352	share. Unless the link(bf(-D))(minusD) option is given, the tar files will be
353	restored from the top level of the share. Must be followed by the name
354	of the tar file, device or tt("-") for standard input. Mutually exclusive
355	with the bf(c) flag. Restored files have their creation times (mtime)
356	set to the date saved in the tar file. Directories currently do not
357	get their creation dates restored properly.
358
359	dit(bf(I)) Include files and directories. Is the default
360	behavior when filenames are specified above. Causes tar files to
361	be included in an extract or create (and therefore everything else to
362	be excluded). See example below.  Filename globbing works 
363	in one of two ways.  See bf(r) below.
364
365	dit(bf(X)) Exclude files and directories. Causes tar files to
366	be excluded from an extract or create. See example below.  Filename
367	globbing works in one of two ways now. See bf(r) below.
368
369	dit(bf(b)) Blocksize. Must be followed by a valid (greater than
370	zero) blocksize.  Causes tar file to be written out in
371	blocksize*TBLOCK (usually 512 byte) blocks.
372
373	dit(bf(g)) Incremental. Only back up files that have the
374	archive bit set. Useful only with the bf(c) flag.
375
376	dit(bf(q)) Quiet. Keeps tar from printing diagnostics as it
377	works.  This is the same as tarmode quiet.
378
379	dit(bf(r)) Regular expression include or exclude.  Uses regular 
380	regular expression matching for excluding or excluding files if 
381	compiled with HAVE_REGEX_H. However this mode can be very slow. If 
382	not compiled with HAVE_REGEX_H, does a limited wildcard match on * and 
383	?.
384
385	dit(bf(N)) Newer than. Must be followed by the name of a file
386	whose date is compared against files found on the share during a
387	create. Only files newer than the file specified are backed up to the
388	tar file. Useful only with the bf(c) flag.
389
390	dit(bf(a)) Set archive bit. Causes the archive bit to be reset
391	when a file is backed up. Useful with the bf(g) and bf(c) flags.
392
393	enddit()
394
395em(Tar Long File Names)
396
397smbclient's tar option now supports long file names both on backup and
398restore. However, the full path name of the file must be less than
3991024 bytes.  Also, when a tar archive is created, smbclient's tar
400option places all files in the archive with relative names, not
401absolute names.
402
403em(Tar Filenames)
404
405All file names can be given as DOS path names (with tt(\) as the
406component separator) or as UNIX path names (with tt(/) as the
407component separator).
408
409em(Examples)
410
411startit()
412
413it() Restore from tar file backup.tar into myshare on mypc (no password on share).
414
415	tt(smbclient //mypc/myshare "" -N -Tx backup.tar)
416
417it() Restore everything except users/docs
418
419	tt(smbclient //mypc/myshare "" -N -TXx backup.tar users/docs)
420
421it() Create a tar file of the files beneath users/docs.
422
423	tt(smbclient //mypc/myshare "" -N -Tc backup.tar users/docs)
424
425it() Create the same tar file as above, but now use a DOS path name.
426
427	tt(smbclient //mypc/myshare "" -N -tc backup.tar users\edocs)
428
429it() Create a tar file of all the files and directories in the share.
430
431	tt(smbclient //mypc/myshare "" -N -Tc backup.tar *)
432
433endit()
434
435label(minusD)
436dit(bf(-D initial directory)) Change to initial directory before
437starting. Probably only of any use with the tar link(bf(-T))(minusT) option.
438
439label(minusc)
440dit(bf(-c command string)) command string is a semicolon separated
441list of commands to be executed instead of prompting from stdin.
442link(bf(-N))(minusN) is implied by bf(-c).
443
444This is particularly useful in scripts and for printing stdin to the
445server, e.g. tt(-c 'print -').
446
447enddit()
448
449label(OPERATIONS)
450manpagesection(OPERATIONS)
451
452Once the client is running, the user is presented with a prompt :
453
454tt(smb:\>)
455
456The backslash ("\") indicates the current working directory on the
457server, and will change if the current working directory is changed.
458
459The prompt indicates that the client is ready and waiting to carry out
460a user command. Each command is a single word, optionally followed by
461parameters specific to that command. Command and parameters are
462space-delimited unless these notes specifically state otherwise. All
463commands are case-insensitive.  Parameters to commands may or may not
464be case sensitive, depending on the command.
465
466You can specify file names which have spaces in them by quoting the
467name with double quotes, for example "a long file name".
468
469Parameters shown in square brackets (e.g., "[parameter]") are
470optional. If not given, the command will use suitable
471defaults. Parameters shown in angle brackets (e.g., "<parameter>") are
472required.
473
474Note that all commands operating on the server are actually performed
475by issuing a request to the server. Thus the behavior may vary from
476server to server, depending on how the server was implemented.
477
478The commands available are given here in alphabetical order.
479
480startdit()
481
482label(questionmark) dit(bf(? [command])) If "command" is specified,
483the bf(?) command will display a brief informative message about the
484specified command.  If no command is specified, a list of available
485commands will be displayed.
486
487label(exclaimationmark) dit(bf(! [shell command])) If "shell command"
488is specified, the bf(!)  command will execute a shell locally and run
489the specified shell command. If no command is specified, a local shell
490will be run.
491
492label(cd) dit(bf(cd [directory name])) If "directory name" is
493specified, the current working directory on the server will be changed
494to the directory specified. This operation will fail if for any reason
495the specified directory is inaccessible.
496
497If no directory name is specified, the current working directory on
498the server will be reported.
499
500label(del) dit(bf(del <mask>)) The client will request that the server
501attempt to delete all files matching "mask" from the current working
502directory on the server.
503
504label(dir) dit(bf(dir <mask>)) A list of the files matching "mask" in
505the current working directory on the server will be retrieved from the
506server and displayed.
507
508label(exit) dit(bf(exit)) Terminate the connection with the server and
509exit from the program.
510
511label(get) dit(bf(get <remote file name> [local file name])) Copy the
512file called "remote file name" from the server to the machine running
513the client. If specified, name the local copy "local file name".  Note
514that all transfers in smbclient are binary. See also the
515link(bf(lowercase))(lowercase) command.
516
517label(help) dit(bf(help [command])) See the link(bf(?))(questionmark)
518command above.
519
520label(lcd) dit(bf(lcd [directory name])) If "directory name" is
521specified, the current working directory on the local machine will
522be changed to the directory specified. This operation will fail if for
523any reason the specified directory is inaccessible.
524
525If no directory name is specified, the name of the current working
526directory on the local machine will be reported.
527
528label(lowercase) dit(bf(lowercase)) Toggle lowercasing of filenames
529for the link(bf(get))(get) and link(bf(mget))(mget) commands.
530
531When lowercasing is toggled ON, local filenames are converted to
532lowercase when using the link(bf(get))(get) and link(bf(mget))(mget)
533commands. This is often useful when copying (say) MSDOS files from a
534server, because lowercase filenames are the norm on UNIX systems.
535
536label(ls) dit(bf(ls <mask>)) See the link(bf(dir))(dir) command above.
537
538label(mask) dit(bf(mask <mask>)) This command allows the user to set
539up a mask which will be used during recursive operation of the
540link(bf(mget))(mget) and link(bf(mput))(mput) commands.
541
542The masks specified to the link(bf(mget))(mget) and
543link(bf(mput))(mput) commands act as filters for directories rather
544than files when recursion is toggled ON.
545
546The mask specified with the .B mask command is necessary to filter
547files within those directories. For example, if the mask specified in
548an link(bf(mget))(mget) command is "source*" and the mask specified
549with the mask command is "*.c" and recursion is toggled ON, the
550link(bf(mget))(mget) command will retrieve all files matching "*.c" in
551all directories below and including all directories matching "source*"
552in the current working directory.
553
554Note that the value for mask defaults to blank (equivalent to "*") and
555remains so until the mask command is used to change it. It retains the
556most recently specified value indefinitely. To avoid unexpected
557results it would be wise to change the value of .I mask back to "*"
558after using the link(bf(mget))(mget) or link(bf(mput))(mput) commands.
559
560label(md) dit(bf(md <directory name>)) See the link(bf(mkdir))(mkdir)
561command.
562
563label(mget) dit(bf(mget <mask>)) Copy all files matching mask from the
564server to the machine running the client.
565
566Note that mask is interpreted differently during recursive operation
567and non-recursive operation - refer to the link(bf(recurse))(recurse)
568and link(bf(mask))(mask) commands for more information. Note that all
569transfers in .B smbclient are binary. See also the
570link(bf(lowercase))(lowercase) command.
571
572label(mkdir) dit(bf(mkdir <directory name>)) Create a new directory on
573the server (user access privileges permitting) with the specified
574name.
575
576label(mput) dit(bf(mput <mask>)) Copy all files matching mask in
577the current working directory on the local machine to the current
578working directory on the server.
579
580Note that mask is interpreted differently during recursive operation
581and non-recursive operation - refer to the link(bf(recurse))(recurse)
582and link(bf(mask))(mask) commands for more information. Note that all
583transfers in .B smbclient are binary.
584
585label(print) dit(bf(print <file name>)) Print the specified file
586from the local machine through a printable service on the server.
587
588See also the link(bf(printmode))(printmode) command.
589
590label(printmode) dit(bf(printmode <graphics or text>)) Set the print
591mode to suit either binary data (such as graphical information) or
592text. Subsequent print commands will use the currently set print
593mode.
594
595label(prompt) dit(bf(prompt)) Toggle prompting for filenames during
596operation of the link(bf(mget))(mget) and link(bf(mput))(mput)
597commands.
598
599When toggled ON, the user will be prompted to confirm the transfer of
600each file during these commands. When toggled OFF, all specified files
601will be transferred without prompting.
602
603label(put) dit(bf(put <local file name> [remote file name])) Copy the
604file called "local file name" from the machine running the client to
605the server. If specified, name the remote copy "remote file name".
606Note that all transfers in smbclient are binary. See also the
607link(bf(lowercase))(lowercase) command.
608
609label(queue) dit(bf(queue)) Displays the print queue, showing the job
610id, name, size and current status.
611
612label(quit) dit(bf(quit)) See the link(bf(exit))(exit) command.
613
614label(rd) dit(bf(rd <directory name>)) See the link(bf(rmdir))(rmdir)
615command.
616
617label(recurse) dit(bf(recurse)) Toggle directory recursion for the
618commands link(bf(mget))(mget) and link(bf(mput))(mput).
619
620When toggled ON, these commands will process all directories in the
621source directory (i.e., the directory they are copying .IR from ) and
622will recurse into any that match the mask specified to the
623command. Only files that match the mask specified using the
624link(bf(mask))(mask) command will be retrieved. See also the
625link(bf(mask))(mask) command.
626
627When recursion is toggled OFF, only files from the current working
628directory on the source machine that match the mask specified to the
629link(bf(mget))(mget) or link(bf(mput))(mput) commands will be copied,
630and any mask specified using the link(bf(mask))(mask) command will be
631ignored.
632
633label(rm) dit(bf(rm <mask>)) Remove all files matching mask from
634the current working directory on the server.
635
636label(rmdir) dit(bf(rmdir <directory name>)) Remove the specified
637directory (user access privileges permitting) from the server.
638
639label(tar) dit(bf(tar <c|x>[IXbgNa])) Performs a tar operation - see
640the link(bf(-T))(minusT) command line option above. Behavior may be
641affected by the link(bf(tarmode))(tarmode) command (see below). Using
642g (incremental) and N (newer) will affect tarmode settings. Note that
643using the "-" option with tar x may not work - use the command line
644option instead.
645
646label(blocksize) dit(bf(blocksize <blocksize>)) Blocksize. Must be
647followed by a valid (greater than zero) blocksize. Causes tar file to
648be written out in blocksize*TBLOCK (usually 512 byte) blocks.
649
650label(tarmode) dit(bf(tarmode <full|inc|reset|noreset>)) Changes tar's
651behavior with regard to archive bits. In full mode, tar will back up
652everything regardless of the archive bit setting (this is the default
653mode). In incremental mode, tar will only back up files with the
654archive bit set. In reset mode, tar will reset the archive bit on all
655files it backs up (implies read/write share).
656
657label(setmode) dit(bf(setmode <filename> <perm=[+|\-]rsha>)) A version
658of the DOS attrib command to set file permissions. For example:
659
660tt(setmode myfile +r)
661
662would make myfile read only.
663
664enddit()
665
666label(NOTES)
667manpagesection(NOTES)
668
669Some servers are fussy about the case of supplied usernames,
670passwords, share names (AKA service names) and machine names. If you
671fail to connect try giving all parameters in uppercase.
672
673It is often necessary to use the link(bf(-n))(minusn) option when connecting to some
674types of servers. For example OS/2 LanManager insists on a valid
675NetBIOS name being used, so you need to supply a valid name that would
676be known to the server.
677
678smbclient supports long file names where the server supports the
679LANMAN2 protocol or above.
680
681label(ENVIRONMENTVARIABLES)
682manpagesection(ENVIRONMENT VARIABLES)
683
684The variable bf(USER) may contain the username of the person using the
685client.  This information is used only if the protocol level is high
686enough to support session-level passwords.
687
688The variable bf(PASSWD) may contain the password of the person using
689the client.  This information is used only if the protocol level is
690high enough to support session-level passwords.
691
692label(INSTALLATION)
693manpagesection(INSTALLATION)
694
695The location of the client program is a matter for individual system
696administrators. The following are thus suggestions only.
697
698It is recommended that the smbclient software be installed in the
699/usr/local/samba/bin or /usr/samba/bin directory, this directory
700readable by all, writeable only by root. The client program itself
701should be executable by all. The client should em(NOT) be setuid or
702setgid!
703
704The client log files should be put in a directory readable and
705writeable only by the user.
706
707To test the client, you will need to know the name of a running
708SMB/CIFS server. It is possible to run url(bf(smbd (8)))(smbd.8.html)
709an ordinary user - running that server as a daemon on a
710user-accessible port (typically any port number over 1024) would
711provide a suitable test server.
712
713label(DIAGNOSTICS)
714manpagesection(DIAGNOSTICS)
715
716Most diagnostics issued by the client are logged in a specified log
717file. The log file name is specified at compile time, but may be
718overridden on the command line.
719
720The number and nature of diagnostics available depends on the debug
721level used by the client. If you have problems, set the debug level to
7223 and peruse the log files.
723
724label(VERSION)
725manpagesection(VERSION)
726
727This man page is correct for version 2.0 of the Samba suite.
728
729label(AUTHOR)
730manpageauthor()
731
732The original Samba software and related utilities were created by
733Andrew Tridgell email(samba@samba.org). Samba is now developed
734by the Samba Team as an Open Source project similar to the way the
735Linux kernel is developed.
736
737The original Samba man pages were written by Karl Auer. The man page
738sources were converted to YODL format (another excellent piece of Open
739Source software, available at
740url(bf(ftp://ftp.icce.rug.nl/pub/unix/))(ftp://ftp.icce.rug.nl/pub/unix/))
741and updated for the Samba2.0 release by Jeremy Allison.
742email(samba@samba.org).
743
744See url(bf(samba (7)))(samba.7.html) to find out how to get a full
745list of contributors and details on how to submit bug reports,
746comments etc.
747