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