Added link to YODL url.
[samba.git] / docs / manpages / smbclient.1
1 .TH "smbclient" "1" "23 Oct 1998" "Samba" "SAMBA" 
2 .PP 
3 .SH "NAME" 
4 smbclient \- ftp-like client to access SMB/CIFS resources on servers
5 .PP 
6 .SH "SYNOPSIS" 
7 .PP 
8 \fBsmbclient\fP servicename [password] [-s smb\&.conf] [-B IP addr] [-O socket options][-R name resolve order] [-M NetBIOS name] [-i scope] [-N] [-n NetBIOS name] [-d debuglevel] [-P] [-p port] [-l log basename] [-h] [-I dest IP] [-E] [-U username] [-L NetBIOS name] [-t terminal code] [-m max protocol] [-W workgroup] [-T<c|x>IXFqgbNan] [-D directory] [-c command string]
9 .PP 
10 .SH "DESCRIPTION" 
11 .PP 
12 This program is part of the \fBSamba\fP suite\&.
13 .PP 
14 \fBsmbclient\fP is a client that can \'talk\' to an SMB/CIFS server\&. It
15 offers an interface similar to that of the ftp program (see \fBftp
16 (1)\fP)\&.  Operations include things like getting files from the server
17 to the local machine, putting files from the local machine to the
18 server, retrieving directory information from the server and so on\&.
19 .PP 
20 .SH "OPTIONS" 
21 .PP 
22 .IP 
23 .IP "\fBservicename\fP" 
24 servicename is the name of the service you want
25 to use on the server\&. A service name takes the form
26 \f(CW//server/service\fP where \fIserver\fP is the NetBIOS name of the SMB/CIFS
27 server offering the desired service and \fIservice\fP is the name
28 of the service offered\&. Thus to connect to the service \fIprinter\fP on
29 the SMB/CIFS server \fIsmbserver\fP, you would use the servicename
30 .IP 
31 \f(CW//smbserver/printer\fP
32 .IP 
33 Note that the server name required is NOT necessarily the IP (DNS)
34 host name of the server ! The name required is a NetBIOS server name,
35 which may or may not be the same as the IP hostname of the machine
36 running the server\&.
37 .IP 
38 The server name is looked up according to either the
39 \fB-R\fP parameter to \fBsmbclient\fP or using the
40 \fBname resolve order\fP
41 parameter in the smb\&.conf file, allowing an administrator to change
42 the order and methods by which server names are looked up\&.
43 .IP 
44 .IP "\fBpassword\fP" 
45 password is the password required to access the
46 specified service on the specified server\&. If this parameter is
47 supplied, the \fB-N\fP option (suppress password prompt) is assumed\&.
48 .IP 
49 There is no default password\&. If no password is supplied on the
50 command line (either by using this parameter or adding a password to
51 the \fB-U\fP option (see below)) and the \fB-N\fP option is not specified,
52 the client will prompt for a password, even if the desired service
53 does not require one\&. (If no password is required, simply press ENTER
54 to provide a null password\&.)
55 .IP 
56 Note: Some servers (including OS/2 and Windows for Workgroups) insist
57 on an uppercase password\&. Lowercase or mixed case passwords may be
58 rejected by these servers\&.
59 .IP 
60 Be cautious about including passwords in scripts\&.
61 .IP 
62 .IP "\fB-s smb\&.conf\fP" 
63 This parameter specifies the pathname to the
64 Samba configuration file, smb\&.conf\&. This file controls all aspects of
65 the Samba setup on the machine and smbclient also needs to read this
66 file\&.
67 .IP 
68 .IP "\fB-B IP addr\fP" 
69 The IP address to use when sending a broadcast packet\&.
70 .IP 
71 .IP "\fB-O socket options\fP" 
72 TCP socket options to set on the client
73 socket\&. See the socket options
74 parameter in the \fBsmb\&.conf (5)\fP manpage for
75 the list of valid options\&.
76 .IP 
77 .IP "\fB-R name resolve order\fP" 
78 This option allows the user of
79 smbclient to determine what name resolution services to use when
80 looking up the NetBIOS name of the host being connected to\&.
81 .IP 
82 The options are :"lmhosts", "host", "wins" and "bcast"\&. They cause
83 names to be resolved as follows :
84 .IP 
85 .IP 
86 .IP o 
87 \fBlmhosts\fP : Lookup an IP address in the Samba lmhosts file\&.
88 The lmhosts file is stored in the same directory as the
89 \fBsmb\&.conf\fP file\&.
90 .IP 
91 .IP o 
92 \fBhost\fP : Do a standard host name to IP address resolution,
93 using the system /etc/hosts, NIS, or DNS lookups\&. This method of name
94 resolution is operating system depended for instance on IRIX or
95 Solaris this may be controlled by the \fI/etc/nsswitch\&.conf\fP file)\&.  
96 .IP 
97 .IP o 
98 \fBwins\fP : Query a name with the IP address listed in the \fBwins
99 server\fP parameter in the smb\&.conf file\&. If 
100 no WINS server has been specified this method will be ignored\&.
101 .IP 
102 .IP o 
103 \fBbcast\fP : Do a broadcast on each of the known local interfaces
104 listed in the \fBinterfaces\fP 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\&. To specify a particular broadcast address the \fB-B\fP option 
108 may be used\&.
109 .IP 
110 .IP 
111 If this parameter is not set then the name resolver order defined
112 in the \fBsmb\&.conf\fP file parameter 
113 (\fBname resolve order\fP)
114 will be used\&.
115 .IP 
116 The default order is lmhosts, host, wins, bcast and without this
117 parameter or any entry in the \fB"name resolve
118 order"\fP parameter of the
119 \fBsmb\&.conf\fP file the name resolution methods
120 will be attempted in this order\&.
121 .IP 
122 .IP "\fB-M NetBIOS name\fP" 
123 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 .IP 
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 .IP 
132 The message is also automatically truncated if the message is over
133 1600 bytes, as this is the limit of the protocol\&.
134 .IP 
135 One useful trick is to cat the message through \fBsmbclient\fP\&.
136 For example:
137 .IP 
138 \f(CWcat mymessage\&.txt | smbclient -M FRED\fP
139 .IP 
140 will send the message in the file \fImymessage\&.txt\fP to the machine FRED\&.
141 .IP 
142 You may also find the \fB-U\fP and \fB-I\fP options useful, as they allow
143 you to control the FROM and TO parts of the message\&.
144 .IP 
145 See the \fBmessage command\fP
146 parameter in the \fBsmb\&.conf (5)\fP for a description of how to handle
147 incoming WinPopup messages in Samba\&.
148 .IP 
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 .IP 
152 .IP "\fB-i scope\fP" 
153 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 \fIvery\fP 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 .IP 
160 .IP "\fB-N\fP" 
161 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 .IP 
165 Unless a password is specified on the command line or this parameter
166 is specified, the client will request a password\&.
167 .IP 
168 .IP "\fB-n NetBIOS name\fP" 
169 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 .IP 
174 .IP "\fB-d debuglevel\fP" 
175 debuglevel is an integer from 0 to 10, or the
176 letter \'A\'\&.
177 .IP 
178 The default value if this parameter is not specified is zero\&.
179 .IP 
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 .IP 
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 \fIall\fP debug messages will be printed\&. This setting
191 is for developers only (and people who \fIreally\fP want to know how the
192 code works internally)\&.
193 .IP 
194 Note that specifying this parameter here will override the \fBlog
195 level\fP parameter in the \fBsmb\&.conf
196 (5)\fP file\&.
197 .IP 
198 .IP "\fB-P\fP" 
199 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 .IP 
203 .IP "\fB-p port\fP" 
204 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 .IP 
208 .IP "\fB-l logfilename\fP" 
209 If specified, logfilename specifies a base
210 filename into which operational data from the running client will be
211 logged\&.
212 .IP 
213 The default base name is specified at compile time\&.
214 .IP 
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 \f(CWlog\&.client\fP\&.
218 .IP 
219 The log file generated is never removed by the client\&.
220 .IP 
221 .IP "\fB-h\fP" 
222 Print the usage message for the client\&.
223 .IP 
224 .IP "\fB-I IP address\fP" 
225 IP address is the address of the server to
226 connect to\&. It should be specified in standard "a\&.b\&.c\&.d" notation\&.
227 .IP 
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 \fBname resolve order\fP 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 .IP 
235 There is no default for this parameter\&. If not supplied, it will be
236 determined automatically by the client as described above\&.
237 .IP 
238 .IP "\fB-E\fP" 
239 This parameter causes the client to write messages to the
240 standard error stream (stderr) rather than to the standard output
241 stream\&.
242 .IP 
243 By default, the client writes messages to standard output - typically
244 the user\'s tty\&.
245 .IP 
246 .IP "\fB-U username\fP" 
247 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 .IP 
252 Some servers are fussy about the case of this name, and some insist
253 that it must be a valid NetBIOS name\&.
254 .IP 
255 If no username is supplied, it will default to an uppercase version of
256 the environment variable \f(CWUSER\fP or \f(CWLOGNAME\fP in that order\&.  If no
257 username is supplied and neither environment variable exists the
258 username "GUEST" will be used\&.
259 .IP 
260 If the \f(CWUSER\fP environment variable containts a \'%\' character,
261 everything after that will be treated as a password\&. This allows you
262 to set the environment variable to be \f(CWUSER=username%password\fP so
263 that a password is not passed on the command line (where it may be
264 seen by the ps command)\&.
265 .IP 
266 If the service you are connecting to requires a password, it can be
267 supplied using the \fB-U\fP option, by appending a percent symbol ("%")
268 then the password to username\&.  For example, to attach to a service as
269 user \f(CW"fred"\fP with password \f(CW"secret"\fP, you would specify\&. 
270 .br 
271 .IP 
272 \f(CW-U fred%secret\fP 
273 .br 
274 .IP 
275 on the command line\&. Note that there are no spaces around the percent
276 symbol\&.
277 .IP 
278 If you specify the password as part of username then the \fB-N\fP option
279 (suppress password prompt) is assumed\&.
280 .IP 
281 If you specify the password as a parameter \fIAND\fP as part of username
282 then the password as part of username will take precedence\&. Putting
283 nothing before or nothing after the percent symbol will cause an empty
284 username or an empty password to be used, respectively\&.
285 .IP 
286 The password may also be specified by setting up an environment
287 variable called \f(CWPASSWORD\fP that contains the users password\&. Note
288 that this may be very insecure on some systems but on others allows
289 users to script smbclient commands without having a password appear in
290 the command line of a process listing\&.
291 .IP 
292 Note: Some servers (including OS/2 and Windows for Workgroups) insist
293 on an uppercase password\&. Lowercase or mixed case passwords may be
294 rejected by these servers\&.
295 .IP 
296 Be cautious about including passwords in scripts or in the
297 \f(CWPASSWORD\fP environment variable\&. Also, on many systems the command
298 line of a running process may be seen via the \f(CWps\fP command to be
299 safe always allow smbclient to prompt for a password and type it in
300 directly\&.
301 .IP 
302 .IP "\fB-L\fP" 
303 This option allows you to look at what services are
304 available on a server\&. You use it as \f(CW"smbclient -L host"\fP and a
305 list should appear\&.  The \fB-I\fP option may be useful if your NetBIOS
306 names don\'t match your tcp/ip dns host names or if you are trying to
307 reach a host on another network\&.
308 .IP 
309 .IP "\fB-t terminal code\fP" 
310 This option tells smbclient how to interpret
311 filenames coming from the remote server\&. Usually Asian language
312 multibyte UNIX implementations use different character sets than
313 SMB/CIFS servers (\fIEUC\fP instead of \fISJIS\fP for example)\&. Setting
314 this parameter will let smbclient convert between the UNIX filenames
315 and the SMB filenames correctly\&. This option has not been seriously
316 tested and may have some problems\&.
317 .IP 
318 The terminal codes include \f(CWsjis\fP, \f(CWeuc\fP, \f(CWjis7\fP, \f(CWjis8\fP,
319 \f(CWjunet\fP, \f(CWhex\fP, \f(CWcap\fP\&. This is not a complete list, check the
320 Samba source code for the complete list\&.
321 .IP 
322 .IP "\fB-m max protocol level\fP" 
323 With the new code in Samba2\&.0,
324 \fBsmbclient\fP allways attempts to connect at the maximum
325 protocols level the server supports\&. This parameter is
326 preserved for backwards compatibility, but any string
327 following the \fB-m\fP will be ignored\&.
328 .IP 
329 .IP "\fB-W WORKGROUP\fP" 
330 Override the default workgroup specified in the
331 \fBworkgroup\fP parameter of the
332 \fBsmb\&.conf\fP file for this connection\&. This may
333 be needed to connect to some servers\&.
334 .IP 
335 .IP "\fB-T tar options\fP" 
336 smbclient may be used to create
337 \fBtar (1)\fP compatible backups of all the files on an SMB/CIFS
338 share\&. The secondary tar flags that can be given to this option are :
339 .IP 
340 .IP 
341 .IP "\fBc\fP" 
342 Create a tar file on UNIX\&. Must be followed by the
343 name of a tar file, tape device or \f(CW"-"\fP for standard output\&. If
344 using standard output you must turn the log level to its lowest value
345 \f(CW-d0\fP to avoid corrupting your tar file\&. This flag is
346 mutually exclusive with the \fBx\fP flag\&.
347 .IP 
348 .IP "\fBx\fP" 
349 Extract (restore) a local tar file back to a
350 share\&. Unless the \fB-D\fP option is given, the tar files will be
351 restored from the top level of the share\&. Must be followed by the name
352 of the tar file, device or \f(CW"-"\fP for standard input\&. Mutually exclusive
353 with the \fBc\fP flag\&. Restored files have theuir creation times (mtime)
354 set to the date saved in the tar file\&. Directories currently do not
355 get their creation dates restored properly\&.
356 .IP 
357 .IP "\fBI\fP" 
358 Include files and directories\&. Is the default
359 behaviour when filenames are specified above\&. Causes tar files to
360 be included in an extract or create (and therefore everything else to
361 be excluded)\&. See example below\&.  Filename globbing does not work for
362 included files for extractions (yet)\&.
363 .IP 
364 .IP "\fBX\fP" 
365 Exclude files and directories\&. Causes tar files to
366 be excluded from an extract or create\&. See example below\&.  Filename
367 globbing does not work for excluded files (yet)\&.
368 .IP 
369 .IP "\fBb\fP" 
370 Blocksize\&. Must be followed by a valid (greater than
371 zero) blocksize\&.  Causes tar file to be written out in
372 blocksize*TBLOCK (usually 512 byte) blocks\&.
373 .IP 
374 .IP "\fBg\fP" 
375 Incremental\&. Only back up files that have the
376 archive bit set\&. Useful only with the \fBc\fP flag\&.
377 .IP 
378 .IP "\fBq\fP" 
379 Quiet\&. Keeps tar from printing diagnostics as it
380 works\&.  This is the same as tarmode quiet\&.
381 .IP 
382 .IP "\fBN\fP" 
383 Newer than\&. Must be followed by the name of a file
384 whose date is compared against files found on the share during a
385 create\&. Only files newer than the file specified are backed up to the
386 tar file\&. Useful only with the \fBc\fP flag\&.
387 .IP 
388 .IP "\fBa\fP" 
389 Set archive bit\&. Causes the archive bit to be reset
390 when a file is backed up\&. Useful with the \fBg\fP and \fBc\fP flags\&.
391 .IP 
392 .IP 
393 \fITar Long File Names\fP
394 .IP 
395 smbclient\'s tar option now supports long file names both on backup and
396 restore\&. However, the full path name of the file must be less than
397 1024 bytes\&.  Also, when a tar archive is created, smbclient\'s tar
398 option places all files in the archive with relative names, not
399 absolute names\&.
400 .IP 
401 \fITar Filenames\fP
402 .IP 
403 All file names can be given as DOS path names (with \f(CW\e\fP as the
404 component separator) or as UNIX path names (with \f(CW/\fP as the
405 component separator)\&.
406 .IP 
407 \fIExamples\fP
408 .IP 
409 .IP 
410 .IP o 
411 Restore from tar file backup\&.tar into myshare on mypc (no password on share)\&.
412 .IP 
413 \f(CWsmbclient //mypc/myshare "" -N -Tx backup\&.tar\fP
414 .IP 
415 .IP o 
416 Restore everything except users/docs
417 .IP 
418 \f(CWsmbclient //mypc/myshare "" -N -TXx backup\&.tar users/docs\fP
419 .IP 
420 .IP o 
421 Create a tar file of the files beneath users/docs\&.
422 .IP 
423 \f(CWsmbclient //mypc/myshare "" -N -Tc backup\&.tar users/docs\fP
424 .IP 
425 .IP o 
426 Create the same tar file as above, but now use a DOS path name\&.
427 .IP 
428 \f(CWsmbclient //mypc/myshare "" -N -tc backup\&.tar users\eedocs\fP
429 .IP 
430 .IP o 
431 Create a tar file of all the files and directories in the share\&.
432 .IP 
433 \f(CWsmbclient //mypc/myshare "" -N -Tc backup\&.tar *\fP
434 .IP 
435 .IP 
436 .IP "\fB-D initial directory\fP" 
437 Change to initial directory before
438 starting\&. Probably only of any use with the tar \fB-T\fP option\&.
439 .IP 
440 .IP "\fB-c command string\fP" 
441 command string is a semicolon separated
442 list of commands to be executed instead of prompting from stdin\&.
443 \fB-N\fP is implied by \fB-c\fP\&.
444 .IP 
445 This is particularly useful in scripts and for printing stdin to the
446 server, e\&.g\&. \f(CW-c \'print -\'\fP\&.
447 .IP 
448 .PP 
449 .SH "OPERATIONS" 
450 .PP 
451 Once the client is running, the user is presented with a prompt :
452 .PP 
453 \f(CWsmb:\e>\fP
454 .PP 
455 The backslash ("\e") indicates the current working directory on the
456 server, and will change if the current working directory is changed\&.
457 .PP 
458 The prompt indicates that the client is ready and waiting to carry out
459 a user command\&. Each command is a single word, optionally followed by
460 parameters specific to that command\&. Command and parameters are
461 space-delimited unless these notes specifically state otherwise\&. All
462 commands are case-insensitive\&.  Parameters to commands may or may not
463 be case sensitive, depending on the command\&.
464 .PP 
465 You can specify file names which have spaces in them by quoting the
466 name with double quotes, for example "a long file name"\&.
467 .PP 
468 Parameters shown in square brackets (eg\&., "[parameter]") are
469 optional\&. If not given, the command will use suitable
470 defaults\&. Parameters shown in angle brackets (eg\&., "<parameter>") are
471 required\&.
472 .PP 
473 Note that all commands operating on the server are actually performed
474 by issuing a request to the server\&. Thus the behaviour may vary from
475 server to server, depending on how the server was implemented\&.
476 .PP 
477 The commands available are given here in alphabetical order\&.
478 .PP 
479 .IP 
480 .IP "\fB? [command]\fP" 
481 If "command" is specified,
482 the \fB?\fP command will display a brief informative message about the
483 specified command\&.  If no command is specified, a list of available
484 commands will be displayed\&.
485 .IP 
486 .IP "\fB! [shell command]\fP" 
487 If "shell command"
488 is specified, the \fB!\fP  command will execute a shell locally and run
489 the specified shell command\&. If no command is specified, a local shell
490 will be run\&.
491 .IP 
492 .IP "\fBcd [directory name]\fP" 
493 If "directory name" is
494 specified, the current working directory on the server will be changed
495 to the directory specified\&. This operation will fail if for any reason
496 the specified directory is inaccessible\&.
497 .IP 
498 If no directory name is specified, the current working directory on
499 the server will be reported\&.
500 .IP 
501 .IP "\fBdel <mask>\fP" 
502 The client will request that the server
503 attempt to delete all files matching "mask" from the current working
504 directory on the server\&.
505 .IP 
506 .IP "\fBdir <mask>\fP" 
507 A list of the files matching "mask" in
508 the current working directory on the server will be retrieved from the
509 server and displayed\&.
510 .IP 
511 .IP "\fBexit\fP" 
512 Terminate the connection with the server and
513 exit from the program\&.
514 .IP 
515 .IP "\fBget <remote file name> [local file name]\fP" 
516 Copy the
517 file called "remote file name" from the server to the machine running
518 the client\&. If specified, name the local copy "local file name"\&.  Note
519 that all transfers in smbclient are binary\&. See also the
520 \fBlowercase\fP command\&.
521 .IP 
522 .IP "\fBhelp [command]\fP" 
523 See the \fB?\fP
524 command above\&.
525 .IP 
526 .IP "\fBlcd [directory name]\fP" 
527 If "directory name" is
528 specified, the current working directory on the local machine will
529 be changed to the directory specified\&. This operation will fail if for
530 any reason the specified directory is inaccessible\&.
531 .IP 
532 If no directory name is specified, the name of the current working
533 directory on the local machine will be reported\&.
534 .IP 
535 .IP "\fBlowercase\fP" 
536 Toggle lowercasing of filenames
537 for the \fBget\fP and \fBmget\fP commands\&.
538 .IP 
539 When lowercasing is toggled ON, local filenames are converted to
540 lowercase when using the \fBget\fP and \fBmget\fP
541 commands\&. This is often useful when copying (say) MSDOS files from a
542 server, because lowercase filenames are the norm on UNIX systems\&.
543 .IP 
544 .IP "\fBls <mask>\fP" 
545 See the \fBdir\fP command above\&.
546 .IP 
547 .IP "\fBmask <mask>\fP" 
548 This command allows the user to set
549 up a mask which will be used during recursive operation of the
550 \fBmget\fP and \fBmput\fP commands\&.
551 .IP 
552 The masks specified to the \fBmget\fP and
553 \fBmput\fP commands act as filters for directories rather
554 than files when recursion is toggled ON\&.
555 .IP 
556 The mask specified with the \&.B mask command is necessary to filter
557 files within those directories\&. For example, if the mask specified in
558 an \fBmget\fP command is "source*" and the mask specified
559 with the mask command is "*\&.c" and recursion is toggled ON, the
560 \fBmget\fP command will retrieve all files matching "*\&.c" in
561 all directories below and including all directories matching "source*"
562 in the current working directory\&.
563 .IP 
564 Note that the value for mask defaults to blank (equivalent to "*") and
565 remains so until the mask command is used to change it\&. It retains the
566 most recently specified value indefinitely\&. To avoid unexpected
567 results it would be wise to change the value of \&.I mask back to "*"
568 after using the \fBmget\fP or \fBmput\fP commands\&.
569 .IP 
570 .IP "\fBmd <directory name>\fP" 
571 See the \fBmkdir\fP
572 command\&.
573 .IP 
574 .IP "\fBmget <mask>\fP" 
575 Copy all files matching mask from the
576 server to the machine running the client\&.
577 .IP 
578 Note that mask is interpreted differently during recursive operation
579 and non-recursive operation - refer to the \fBrecurse\fP
580 and \fBmask\fP commands for more information\&. Note that all
581 transfers in \&.B smbclient are binary\&. See also the
582 \fBlowercase\fP command\&.
583 .IP 
584 .IP "\fBmkdir <directory name>\fP" 
585 Create a new directory on
586 the server (user access privileges permitting) with the specified
587 name\&.
588 .IP 
589 .IP "\fBmput <mask>\fP" 
590 Copy all files matching mask in
591 the current working directory on the local machine to the current
592 working directory on the server\&.
593 .IP 
594 Note that mask is interpreted differently during recursive operation
595 and non-recursive operation - refer to the \fBrecurse\fP
596 and \fBmask\fP commands for more information\&. Note that all
597 transfers in \&.B smbclient are binary\&.
598 .IP 
599 .IP "\fBprint <file name>\fP" 
600 Print the specified file
601 from the local machine through a printable service on the server\&.
602 .IP 
603 See also the \fBprintmode\fP command\&.
604 .IP 
605 .IP "\fBprintmode <graphics or text>\fP" 
606 Set the print
607 mode to suit either binary data (such as graphical information) or
608 text\&. Subsequent print commands will use the currently set print
609 mode\&.
610 .IP 
611 dir(\fBprompt\fP) Toggle prompting for filenames during
612 operation of the \fBmget\fP and \fBmput\fP
613 commands\&.
614 .IP 
615 When toggled ON, the user will be prompted to confirm the transfer of
616 each file during these commands\&. When toggled OFF, all specified files
617 will be transferred without prompting\&.
618 .IP 
619 .IP "\fBput <local file name> [remote file name]\fP" 
620 Copy the
621 file called "local file name" from the machine running the client to
622 the server\&. If specified, name the remote copy "remote file name"\&.
623 Note that all transfers in smbclient are binary\&. See also the
624 \fBlowercase\fP command\&.
625 .IP 
626 dir(\fBqueue\fP) Displays the print queue, showing the job
627 id, name, size and current status\&.
628 .IP 
629 .IP "\fBquit\fP" 
630 See the \fBexit\fP command\&.
631 .IP 
632 dir(\fBrd <directory name>\fP) See the \fBrmdir\fP
633 command\&.
634 .IP 
635 dir(\fBrecurse\fP) Toggle directory recursion for the
636 commands \fBmget\fP and \fBmput\fP\&.
637 .IP 
638 When toggled ON, these commands will process all directories in the
639 source directory (i\&.e\&., the directory they are copying \&.IR from ) and
640 will recurse into any that match the mask specified to the
641 command\&. Only files that match the mask specified using the
642 \fBmask\fP command will be retrieved\&. See also the
643 \fBmask\fP command\&.
644 .IP 
645 When recursion is toggled OFF, only files from the current working
646 directory on the source machine that match the mask specified to the
647 \fBmget\fP or \fBmput\fP commands will be copied,
648 and any mask specified using the \fBmask\fP command will be
649 ignored\&.
650 .IP 
651 dir(\fBrm <mask>\fP) Remove all files matching mask from
652 the current working directory on the server\&.
653 .IP 
654 .IP "\fBrmdir <directory name>\fP" 
655 Remove the specified
656 directory (user access privileges permitting) from the server\&.
657 .IP 
658 .IP "\fBtar <c|x>[IXbgNa]\fP" 
659 Performs a tar operation - see
660 the \fB-T\fP command line option above\&. Behaviour may be
661 affected by the \fBtarmode\fP command (see below)\&. Using
662 g (incremental) and N (newer) will affect tarmode settings\&. Note that
663 using the "-" option with tar x may not work - use the command line
664 option instead\&.
665 .IP 
666 .IP "\fBblocksize <blocksize>\fP" 
667 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 .IP 
671 dir(\fBtarmode <full|inc|reset|noreset>\fP) Changes tar\'s
672 behaviour 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 .IP 
678 .IP "\fBsetmode <filename> <perm=[+|\e-]rsha>\fP" 
679 A version
680 of the DOS attrib command to set file permissions\&. For example:
681 .IP 
682 \f(CWsetmode myfile +r\fP
683 .IP 
684 would make myfile read only\&.
685 .IP 
686 .PP 
687 .SH "NOTES" 
688 .PP 
689 Some servers are fussy about the case of supplied usernames,
690 passwords, share names (aka service names) and machine names\&. If you
691 fail to connect try giving all parameters in uppercase\&.
692 .PP 
693 It is often necessary to use the \fB-n\fP option when connecting to some
694 types of servers\&. For example OS/2 LanManager insists on a valid
695 NetBIOS name being used, so you need to supply a valid name that would
696 be known to the server\&.
697 .PP 
698 smbclient supports long file names where the server supports the
699 LANMAN2 protocol or above\&.
700 .PP 
701 .SH "ENVIRONMENT VARIABLES" 
702 .PP 
703 The variable \fBUSER\fP may contain the username of the person using the
704 client\&.  This information is used only if the protocol level is high
705 enough to support session-level passwords\&.
706 .PP 
707 The variable \fBPASSWORD\fP may contain the password of the person using
708 the client\&.  This information is used only if the protocol level is
709 high enough to support session-level passwords\&.
710 .PP 
711 .SH "INSTALLATION" 
712 .PP 
713 The location of the client program is a matter for individual system
714 administrators\&. The following are thus suggestions only\&.
715 .PP 
716 It is recommended that the smbclient software be installed in the
717 /usr/local/samba/bin or /usr/samba/bin directory, this directory
718 readable by all, writeable only by root\&. The client program itself
719 should be executable by all\&. The client should \fINOT\fP be setuid or
720 setgid!
721 .PP 
722 The client log files should be put in a directory readable and
723 writable only by the user\&.
724 .PP 
725 To test the client, you will need to know the name of a running
726 SMB/CIFS server\&. It is possible to run \fBsmbd (8)\fP
727 an ordinary user - running that server as a daemon on a
728 user-accessible port (typically any port number over 1024) would
729 provide a suitable test server\&.
730 .PP 
731 .SH "DIAGNOSTICS" 
732 .PP 
733 Most diagnostics issued by the client are logged in a specified log
734 file\&. The log file name is specified at compile time, but may be
735 overridden on the command line\&.
736 .PP 
737 The number and nature of diagnostics available depends on the debug
738 level used by the client\&. If you have problems, set the debug level to
739 3 and peruse the log files\&.
740 .PP 
741 .SH "VERSION" 
742 .PP 
743 This man page is correct for version 2\&.0 of the Samba suite\&.
744 .PP 
745 .SH "AUTHOR" 
746 .PP 
747 The original Samba software and related utilities were created by
748 Andrew Tridgell \fIsamba-bugs@samba\&.anu\&.edu\&.au\fP\&. Samba is now developed
749 by the Samba Team as an Open Source project similar to the way the
750 Linux kernel is developed\&.
751 .PP 
752 The original Samba man pages were written by Karl Auer\&. The man page
753 sources were converted to YODL format (another excellent piece of Open
754 Source software, available at
755 \fBftp://ftp\&.icce\&.rug\&.nl/pub/unix/\fP)
756 and updated for the Samba2\&.0 release by Jeremy Allison\&.
757 \fIsamba-bugs@samba\&.anu\&.edu\&.au\fP\&.
758 .PP 
759 See \fBsamba (7)\fP to find out how to get a full
760 list of contributors and details on how to submit bug reports,
761 comments etc\&.