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