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