Fix samba-docs build after svn conversion and Samba3 By Example addition.
[Samba.git] / docs / manpages / smbclient.1.xml
blobe268019fea5af2042b24008b1761e19ffdd962f2
1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
3                                   
4 <!ENTITY % globalentities SYSTEM '../entities/global.entities'> %globalentities;
5 ]>
6 <refentry id="smbclient.1">
8 <refmeta>
9         <refentrytitle>smbclient</refentrytitle>
10         <manvolnum>1</manvolnum>
11 </refmeta>
14 <refnamediv>
15         <refname>smbclient</refname>
16         <refpurpose>ftp-like client to access SMB/CIFS resources 
17         on servers</refpurpose>
18 </refnamediv>
20 <refsynopsisdiv>
21         <cmdsynopsis>
22                 <command>smbclient</command>
23                 <arg choice="req">servicename</arg>
24                 <arg choice="opt">password</arg>
25                 <arg choice="opt">-b &lt;buffer size&gt;</arg>
26                 <arg choice="opt">-d debuglevel</arg>
27                 <arg choice="opt">-D Directory</arg>
28                 <arg choice="opt">-U username</arg>
29                 <arg choice="opt">-W workgroup</arg>
30                 <arg choice="opt">-M &lt;netbios name&gt;</arg>
31                 <arg choice="opt">-m maxprotocol</arg>
32                 <arg choice="opt">-A authfile</arg>
33                 <arg choice="opt">-N</arg>
34                 <arg choice="opt">-l logdir</arg>
35                 <arg choice="opt">-L &lt;netbios name&gt;</arg>
36                 <arg choice="opt">-I destinationIP</arg>
37                 <arg choice="opt">-E</arg>
38                 <arg choice="opt">-c &lt;command string&gt;</arg>
39                 <arg choice="opt">-i scope</arg>
40                 <arg choice="opt">-O &lt;socket options&gt;</arg>
41                 <arg choice="opt">-p port</arg>
42                 <arg choice="opt">-R &lt;name resolve order&gt;</arg>
43                 <arg choice="opt">-s &lt;smb config file&gt;</arg>
44                 <arg choice="opt">-T&lt;c|x&gt;IXFqgbNan</arg>
45                 <arg choice="opt">-k</arg>
46         </cmdsynopsis>
47 </refsynopsisdiv>
49 <refsect1>
50         <title>DESCRIPTION</title>
52         <para>This tool is part of the <citerefentry><refentrytitle>Samba</refentrytitle>
53         <manvolnum>7</manvolnum></citerefentry> suite.</para>
55         <para><command>smbclient</command> is a client that can 
56         'talk' to an SMB/CIFS server. It offers an interface
57         similar to that of the ftp program (see <citerefentry><refentrytitle>ftp</refentrytitle>
58         <manvolnum>1</manvolnum></citerefentry>).  
59         Operations include things like getting files from the server 
60         to the local machine, putting files from the local machine to 
61         the server, retrieving directory information from the server 
62         and so on. </para>
63 </refsect1>
66 <refsect1>
67         <title>OPTIONS</title>
68         
69         <variablelist>
70                 <varlistentry>
71                 <term>servicename</term>
72                 <listitem><para>servicename is the name of the service 
73                 you want to use on the server. A service name takes the form
74                 <filename>//server/service</filename> where <parameter>server
75                 </parameter> is the NetBIOS name of the SMB/CIFS server 
76                 offering the desired service and <parameter>service</parameter> 
77                 is the name of the service offered.  Thus to connect to 
78                 the service "printer" on the SMB/CIFS server "smbserver",
79                 you would use the servicename <filename>//smbserver/printer
80                 </filename></para>
82                 <para>Note that the server name required is NOT necessarily 
83                 the IP (DNS) host name of the server !  The name required is 
84                 a NetBIOS server name, which may or may not be the
85                 same as the IP hostname of the machine running the server.
86                 </para>
88                 <para>The server name is looked up according to either 
89                 the <parameter>-R</parameter> parameter to <command>smbclient</command> or 
90                 using the name resolve order parameter in 
91                 the <citerefentry><refentrytitle>smb.conf</refentrytitle>
92                 <manvolnum>5</manvolnum></citerefentry> file, 
93                 allowing an administrator to change the order and methods 
94                 by which server names are looked up. </para></listitem>
95                 </varlistentry>
97                 <varlistentry>
98                 <term>password</term>
99                 <listitem><para>The password required to access the specified 
100                 service on the specified server. If this parameter is 
101                 supplied, the <parameter>-N</parameter> option (suppress 
102                 password prompt) is assumed. </para>
104                 <para>There is no default password. If no password is supplied 
105                 on the command line (either by using this parameter or adding 
106                 a password to the <parameter>-U</parameter> option (see 
107                 below)) and the <parameter>-N</parameter> option is not 
108                 specified, the client will prompt for a password, even if 
109                 the desired service does not require one. (If no password is 
110                 required, simply press ENTER to provide a null password.)
111                 </para>
113                 <para>Note: Some servers (including OS/2 and Windows for 
114                 Workgroups) insist on an uppercase password. Lowercase 
115                 or mixed case passwords may be rejected by these servers.               
116                 </para>
118                 <para>Be cautious about including passwords in scripts.
119                 </para></listitem>
120                 </varlistentry>
121                 
122                 <varlistentry>
123                 <term>-R &lt;name resolve order&gt;</term> 
124                 <listitem><para>This option is used by the programs in the Samba 
125                 suite to determine what naming services and in what order to resolve 
126                 host names to IP addresses. The option takes a space-separated 
127                 string of different name resolution options.</para>
129                 <para>The options are :"lmhosts", "host", "wins" and "bcast". They 
130                 cause names to be resolved as follows:</para>
132                 <itemizedlist>
133                         <listitem><para><constant>lmhosts</constant>: Lookup an IP 
134                         address in the Samba lmhosts file. If the line in lmhosts has 
135                         no name type attached to the NetBIOS name (see 
136                         the <citerefentry><refentrytitle>lmhosts</refentrytitle>
137                         <manvolnum>5</manvolnum></citerefentry> for details) then
138                         any name type matches for lookup.</para>
139                         </listitem>
140                         
141                         <listitem><para><constant>host</constant>: Do a standard host 
142                         name to IP address resolution, using the system <filename>/etc/hosts
143                         </filename>, NIS, or DNS lookups. This method of name resolution 
144                         is operating system dependent, for instance on IRIX or Solaris this 
145                         may be controlled by the <filename>/etc/nsswitch.conf</filename> 
146                         file).  Note that this method is only used if the NetBIOS name 
147                         type being queried is the 0x20 (server) name type, otherwise 
148                         it is ignored.</para>
149                         </listitem>
150                         
151                         <listitem><para><constant>wins</constant>: Query a name with 
152                         the IP address listed in the <parameter>wins server</parameter>
153                         parameter.  If no WINS server has
154                         been specified this method will be ignored.</para>
155                         </listitem>
156                         
157                         <listitem><para><constant>bcast</constant>: Do a broadcast on 
158                         each of the known local interfaces listed in the 
159                         <parameter>interfaces</parameter>
160                         parameter. This is the least reliable of the name resolution 
161                         methods as it depends on the target host being on a locally 
162                         connected subnet.</para>
163                         </listitem>
164                 </itemizedlist>
166                 <para>If this parameter is not set then the name resolve order 
167                 defined in the <citerefentry><refentrytitle>smb.conf</refentrytitle>
168                 <manvolnum>5</manvolnum></citerefentry> file parameter  
169                 (name resolve order) will be used. </para>
171                 <para>The default order is lmhosts, host, wins, bcast and without 
172                 this parameter or any entry in the <parameter>name resolve order
173                 </parameter> parameter of the <citerefentry><refentrytitle>smb.conf</refentrytitle>
174                 <manvolnum>5</manvolnum></citerefentry> file the name resolution
175                 methods will be attempted in this order. </para></listitem>
176                 </varlistentry>
177                 
178                 
179                 <varlistentry>
180                 <term>-M NetBIOS name</term>
181                 <listitem><para>This options allows you to send messages, using 
182                 the "WinPopup" protocol, to another computer. Once a connection is 
183                 established you then type your message, pressing ^D (control-D) to 
184                 end. </para>
186                 <para>If the receiving computer is running WinPopup the user will 
187                 receive the message and probably a beep. If they are not running 
188                 WinPopup the message will be lost, and no error message will 
189                 occur. </para>
191                 <para>The message is also automatically truncated if the message 
192                 is over 1600 bytes, as this is the limit of the protocol. 
193                 </para>
195                 <para>One useful trick is to cat the message through
196                 <command>smbclient</command>. For example: <command>
197                 cat mymessage.txt | smbclient -M FRED </command> will 
198                 send the message in the file <filename>mymessage.txt</filename> 
199                 to the machine FRED. </para>
201                 <para>You may also find the <parameter>-U</parameter> and 
202                 <parameter>-I</parameter> options useful, as they allow you to 
203                 control the FROM and TO parts of the message. </para>
205                 <para>See the <parameter>message command</parameter> parameter in the <citerefentry><refentrytitle>smb.conf</refentrytitle>
206                 <manvolnum>5</manvolnum></citerefentry> for a description of how to handle incoming 
207                 WinPopup messages in Samba. </para>
209                 <para><emphasis>Note</emphasis>: Copy WinPopup into the startup group 
210                 on your WfWg PCs if you want them to always be able to receive 
211                 messages. </para></listitem>
212                 </varlistentry>
213                 
214                 <varlistentry>
215                 <term>-p port</term>
216                 <listitem><para>This number is the TCP port number that will be used 
217                 when making connections to the server. The standard (well-known)
218                 TCP port number for an SMB/CIFS server is 139, which is the 
219                 default. </para></listitem>
220                 </varlistentry>
221                 
222                 
223                 &stdarg.help;
224                 
225                 <varlistentry>
226                 <term>-I IP-address</term>
227                 <listitem><para><replaceable>IP address</replaceable> is the address of the server to connect to. 
228                 It should be specified in standard "a.b.c.d" notation. </para>
230                 <para>Normally the client would attempt to locate a named 
231                 SMB/CIFS server by looking it up via the NetBIOS name resolution 
232                 mechanism described above in the <parameter>name resolve order</parameter> 
233                 parameter above. Using this parameter will force the client
234                 to assume that the server is on the machine with the specified IP 
235                 address and the NetBIOS name component of the resource being 
236                 connected to will be ignored. </para>
238                 <para>There is no default for this parameter. If not supplied, 
239                 it will be determined automatically by the client as described 
240                 above. </para></listitem>
241                 </varlistentry>
242                 
243                 
244                 
245                 <varlistentry>
246                 <term>-E</term>
247                 <listitem><para>This parameter causes the client to write messages 
248                 to the standard error stream (stderr) rather than to the standard 
249                 output stream. </para>
250                 
251                 <para>By default, the client writes messages to standard output 
252                 - typically the user's tty. </para></listitem>
253                 </varlistentry>
254                 
255                 
256                 <varlistentry>
257                 <term>-L</term>
258                 <listitem><para>This option allows you to look at what services 
259                 are available on a server. You use it as <command>smbclient -L 
260                 host</command> and a list should appear.  The <parameter>-I
261                 </parameter> option may be useful if your NetBIOS names don't 
262                 match your TCP/IP DNS host names or if you are trying to reach a 
263                 host on another network. </para></listitem>
264                 </varlistentry>
265                 
266                 
267                 <varlistentry>
268                 <term>-t terminal code</term>
269                 <listitem><para>This option tells <command>smbclient</command> how to interpret 
270                 filenames coming from the remote server. Usually Asian language 
271                 multibyte UNIX implementations use different character sets than 
272                 SMB/CIFS servers (<emphasis>EUC</emphasis> instead of <emphasis>
273                 SJIS</emphasis> for example). Setting this parameter will let 
274                 <command>smbclient</command> convert between the UNIX filenames and 
275                 the SMB filenames correctly. This option has not been seriously tested 
276                 and may have some problems. </para>
278                 <para>The terminal codes include CWsjis, CWeuc, CWjis7, CWjis8,
279                 CWjunet, CWhex, CWcap. This is not a complete list, check the Samba 
280                 source code for the complete list. </para></listitem>
281                 </varlistentry>
282                 
283                         
284                 <varlistentry>  
285                 <term>-b buffersize</term>
286                 <listitem><para>This option changes the transmit/send buffer 
287                 size when getting or putting a file from/to the server. The default 
288                 is 65520 bytes. Setting this value smaller (to 1200 bytes) has been 
289                 observed to speed up file transfers to and from a Win9x server. 
290                 </para></listitem>
291                 </varlistentry>
292                 
293                 &popt.common.samba;
294                 &popt.common.credentials;
295                 &popt.common.connection;
296                 
297                 <varlistentry>
298                 <term>-T tar options</term>
299                 <listitem><para>smbclient may be used to create <command>tar(1)
300                 </command> compatible backups of all the files on an SMB/CIFS
301                 share. The secondary tar flags that can be given to this option 
302                 are : </para>
303                 
304                 <itemizedlist>
305                         <listitem><para><parameter>c</parameter> - Create a tar file on UNIX. 
306                         Must be followed by the name of a tar file, tape device
307                         or "-" for standard output. If using standard output you must 
308                         turn the log level to its lowest value -d0 to avoid corrupting 
309                         your tar file. This flag is mutually exclusive with the 
310                         <parameter>x</parameter> flag. </para></listitem>
311                         
312                         <listitem><para><parameter>x</parameter> - Extract (restore) a local 
313                         tar file back to a share. Unless the -D option is given, the tar 
314                         files will be restored from the top level of the share. Must be 
315                         followed by the name of the tar file, device or "-" for standard 
316                         input. Mutually exclusive with the <parameter>c</parameter> flag. 
317                         Restored files have their creation times (mtime) set to the
318                         date saved in the tar file. Directories currently do not get 
319                         their creation dates restored properly. </para></listitem>
320                         
321                         <listitem><para><parameter>I</parameter> - Include files and directories. 
322                         Is the default behavior when filenames are specified above. Causes 
323                         tar files to be included in an extract or create (and therefore 
324                         everything else to be excluded). See example below.  Filename globbing 
325                         works  in one of two ways.  See r below. </para></listitem>
326                         
327                         <listitem><para><parameter>X</parameter> - Exclude files and directories. 
328                         Causes tar files to be excluded from an extract or create. See 
329                         example below.  Filename globbing works in one of two ways now. 
330                         See <parameter>r</parameter> below. </para></listitem>
331                         
332                         <listitem><para><parameter>b</parameter> - Blocksize. Must be followed 
333                         by a valid (greater than zero) blocksize.  Causes tar file to be 
334                         written out in blocksize*TBLOCK (usually 512 byte) blocks. 
335                         </para></listitem>
336                         
337                         <listitem><para><parameter>g</parameter> - Incremental. Only back up 
338                         files that have the archive bit set. Useful only with the 
339                         <parameter>c</parameter> flag. </para></listitem>
341                         <listitem><para><parameter>q</parameter> - Quiet. Keeps tar from printing 
342                         diagnostics as it works.  This is the same as tarmode quiet. 
343                         </para></listitem>
344                         
345                         <listitem><para><parameter>r</parameter> - Regular expression include
346                         or exclude.  Uses regular  expression matching for 
347                         excluding or excluding files if  compiled with HAVE_REGEX_H. 
348                         However this mode can be very slow. If  not compiled with 
349                         HAVE_REGEX_H, does a limited wildcard match on '*' and  '?'. 
350                         </para></listitem>
351                         
352                         <listitem><para><parameter>N</parameter> - Newer than. Must be followed 
353                         by the name of a file whose date is compared against files found 
354                         on the share during a create. Only files newer than the file 
355                         specified are backed up to the tar file. Useful only with the 
356                         <parameter>c</parameter> flag. </para></listitem>
357                         
358                         <listitem><para><parameter>a</parameter> - Set archive bit. Causes the 
359                         archive bit to be reset when a file is backed up. Useful with the 
360                         <parameter>g</parameter> and <parameter>c</parameter> flags. 
361                         </para></listitem>
362                 </itemizedlist>
363                         
364                 <para><emphasis>Tar Long File Names</emphasis></para>
365                         
366                 <para><command>smbclient</command>'s tar option now supports long 
367                 file names both on backup and restore. However, the full path 
368                 name of the file must be less than 1024 bytes.  Also, when
369                 a tar archive is created, <command>smbclient</command>'s tar option places all 
370                 files in the archive with relative names, not absolute names. 
371                 </para>
372                         
373                 <para><emphasis>Tar Filenames</emphasis></para>
374                         
375                 <para>All file names can be given as DOS path names (with '\\' 
376                 as the component separator) or as UNIX path names (with '/' as 
377                 the component separator). </para>
378                         
379                 <para><emphasis>Examples</emphasis></para>
380                 
381                 <para>Restore from tar file <filename>backup.tar</filename> into myshare on mypc 
382                 (no password on share). </para>
383                 
384                 <para><command>smbclient //mypc/yshare "" -N -Tx backup.tar
385                 </command></para>
386                 
387                 <para>Restore everything except <filename>users/docs</filename>
388                 </para>
389                 
390                 <para><command>smbclient //mypc/myshare "" -N -TXx backup.tar 
391                 users/docs</command></para>
392                 
393                 <para>Create a tar file of the files beneath <filename>
394                 users/docs</filename>. </para>
395                 
396                 <para><command>smbclient //mypc/myshare "" -N -Tc
397                 backup.tar users/docs </command></para>
398                 
399                 <para>Create the same tar file as above, but now use 
400                 a DOS path name. </para>
401                 
402                 <para><command>smbclient //mypc/myshare "" -N -tc backup.tar 
403                 users\edocs </command></para>
404                 
405                 <para>Create a tar file of all the files and directories in 
406                 the share. </para>
407                 
408                 <para><command>smbclient //mypc/myshare "" -N -Tc backup.tar *
409                 </command></para>
410                 </listitem>
411                 </varlistentry>
412                 
413                 
414                 <varlistentry>
415                 <term>-D initial directory</term>
416                 <listitem><para>Change to initial directory before starting. Probably 
417                 only of any use with the tar -T option. </para></listitem>
418                 </varlistentry>
419                 
420                 
421                 
422                 <varlistentry>
423                 <term>-c command string</term>
424                 <listitem><para>command string is a semicolon-separated list of 
425                 commands to be executed instead of prompting from stdin. <parameter>
426                 -N</parameter> is implied by <parameter>-c</parameter>.</para>
428                 <para>This is particularly useful in scripts and for printing stdin 
429                 to the server, e.g. <command>-c 'print -'</command>. </para></listitem>
430                 </varlistentry>
431         </variablelist>
432 </refsect1>
435 <refsect1>
436         <title>OPERATIONS</title>
438         <para>Once the client is running, the user is presented with 
439         a prompt : </para>
441         <para><prompt>smb:\&gt; </prompt></para>
443         <para>The backslash ("\\") indicates the current working directory 
444         on the server, and will change if the current working directory 
445         is changed. </para>
447         <para>The prompt indicates that the client is ready and waiting to 
448         carry out a user command. Each command is a single word, optionally 
449         followed by parameters specific to that command. Command and parameters 
450         are space-delimited unless these notes specifically
451         state otherwise. All commands are case-insensitive.  Parameters to 
452         commands may or may not be case sensitive, depending on the command. 
453         </para>
455         <para>You can specify file names which have spaces in them by quoting 
456         the name with double quotes, for example "a long file name". </para>
458         <para>Parameters shown in square brackets (e.g., "[parameter]") are 
459         optional.  If not given, the command will use suitable defaults. Parameters 
460         shown in angle brackets (e.g., "&lt;parameter&gt;") are required.
461         </para>
464         <para>Note that all commands operating on the server are actually 
465         performed by issuing a request to the server. Thus the behavior may 
466         vary from server to server, depending on how the server was implemented. 
467         </para>
469         <para>The commands available are given here in alphabetical order. </para>
471         <variablelist>
472                 <varlistentry>
473                 <term>? [command]</term>
474                 <listitem><para>If <replaceable>command</replaceable> is specified, the ? command will display 
475                 a brief informative message about the specified command.  If no 
476                 command is specified, a list of available commands will
477                 be displayed. </para></listitem>
478                 </varlistentry>
479                 
480                 
481                 <varlistentry>
482                 <term>! [shell command]</term>
483                 <listitem><para>If <replaceable>shell command</replaceable> is specified, the !  
484                 command will execute a shell locally and run the specified shell 
485                 command. If no command is specified, a local shell will be run. 
486                 </para></listitem>
487                 </varlistentry>
488                 
489                 
490                 <varlistentry>
491                 <term>altname file</term>
492                 <listitem><para>The client will request that the server return
493                 the "alternate" name (the 8.3 name) for a file or directory.
494                 </para></listitem>
495                 </varlistentry>
496                 
497                 
498                 <varlistentry>
499                 <term>cancel jobid0 [jobid1] ... [jobidN]</term>
500                 <listitem><para>The client will request that the server cancel
501                 the printjobs identified by the given numeric print job ids.
502                 </para></listitem>
503                 </varlistentry>
504                 
505                 
506                 
507                 <varlistentry>
508                 <term>chmod file mode in octal</term>
509                 <listitem><para>This command depends on the server supporting the CIFS
510                 UNIX extensions and will fail if the server does not. The client requests that the server
511                 change the UNIX permissions to the given octal mode, in standard UNIX format.
512                 </para></listitem>
513                 </varlistentry>
514                 
515                 
516                 
517                 <varlistentry>
518                 <term>chown file uid gid</term>
519                 <listitem><para>This command depends on the server supporting the CIFS
520                 UNIX extensions and will fail if the server does not. The client requests that the server
521                 change the UNIX user and group ownership to the given decimal values. Note there is
522                 currently no way to remotely look up the UNIX uid and gid values for a given name.
523                 This may be addressed in future versions of the CIFS UNIX extensions.
524                 </para></listitem>
525                 </varlistentry>
526                 
527                 
528                 
529                 <varlistentry>
530                 <term>cd [directory name]</term>
531                 <listitem><para>If "directory name" is specified, the current 
532                 working directory on the server will be changed to the directory 
533                 specified. This operation will fail if for any reason the specified 
534                 directory is inaccessible. </para>
536                 <para>If no directory name is specified, the current working 
537                 directory on the server will be reported. </para></listitem>
538                 </varlistentry>
539                 
540                 
541                 <varlistentry>
542                 <term>del &lt;mask&gt;</term>
543                 <listitem><para>The client will request that the server attempt 
544                 to delete all files matching <replaceable>mask</replaceable> from the current working 
545                 directory on the server. </para></listitem>
546                 </varlistentry>
547                 
548                 
549                 <varlistentry>
550                 <term>dir &lt;mask&gt;</term>
551                 <listitem><para>A list of the files matching <replaceable>mask</replaceable> in the current 
552                 working directory on the server will be retrieved from the server 
553                 and displayed. </para></listitem>
554                 </varlistentry>
555                 
556                 
557                 <varlistentry>
558                 <term>exit</term>
559                 <listitem><para>Terminate the connection with the server and exit 
560                 from the program. </para></listitem> 
561                 </varlistentry>
562                 
563                 
564                 <varlistentry>
565                 <term>get &lt;remote file name&gt; [local file name]</term>
566                 <listitem><para>Copy the file called <filename>remote file name</filename> from 
567                 the server to the machine running the client. If specified, name 
568                 the local copy <filename>local file name</filename>.  Note that all transfers in 
569                 <command>smbclient</command> are binary. See also the 
570                 lowercase command. </para></listitem>
571                 </varlistentry>
572                 
573                 
574                 
575                 <varlistentry>
576                 <term>help [command]</term>
577                 <listitem><para>See the ? command above. </para></listitem>
578                 </varlistentry>
579                 
580                 
581                 <varlistentry>
582                 <term>lcd [directory name]</term>
583                 <listitem><para>If <replaceable>directory name</replaceable> is specified, the current 
584                 working directory on the local machine will be changed to 
585                 the directory specified. This operation will fail if for any 
586                 reason the specified directory is inaccessible. </para>
587                 
588                 <para>If no directory name is specified, the name of the 
589                 current working directory on the local machine will be reported. 
590                 </para></listitem>
591                 </varlistentry>
592                 
593                 
594                 <varlistentry>
595                 <term>link source destination</term>
596                 <listitem><para>This command depends on the server supporting the CIFS
597                 UNIX extensions and will fail if the server does not. The client requests that the server
598                 create a hard link between the source and destination files. The source file
599                 must not exist.
600                 </para></listitem>
601                 </varlistentry>
605                 <varlistentry>
606                 <term>lowercase</term>
607                 <listitem><para>Toggle lowercasing of filenames for the get and 
608                 mget commands. </para>
609                                 
610                 <para>When lowercasing is toggled ON, local filenames are converted 
611                 to lowercase when using the get and mget commands. This is
612                 often useful when copying (say) MSDOS files from a server, because 
613                 lowercase filenames are the norm on UNIX systems. </para></listitem>
614                 </varlistentry>
615                 
616                 
617                 
618                 <varlistentry>
619                 <term>ls &lt;mask&gt;</term>
620                 <listitem><para>See the dir command above. </para></listitem>
621                 </varlistentry>
622                 
623                 
624                 <varlistentry>
625                 <term>mask &lt;mask&gt;</term>
626                 <listitem><para>This command allows the user to set up a mask 
627                 which will be used during recursive operation of the mget and 
628                 mput commands. </para>
630                 <para>The masks specified to the mget and mput commands act as 
631                 filters for directories rather than files when recursion is 
632                 toggled ON. </para>
633                 
634                 <para>The mask specified with the mask command is necessary 
635                 to filter files within those directories. For example, if the
636                 mask specified in an mget command is "source*" and the mask 
637                 specified with the mask command is "*.c" and recursion is 
638                 toggled ON, the mget command will retrieve all files matching 
639                 "*.c" in all directories below and including all directories 
640                 matching "source*" in the current working directory. </para>
642                 <para>Note that the value for mask defaults to blank (equivalent 
643                 to "*") and remains so until the mask command is used to change it. 
644                 It retains the most recently specified value indefinitely. To 
645                 avoid unexpected results it would be wise to change the value of 
646                 mask back to "*" after using the mget or mput commands. </para></listitem>
647                 </varlistentry>
648                 
649                 
650                 <varlistentry>
651                 <term>md &lt;directory name&gt;</term>
652                 <listitem><para>See the mkdir command. </para></listitem>
653                 </varlistentry>
654                 
655                 
656                 <varlistentry>
657                 <term>mget &lt;mask&gt;</term>
658                 <listitem><para>Copy all files matching <replaceable>mask</replaceable> from the server to 
659                 the machine running the client. </para>
661                 <para>Note that <replaceable>mask</replaceable> is interpreted differently during recursive 
662                 operation and non-recursive operation - refer to the recurse and 
663                 mask commands for more information. Note that all transfers in 
664                 <command>smbclient</command> are binary. See also the lowercase command. </para></listitem>
665                 </varlistentry>
666                 
667                 
668                 <varlistentry>
669                 <term>mkdir &lt;directory name&gt;</term>
670                 <listitem><para>Create a new directory on the server (user access 
671                 privileges permitting) with the specified name. </para></listitem>
672                 </varlistentry>
673                 
674                 
675                 <varlistentry>
676                 <term>mput &lt;mask&gt;</term>
677                 <listitem><para>Copy all files matching <replaceable>mask</replaceable> in the current working 
678                 directory on the local machine to the current working directory on 
679                 the server. </para>
680                 
681                 <para>Note that <replaceable>mask</replaceable> is interpreted differently during recursive 
682                 operation and non-recursive operation - refer to the recurse and mask 
683                 commands for more information. Note that all transfers in <command>smbclient</command> 
684                 are binary. </para></listitem>
685                 </varlistentry>
686                 
687                 
688                 <varlistentry>
689                 <term>print &lt;file name&gt;</term>
690                 <listitem><para>Print the specified file from the local machine 
691                 through a printable service on the server. </para>
693                 <para>See also the printmode command.</para></listitem>
694                 </varlistentry>
695                 
696                 
697                 
698                 <varlistentry>
699                 <term>printmode &lt;graphics or text&gt;</term>
700                 <listitem><para>Set the print mode to suit either binary data 
701                 (such as graphical information) or text. Subsequent print
702                 commands will use the currently set print mode. </para></listitem>
703                 </varlistentry>
704                 
705                 
706                 <varlistentry>
707                 <term>prompt</term>
708                 <listitem><para>Toggle prompting for filenames during operation 
709                 of the mget and mput commands. </para>
711                 <para>When toggled ON, the user will be prompted to confirm 
712                 the transfer of each file during these commands. When toggled 
713                 OFF, all specified files will be transferred without prompting. 
714                 </para></listitem>
715                 </varlistentry>
716                 
717                 
718                 <varlistentry>
719                 <term>put &lt;local file name&gt; [remote file name]</term>
720                 <listitem><para>Copy the file called <filename>local file name</filename> from the 
721                 machine running the client to the server. If specified,
722                 name the remote copy <filename>remote file name</filename>. Note that all transfers 
723                 in <command>smbclient</command> are binary. See also the lowercase command. 
724                 </para></listitem>
725                 </varlistentry>
726                 
727                 
728                 
729                 <varlistentry>
730                 <term>queue</term>
731                 <listitem><para>Displays the print queue, showing the job id, 
732                 name, size and current status. </para></listitem>
733                 </varlistentry>
734                 
735                 
736                 <varlistentry>
737                 <term>quit</term>
738                 <listitem><para>See the exit command. </para></listitem>
739                 </varlistentry>
740                 
741                 
742                 <varlistentry>
743                 <term>rd &lt;directory name&gt;</term>
744                 <listitem><para>See the rmdir command. </para></listitem>
745                 </varlistentry>
746                 
747                 
748                 <varlistentry>
749                 <term>recurse</term>
750                 <listitem><para>Toggle directory recursion for the commands mget 
751                 and mput. </para>
752                 
753                 <para>When toggled ON, these commands will process all directories 
754                 in the source directory (i.e., the directory they are copying
755                 from ) and will recurse into any that match the mask specified 
756                 to the command. Only files that match the mask specified using 
757                 the mask command will be retrieved. See also the mask command. 
758                 </para>
760                 <para>When recursion is toggled OFF, only files from the current 
761                 working directory on the source machine that match the mask specified 
762                 to the mget or mput commands will be copied, and any mask specified 
763                 using the mask command will be ignored. </para></listitem>
764                 </varlistentry>
765                 
766                 
767                 
768                 <varlistentry>
769                 <term>rm &lt;mask&gt;</term>
770                 <listitem><para>Remove all files matching <replaceable>mask</replaceable> from the current 
771                 working directory on the server. </para></listitem>
772                 </varlistentry>
773                 
774                 
775                 <varlistentry>
776                 <term>rmdir &lt;directory name&gt;</term>
777                 <listitem><para>Remove the specified directory (user access 
778                 privileges permitting) from the server. </para></listitem>
779                 </varlistentry>
780                 
781                 
782                 <varlistentry>
783                 <term>setmode &lt;filename&gt; &lt;perm=[+|\-]rsha&gt;</term>
784                 <listitem><para>A version of the DOS attrib command to set 
785                 file permissions. For example: </para>
787                 <para><command>setmode myfile +r </command></para>
788                 
789                 <para>would make myfile read only. </para></listitem>
790                 </varlistentry>
793                 
794                 <varlistentry>
795                 <term>symlink source destination</term>
796                 <listitem><para>This command depends on the server supporting the CIFS
797                 UNIX extensions and will fail if the server does not. The client requests that the server
798                 create a symbolic hard link between the source and destination files. The source file
799                 must not exist. Note that the server will not create a link to any path that lies 
800                 outside the currently connected share. This is enforced by the Samba server.
801                 </para></listitem>
802                 </varlistentry>
806                 <varlistentry>
807                 <term>tar &lt;c|x&gt;[IXbgNa]</term>
808                 <listitem><para>Performs a tar operation - see the <parameter>-T
809                 </parameter> command line option above. Behavior may be affected 
810                 by the tarmode command (see below). Using g (incremental) and N 
811                 (newer) will affect tarmode settings. Note that using the "-" option 
812                 with tar x may not work - use the command line option instead. 
813                 </para></listitem>
814                 </varlistentry>
815                 
816                 
817                 <varlistentry>
818                 <term>blocksize &lt;blocksize&gt;</term>
819                 <listitem><para>Blocksize. Must be followed by a valid (greater 
820                 than zero) blocksize. Causes tar file to be written out in 
821                 <replaceable>blocksize</replaceable>*TBLOCK (usually 512 byte) blocks. </para></listitem>
822                 </varlistentry>
823                 
824                 
825                 <varlistentry>
826                 <term>tarmode &lt;full|inc|reset|noreset&gt;</term>
827                 <listitem><para>Changes tar's behavior with regard to archive 
828                 bits. In full mode, tar will back up everything regardless of the 
829                 archive bit setting (this is the default mode). In incremental mode, 
830                 tar will only back up files with the archive bit set. In reset mode, 
831                 tar will reset the archive bit on all files it backs up (implies 
832                 read/write share). </para></listitem>
833                 </varlistentry>
834                 
835                 
836         </variablelist>
837 </refsect1>
839 <refsect1>
840         <title>NOTES</title>
842         <para>Some servers are fussy about the case of supplied usernames, 
843         passwords, share names (AKA service names) and machine names. 
844         If you fail to connect try giving all parameters in uppercase. 
845         </para>
846         
847         <para>It is often necessary to use the -n option when connecting 
848         to some types of servers. For example OS/2 LanManager insists 
849         on a valid NetBIOS name being used, so you need to supply a valid 
850         name that would be known to the server.</para>
852         <para>smbclient supports long file names where the server 
853         supports the LANMAN2 protocol or above. </para>
854 </refsect1>
856 <refsect1>
857         <title>ENVIRONMENT VARIABLES</title>
859         <para>The variable <envar>USER</envar> may contain the 
860         username of the person  using the client. This information is 
861         used only if the protocol  level is high enough to support 
862         session-level passwords.</para>
865         <para>The variable <envar>PASSWD</envar> may contain 
866         the password of the person using the client.  This information is 
867         used only if the protocol level is high enough to support 
868         session-level passwords. </para>
870         <para>The variable <envar>LIBSMB_PROG</envar> may contain 
871         the path, executed with system(), which the client should connect 
872         to instead of connecting to a server.  This functionality is primarily
873         intended as a development aid, and works best when using a LMHOSTS 
874         file</para>
875 </refsect1>
878 <refsect1>
879         <title>INSTALLATION</title>
881         <para>The location of the client program is a matter for 
882         individual system administrators. The following are thus
883         suggestions only. </para>
885         <para>It is recommended that the smbclient software be installed
886         in the <filename>/usr/local/samba/bin/</filename> or <filename>
887         /usr/samba/bin/</filename> directory, this directory readable 
888         by all, writeable only by root. The client program itself should 
889         be executable by all. The client should <emphasis>NOT</emphasis> be 
890         setuid or setgid! </para>
892         <para>The client log files should be put in a directory readable 
893         and writeable only by the user. </para>
895         <para>To test the client, you will need to know the name of a 
896         running SMB/CIFS server. It is possible to run <citerefentry><refentrytitle>smbd</refentrytitle>
897         <manvolnum>8</manvolnum></citerefentry> as an ordinary user - running that server as a daemon 
898         on a user-accessible port (typically any port number over 1024)
899         would provide a suitable test server. </para>
900 </refsect1>
903 <refsect1>
904         <title>DIAGNOSTICS</title>
906         <para>Most diagnostics issued by the client are logged in a 
907         specified log file. The log file name is specified at compile time, 
908         but may be overridden on the command line. </para>
910         <para>The number and nature of diagnostics available depends 
911         on the debug level used by the client. If you have problems, 
912         set the debug level to 3 and peruse the log files. </para>
913 </refsect1>
916 <refsect1>
917         <title>VERSION</title>
919         <para>This man page is correct for version 2.2 of the Samba suite.</para>
920 </refsect1>
923 <refsect1>
924         <title>AUTHOR</title>
925         
926         <para>The original Samba software and related utilities 
927         were created by Andrew Tridgell. Samba is now developed
928         by the Samba Team as an Open Source project similar 
929         to the way the Linux kernel is developed.</para>
930         
931         <para>The original Samba man pages were written by Karl Auer. 
932         The man page sources were converted to YODL format (another 
933         excellent piece of Open Source software, available at <ulink url="ftp://ftp.icce.rug.nl/pub/unix/">
934         ftp://ftp.icce.rug.nl/pub/unix/</ulink>) and updated for the Samba 2.0 
935         release by Jeremy Allison.  The conversion to DocBook for 
936         Samba 2.2 was done by Gerald Carter. The conversion to DocBook XML 4.2 for Samba 3.0
937         was done by Alexander Bokovoy.</para>
938 </refsect1>
940 </refentry>