1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <!DOCTYPE refentry PUBLIC "-//Samba-Team//DTD DocBook V4.2-Based Variant V1.0//EN" "http://www.samba.org/samba/DTD/samba-doc">
3 <refentry id="smbclient.1">
6 <refentrytitle>smbclient</refentrytitle>
7 <manvolnum>1</manvolnum>
12 <refname>smbclient</refname>
13 <refpurpose>ftp-like client to access SMB/CIFS resources
14 on servers</refpurpose>
19 <command>smbclient</command>
20 <arg choice="opt">-b <buffer size></arg>
21 <arg choice="opt">-d debuglevel</arg>
22 <arg choice="opt">-L <netbios name></arg>
23 <arg choice="opt">-U username</arg>
24 <arg choice="opt">-I destinationIP</arg>
25 <arg choice="opt">-M <netbios name></arg>
26 <arg choice="opt">-m maxprotocol</arg>
27 <arg choice="opt">-A authfile</arg>
28 <arg choice="opt">-N</arg>
29 <arg choice="opt">-i scope</arg>
30 <arg choice="opt">-O <socket options></arg>
31 <arg choice="opt">-p port</arg>
32 <arg choice="opt">-R <name resolve order></arg>
33 <arg choice="opt">-s <smb config file></arg>
34 <arg choice="opt">-k</arg>
38 <command>smbclient</command>
39 <arg choice="req">servicename</arg>
40 <arg choice="opt">password</arg>
41 <arg choice="opt">-b <buffer size></arg>
42 <arg choice="opt">-d debuglevel</arg>
43 <arg choice="opt">-D Directory</arg>
44 <arg choice="opt">-U username</arg>
45 <arg choice="opt">-W workgroup</arg>
46 <arg choice="opt">-M <netbios name></arg>
47 <arg choice="opt">-m maxprotocol</arg>
48 <arg choice="opt">-A authfile</arg>
49 <arg choice="opt">-N</arg>
50 <arg choice="opt">-l logdir</arg>
51 <arg choice="opt">-I destinationIP</arg>
52 <arg choice="opt">-E</arg>
53 <arg choice="opt">-c <command string></arg>
54 <arg choice="opt">-i scope</arg>
55 <arg choice="opt">-O <socket options></arg>
56 <arg choice="opt">-p port</arg>
57 <arg choice="opt">-R <name resolve order></arg>
58 <arg choice="opt">-s <smb config file></arg>
59 <arg choice="opt">-T<c|x>IXFqgbNan</arg>
60 <arg choice="opt">-k</arg>
65 <title>DESCRIPTION</title>
67 <para>This tool is part of the <citerefentry><refentrytitle>samba</refentrytitle>
68 <manvolnum>7</manvolnum></citerefentry> suite.</para>
70 <para><command>smbclient</command> is a client that can
71 'talk' to an SMB/CIFS server. It offers an interface
72 similar to that of the ftp program (see <citerefentry><refentrytitle>ftp</refentrytitle>
73 <manvolnum>1</manvolnum></citerefentry>).
74 Operations include things like getting files from the server
75 to the local machine, putting files from the local machine to
76 the server, retrieving directory information from the server
82 <title>OPTIONS</title>
86 <term>servicename</term>
87 <listitem><para>servicename is the name of the service
88 you want to use on the server. A service name takes the form
89 <filename>//server/service</filename> where <parameter>server
90 </parameter> is the NetBIOS name of the SMB/CIFS server
91 offering the desired service and <parameter>service</parameter>
92 is the name of the service offered. Thus to connect to
93 the service "printer" on the SMB/CIFS server "smbserver",
94 you would use the servicename <filename>//smbserver/printer
97 <para>Note that the server name required is NOT necessarily
98 the IP (DNS) host name of the server ! The name required is
99 a NetBIOS server name, which may or may not be the
100 same as the IP hostname of the machine running the server.
103 <para>The server name is looked up according to either
104 the <parameter>-R</parameter> parameter to <command>smbclient</command> or
105 using the name resolve order parameter in
106 the <citerefentry><refentrytitle>smb.conf</refentrytitle>
107 <manvolnum>5</manvolnum></citerefentry> file,
108 allowing an administrator to change the order and methods
109 by which server names are looked up. </para></listitem>
113 <term>password</term>
114 <listitem><para>The password required to access the specified
115 service on the specified server. If this parameter is
116 supplied, the <parameter>-N</parameter> option (suppress
117 password prompt) is assumed. </para>
119 <para>There is no default password. If no password is supplied
120 on the command line (either by using this parameter or adding
121 a password to the <parameter>-U</parameter> option (see
122 below)) and the <parameter>-N</parameter> option is not
123 specified, the client will prompt for a password, even if
124 the desired service does not require one. (If no password is
125 required, simply press ENTER to provide a null password.)
128 <para>Note: Some servers (including OS/2 and Windows for
129 Workgroups) insist on an uppercase password. Lowercase
130 or mixed case passwords may be rejected by these servers.
133 <para>Be cautious about including passwords in scripts.
138 <term>-R <name resolve order></term>
139 <listitem><para>This option is used by the programs in the Samba
140 suite to determine what naming services and in what order to resolve
141 host names to IP addresses. The option takes a space-separated
142 string of different name resolution options.</para>
144 <para>The options are :"lmhosts", "host", "wins" and "bcast". They
145 cause names to be resolved as follows:</para>
148 <listitem><para><constant>lmhosts</constant>: Lookup an IP
149 address in the Samba lmhosts file. If the line in lmhosts has
150 no name type attached to the NetBIOS name (see
151 the <citerefentry><refentrytitle>lmhosts</refentrytitle>
152 <manvolnum>5</manvolnum></citerefentry> for details) then
153 any name type matches for lookup.</para>
156 <listitem><para><constant>host</constant>: Do a standard host
157 name to IP address resolution, using the system <filename>/etc/hosts
158 </filename>, NIS, or DNS lookups. This method of name resolution
159 is operating system dependent, for instance on IRIX or Solaris this
160 may be controlled by the <filename>/etc/nsswitch.conf</filename>
161 file). Note that this method is only used if the NetBIOS name
162 type being queried is the 0x20 (server) name type, otherwise
163 it is ignored.</para>
166 <listitem><para><constant>wins</constant>: Query a name with
167 the IP address listed in the <parameter>wins server</parameter>
168 parameter. If no WINS server has
169 been specified this method will be ignored.</para>
172 <listitem><para><constant>bcast</constant>: Do a broadcast on
173 each of the known local interfaces listed in the
174 <parameter>interfaces</parameter>
175 parameter. This is the least reliable of the name resolution
176 methods as it depends on the target host being on a locally
177 connected subnet.</para>
181 <para>If this parameter is not set then the name resolve order
182 defined in the <citerefentry><refentrytitle>smb.conf</refentrytitle>
183 <manvolnum>5</manvolnum></citerefentry> file parameter
184 (name resolve order) will be used. </para>
186 <para>The default order is lmhosts, host, wins, bcast and without
187 this parameter or any entry in the <parameter>name resolve order
188 </parameter> parameter of the <citerefentry><refentrytitle>smb.conf</refentrytitle>
189 <manvolnum>5</manvolnum></citerefentry> file the name resolution
190 methods will be attempted in this order. </para></listitem>
195 <term>-M NetBIOS name</term>
196 <listitem><para>This options allows you to send messages, using
197 the "WinPopup" protocol, to another computer. Once a connection is
198 established you then type your message, pressing ^D (control-D) to
201 <para>If the receiving computer is running WinPopup the user will
202 receive the message and probably a beep. If they are not running
203 WinPopup the message will be lost, and no error message will
206 <para>The message is also automatically truncated if the message
207 is over 1600 bytes, as this is the limit of the protocol.
210 <para>One useful trick is to cat the message through
211 <command>smbclient</command>. For example: <command>
212 cat mymessage.txt | smbclient -M FRED </command> will
213 send the message in the file <filename>mymessage.txt</filename>
214 to the machine FRED. </para>
216 <para>You may also find the <parameter>-U</parameter> and
217 <parameter>-I</parameter> options useful, as they allow you to
218 control the FROM and TO parts of the message. </para>
220 <para>See the <parameter>message command</parameter> parameter in the <citerefentry><refentrytitle>smb.conf</refentrytitle>
221 <manvolnum>5</manvolnum></citerefentry> for a description of how to handle incoming
222 WinPopup messages in Samba. </para>
224 <para><emphasis>Note</emphasis>: Copy WinPopup into the startup group
225 on your WfWg PCs if you want them to always be able to receive
226 messages. </para></listitem>
231 <listitem><para>This number is the TCP port number that will be used
232 when making connections to the server. The standard (well-known)
233 TCP port number for an SMB/CIFS server is 139, which is the
234 default. </para></listitem>
241 <term>-I IP-address</term>
242 <listitem><para><replaceable>IP address</replaceable> is the address of the server to connect to.
243 It should be specified in standard "a.b.c.d" notation. </para>
245 <para>Normally the client would attempt to locate a named
246 SMB/CIFS server by looking it up via the NetBIOS name resolution
247 mechanism described above in the <parameter>name resolve order</parameter>
248 parameter above. Using this parameter will force the client
249 to assume that the server is on the machine with the specified IP
250 address and the NetBIOS name component of the resource being
251 connected to will be ignored. </para>
253 <para>There is no default for this parameter. If not supplied,
254 it will be determined automatically by the client as described
255 above. </para></listitem>
262 <listitem><para>This parameter causes the client to write messages
263 to the standard error stream (stderr) rather than to the standard
264 output stream. </para>
266 <para>By default, the client writes messages to standard output
267 - typically the user's tty. </para></listitem>
273 <listitem><para>This option allows you to look at what services
274 are available on a server. You use it as <command>smbclient -L
275 host</command> and a list should appear. The <parameter>-I
276 </parameter> option may be useful if your NetBIOS names don't
277 match your TCP/IP DNS host names or if you are trying to reach a
278 host on another network. </para></listitem>
283 <term>-t terminal code</term>
284 <listitem><para>This option tells <command>smbclient</command> how to interpret
285 filenames coming from the remote server. Usually Asian language
286 multibyte UNIX implementations use different character sets than
287 SMB/CIFS servers (<emphasis>EUC</emphasis> instead of <emphasis>
288 SJIS</emphasis> for example). Setting this parameter will let
289 <command>smbclient</command> convert between the UNIX filenames and
290 the SMB filenames correctly. This option has not been seriously tested
291 and may have some problems. </para>
293 <para>The terminal codes include CWsjis, CWeuc, CWjis7, CWjis8,
294 CWjunet, CWhex, CWcap. This is not a complete list, check the Samba
295 source code for the complete list. </para></listitem>
300 <term>-b buffersize</term>
301 <listitem><para>This option changes the transmit/send buffer
302 size when getting or putting a file from/to the server. The default
303 is 65520 bytes. Setting this value smaller (to 1200 bytes) has been
304 observed to speed up file transfers to and from a Win9x server.
309 &popt.common.credentials;
310 &popt.common.connection;
313 <term>-T tar options</term>
314 <listitem><para>smbclient may be used to create <command>tar(1)
315 </command> compatible backups of all the files on an SMB/CIFS
316 share. The secondary tar flags that can be given to this option
320 <listitem><para><parameter>c</parameter> - Create a tar file on UNIX.
321 Must be followed by the name of a tar file, tape device
322 or "-" for standard output. If using standard output you must
323 turn the log level to its lowest value -d0 to avoid corrupting
324 your tar file. This flag is mutually exclusive with the
325 <parameter>x</parameter> flag. </para></listitem>
327 <listitem><para><parameter>x</parameter> - Extract (restore) a local
328 tar file back to a share. Unless the -D option is given, the tar
329 files will be restored from the top level of the share. Must be
330 followed by the name of the tar file, device or "-" for standard
331 input. Mutually exclusive with the <parameter>c</parameter> flag.
332 Restored files have their creation times (mtime) set to the
333 date saved in the tar file. Directories currently do not get
334 their creation dates restored properly. </para></listitem>
336 <listitem><para><parameter>I</parameter> - Include files and directories.
337 Is the default behavior when filenames are specified above. Causes
338 tar files to be included in an extract or create (and therefore
339 everything else to be excluded). See example below. Filename globbing
340 works in one of two ways. See r below. </para></listitem>
342 <listitem><para><parameter>X</parameter> - Exclude files and directories.
343 Causes tar files to be excluded from an extract or create. See
344 example below. Filename globbing works in one of two ways now.
345 See <parameter>r</parameter> below. </para></listitem>
347 <listitem><para><parameter>b</parameter> - Blocksize. Must be followed
348 by a valid (greater than zero) blocksize. Causes tar file to be
349 written out in blocksize*TBLOCK (usually 512 byte) blocks.
352 <listitem><para><parameter>g</parameter> - Incremental. Only back up
353 files that have the archive bit set. Useful only with the
354 <parameter>c</parameter> flag. </para></listitem>
356 <listitem><para><parameter>q</parameter> - Quiet. Keeps tar from printing
357 diagnostics as it works. This is the same as tarmode quiet.
360 <listitem><para><parameter>r</parameter> - Regular expression include
361 or exclude. Uses regular expression matching for
362 excluding or excluding files if compiled with HAVE_REGEX_H.
363 However this mode can be very slow. If not compiled with
364 HAVE_REGEX_H, does a limited wildcard match on '*' and '?'.
367 <listitem><para><parameter>N</parameter> - Newer than. Must be followed
368 by the name of a file whose date is compared against files found
369 on the share during a create. Only files newer than the file
370 specified are backed up to the tar file. Useful only with the
371 <parameter>c</parameter> flag. </para></listitem>
373 <listitem><para><parameter>a</parameter> - Set archive bit. Causes the
374 archive bit to be reset when a file is backed up. Useful with the
375 <parameter>g</parameter> and <parameter>c</parameter> flags.
379 <para><emphasis>Tar Long File Names</emphasis></para>
381 <para><command>smbclient</command>'s tar option now supports long
382 file names both on backup and restore. However, the full path
383 name of the file must be less than 1024 bytes. Also, when
384 a tar archive is created, <command>smbclient</command>'s tar option places all
385 files in the archive with relative names, not absolute names.
388 <para><emphasis>Tar Filenames</emphasis></para>
390 <para>All file names can be given as DOS path names (with '\\'
391 as the component separator) or as UNIX path names (with '/' as
392 the component separator). </para>
394 <para><emphasis>Examples</emphasis></para>
396 <para>Restore from tar file <filename>backup.tar</filename> into myshare on mypc
397 (no password on share). </para>
399 <para><command>smbclient //mypc/yshare "" -N -Tx backup.tar
402 <para>Restore everything except <filename>users/docs</filename>
405 <para><command>smbclient //mypc/myshare "" -N -TXx backup.tar
406 users/docs</command></para>
408 <para>Create a tar file of the files beneath <filename>
409 users/docs</filename>. </para>
411 <para><command>smbclient //mypc/myshare "" -N -Tc
412 backup.tar users/docs </command></para>
414 <para>Create the same tar file as above, but now use
415 a DOS path name. </para>
417 <para><command>smbclient //mypc/myshare "" -N -tc backup.tar
418 users\edocs </command></para>
420 <para>Create a tar file of all the files and directories in
423 <para><command>smbclient //mypc/myshare "" -N -Tc backup.tar *
430 <term>-D initial directory</term>
431 <listitem><para>Change to initial directory before starting. Probably
432 only of any use with the tar -T option. </para></listitem>
438 <term>-c command string</term>
439 <listitem><para>command string is a semicolon-separated list of
440 commands to be executed instead of prompting from stdin. <parameter>
441 -N</parameter> is implied by <parameter>-c</parameter>.</para>
443 <para>This is particularly useful in scripts and for printing stdin
444 to the server, e.g. <command>-c 'print -'</command>. </para></listitem>
451 <title>OPERATIONS</title>
453 <para>Once the client is running, the user is presented with
456 <para><prompt>smb:\> </prompt></para>
458 <para>The backslash ("\\") indicates the current working directory
459 on the server, and will change if the current working directory
462 <para>The prompt indicates that the client is ready and waiting to
463 carry out a user command. Each command is a single word, optionally
464 followed by parameters specific to that command. Command and parameters
465 are space-delimited unless these notes specifically
466 state otherwise. All commands are case-insensitive. Parameters to
467 commands may or may not be case sensitive, depending on the command.
470 <para>You can specify file names which have spaces in them by quoting
471 the name with double quotes, for example "a long file name". </para>
473 <para>Parameters shown in square brackets (e.g., "[parameter]") are
474 optional. If not given, the command will use suitable defaults. Parameters
475 shown in angle brackets (e.g., "<parameter>") are required.
479 <para>Note that all commands operating on the server are actually
480 performed by issuing a request to the server. Thus the behavior may
481 vary from server to server, depending on how the server was implemented.
484 <para>The commands available are given here in alphabetical order. </para>
488 <term>? [command]</term>
489 <listitem><para>If <replaceable>command</replaceable> is specified, the ? command will display
490 a brief informative message about the specified command. If no
491 command is specified, a list of available commands will
492 be displayed. </para></listitem>
497 <term>! [shell command]</term>
498 <listitem><para>If <replaceable>shell command</replaceable> is specified, the !
499 command will execute a shell locally and run the specified shell
500 command. If no command is specified, a local shell will be run.
506 <term>altname file</term>
507 <listitem><para>The client will request that the server return
508 the "alternate" name (the 8.3 name) for a file or directory.
514 <term>case_sensitive</term>
515 <listitem><para>Toggles the setting of the flag in SMB packets that
516 tells the server to treat filenames as case sensitive. Set to OFF by
517 default (tells file server to treat filenames as case insensitive). Only
518 currently affects Samba 3.0.5 and above file servers with the case sensitive
519 parameter set to auto in the smb.conf.
526 <term>cancel jobid0 [jobid1] ... [jobidN]</term>
527 <listitem><para>The client will request that the server cancel
528 the printjobs identified by the given numeric print job ids.
535 <term>chmod file mode in octal</term>
536 <listitem><para>This command depends on the server supporting the CIFS
537 UNIX extensions and will fail if the server does not. The client requests that the server
538 change the UNIX permissions to the given octal mode, in standard UNIX format.
545 <term>chown file uid gid</term>
546 <listitem><para>This command depends on the server supporting the CIFS
547 UNIX extensions and will fail if the server does not. The client requests that the server
548 change the UNIX user and group ownership to the given decimal values. Note there is
549 currently no way to remotely look up the UNIX uid and gid values for a given name.
550 This may be addressed in future versions of the CIFS UNIX extensions.
557 <term>cd [directory name]</term>
558 <listitem><para>If "directory name" is specified, the current
559 working directory on the server will be changed to the directory
560 specified. This operation will fail if for any reason the specified
561 directory is inaccessible. </para>
563 <para>If no directory name is specified, the current working
564 directory on the server will be reported. </para></listitem>
569 <term>del <mask></term>
570 <listitem><para>The client will request that the server attempt
571 to delete all files matching <replaceable>mask</replaceable> from the current working
572 directory on the server. </para></listitem>
577 <term>dir <mask></term>
578 <listitem><para>A list of the files matching <replaceable>mask</replaceable> in the current
579 working directory on the server will be retrieved from the server
580 and displayed. </para></listitem>
586 <listitem><para>Terminate the connection with the server and exit
587 from the program. </para></listitem>
592 <term>get <remote file name> [local file name]</term>
593 <listitem><para>Copy the file called <filename>remote file name</filename> from
594 the server to the machine running the client. If specified, name
595 the local copy <filename>local file name</filename>. Note that all transfers in
596 <command>smbclient</command> are binary. See also the
597 lowercase command. </para></listitem>
603 <term>help [command]</term>
604 <listitem><para>See the ? command above. </para></listitem>
609 <term>lcd [directory name]</term>
610 <listitem><para>If <replaceable>directory name</replaceable> is specified, the current
611 working directory on the local machine will be changed to
612 the directory specified. This operation will fail if for any
613 reason the specified directory is inaccessible. </para>
615 <para>If no directory name is specified, the name of the
616 current working directory on the local machine will be reported.
622 <term>link target linkname</term>
623 <listitem><para>This command depends on the server supporting the CIFS
624 UNIX extensions and will fail if the server does not. The client requests that the server
625 create a hard link between the linkname and target files. The linkname file
633 <term>lowercase</term>
634 <listitem><para>Toggle lowercasing of filenames for the get and
635 mget commands. </para>
637 <para>When lowercasing is toggled ON, local filenames are converted
638 to lowercase when using the get and mget commands. This is
639 often useful when copying (say) MSDOS files from a server, because
640 lowercase filenames are the norm on UNIX systems. </para></listitem>
646 <term>ls <mask></term>
647 <listitem><para>See the dir command above. </para></listitem>
652 <term>mask <mask></term>
653 <listitem><para>This command allows the user to set up a mask
654 which will be used during recursive operation of the mget and
655 mput commands. </para>
657 <para>The masks specified to the mget and mput commands act as
658 filters for directories rather than files when recursion is
661 <para>The mask specified with the mask command is necessary
662 to filter files within those directories. For example, if the
663 mask specified in an mget command is "source*" and the mask
664 specified with the mask command is "*.c" and recursion is
665 toggled ON, the mget command will retrieve all files matching
666 "*.c" in all directories below and including all directories
667 matching "source*" in the current working directory. </para>
669 <para>Note that the value for mask defaults to blank (equivalent
670 to "*") and remains so until the mask command is used to change it.
671 It retains the most recently specified value indefinitely. To
672 avoid unexpected results it would be wise to change the value of
673 mask back to "*" after using the mget or mput commands. </para></listitem>
678 <term>md <directory name></term>
679 <listitem><para>See the mkdir command. </para></listitem>
684 <term>mget <mask></term>
685 <listitem><para>Copy all files matching <replaceable>mask</replaceable> from the server to
686 the machine running the client. </para>
688 <para>Note that <replaceable>mask</replaceable> is interpreted differently during recursive
689 operation and non-recursive operation - refer to the recurse and
690 mask commands for more information. Note that all transfers in
691 <command>smbclient</command> are binary. See also the lowercase command. </para></listitem>
696 <term>mkdir <directory name></term>
697 <listitem><para>Create a new directory on the server (user access
698 privileges permitting) with the specified name. </para></listitem>
703 <term>mput <mask></term>
704 <listitem><para>Copy all files matching <replaceable>mask</replaceable> in the current working
705 directory on the local machine to the current working directory on
708 <para>Note that <replaceable>mask</replaceable> is interpreted differently during recursive
709 operation and non-recursive operation - refer to the recurse and mask
710 commands for more information. Note that all transfers in <command>smbclient</command>
711 are binary. </para></listitem>
716 <term>print <file name></term>
717 <listitem><para>Print the specified file from the local machine
718 through a printable service on the server. </para>
720 <para>See also the printmode command.</para></listitem>
726 <term>printmode <graphics or text></term>
727 <listitem><para>Set the print mode to suit either binary data
728 (such as graphical information) or text. Subsequent print
729 commands will use the currently set print mode. </para></listitem>
735 <listitem><para>Toggle prompting for filenames during operation
736 of the mget and mput commands. </para>
738 <para>When toggled ON, the user will be prompted to confirm
739 the transfer of each file during these commands. When toggled
740 OFF, all specified files will be transferred without prompting.
746 <term>put <local file name> [remote file name]</term>
747 <listitem><para>Copy the file called <filename>local file name</filename> from the
748 machine running the client to the server. If specified,
749 name the remote copy <filename>remote file name</filename>. Note that all transfers
750 in <command>smbclient</command> are binary. See also the lowercase command.
758 <listitem><para>Displays the print queue, showing the job id,
759 name, size and current status. </para></listitem>
765 <listitem><para>See the exit command. </para></listitem>
770 <term>rd <directory name></term>
771 <listitem><para>See the rmdir command. </para></listitem>
777 <listitem><para>Toggle directory recursion for the commands mget
780 <para>When toggled ON, these commands will process all directories
781 in the source directory (i.e., the directory they are copying
782 from ) and will recurse into any that match the mask specified
783 to the command. Only files that match the mask specified using
784 the mask command will be retrieved. See also the mask command.
787 <para>When recursion is toggled OFF, only files from the current
788 working directory on the source machine that match the mask specified
789 to the mget or mput commands will be copied, and any mask specified
790 using the mask command will be ignored. </para></listitem>
796 <term>rm <mask></term>
797 <listitem><para>Remove all files matching <replaceable>mask</replaceable> from the current
798 working directory on the server. </para></listitem>
803 <term>rmdir <directory name></term>
804 <listitem><para>Remove the specified directory (user access
805 privileges permitting) from the server. </para></listitem>
810 <term>setmode <filename> <perm=[+|\-]rsha></term>
811 <listitem><para>A version of the DOS attrib command to set
812 file permissions. For example: </para>
814 <para><command>setmode myfile +r </command></para>
816 <para>would make myfile read only. </para></listitem>
822 <term>stat file</term>
823 <listitem><para>This command depends on the server supporting the CIFS
824 UNIX extensions and will fail if the server does not. The client requests the
825 UNIX basic info level and prints out the same info that the Linux stat command
826 would about the file. This includes the size, blocks used on disk, file type,
827 permissions, inode number, number of links and finally the three timestamps
828 (access, modify and change). If the file is a special file (symlink, character or
829 block device, fifo or socket) then extra information may also be printed.
836 <term>symlink target linkname</term>
837 <listitem><para>This command depends on the server supporting the CIFS
838 UNIX extensions and will fail if the server does not. The client requests that the server
839 create a symbolic hard link between the target and linkname files. The linkname file
840 must not exist. Note that the server will not create a link to any path that lies
841 outside the currently connected share. This is enforced by the Samba server.
848 <term>tar <c|x>[IXbgNa]</term>
849 <listitem><para>Performs a tar operation - see the <parameter>-T
850 </parameter> command line option above. Behavior may be affected
851 by the tarmode command (see below). Using g (incremental) and N
852 (newer) will affect tarmode settings. Note that using the "-" option
853 with tar x may not work - use the command line option instead.
859 <term>blocksize <blocksize></term>
860 <listitem><para>Blocksize. Must be followed by a valid (greater
861 than zero) blocksize. Causes tar file to be written out in
862 <replaceable>blocksize</replaceable>*TBLOCK (usually 512 byte) blocks. </para></listitem>
867 <term>tarmode <full|inc|reset|noreset></term>
868 <listitem><para>Changes tar's behavior with regard to archive
869 bits. In full mode, tar will back up everything regardless of the
870 archive bit setting (this is the default mode). In incremental mode,
871 tar will only back up files with the archive bit set. In reset mode,
872 tar will reset the archive bit on all files it backs up (implies
873 read/write share). </para></listitem>
883 <para>Some servers are fussy about the case of supplied usernames,
884 passwords, share names (AKA service names) and machine names.
885 If you fail to connect try giving all parameters in uppercase.
888 <para>It is often necessary to use the -n option when connecting
889 to some types of servers. For example OS/2 LanManager insists
890 on a valid NetBIOS name being used, so you need to supply a valid
891 name that would be known to the server.</para>
893 <para>smbclient supports long file names where the server
894 supports the LANMAN2 protocol or above. </para>
898 <title>ENVIRONMENT VARIABLES</title>
900 <para>The variable <envar>USER</envar> may contain the
901 username of the person using the client. This information is
902 used only if the protocol level is high enough to support
903 session-level passwords.</para>
906 <para>The variable <envar>PASSWD</envar> may contain
907 the password of the person using the client. This information is
908 used only if the protocol level is high enough to support
909 session-level passwords. </para>
911 <para>The variable <envar>LIBSMB_PROG</envar> may contain
912 the path, executed with system(), which the client should connect
913 to instead of connecting to a server. This functionality is primarily
914 intended as a development aid, and works best when using a LMHOSTS
920 <title>INSTALLATION</title>
922 <para>The location of the client program is a matter for
923 individual system administrators. The following are thus
924 suggestions only. </para>
926 <para>It is recommended that the smbclient software be installed
927 in the <filename>/usr/local/samba/bin/</filename> or <filename>
928 /usr/samba/bin/</filename> directory, this directory readable
929 by all, writeable only by root. The client program itself should
930 be executable by all. The client should <emphasis>NOT</emphasis> be
931 setuid or setgid! </para>
933 <para>The client log files should be put in a directory readable
934 and writeable only by the user. </para>
936 <para>To test the client, you will need to know the name of a
937 running SMB/CIFS server. It is possible to run <citerefentry><refentrytitle>smbd</refentrytitle>
938 <manvolnum>8</manvolnum></citerefentry> as an ordinary user - running that server as a daemon
939 on a user-accessible port (typically any port number over 1024)
940 would provide a suitable test server. </para>
945 <title>DIAGNOSTICS</title>
947 <para>Most diagnostics issued by the client are logged in a
948 specified log file. The log file name is specified at compile time,
949 but may be overridden on the command line. </para>
951 <para>The number and nature of diagnostics available depends
952 on the debug level used by the client. If you have problems,
953 set the debug level to 3 and peruse the log files. </para>
958 <title>VERSION</title>
960 <para>This man page is correct for version 2.2 of the Samba suite.</para>
965 <title>AUTHOR</title>
967 <para>The original Samba software and related utilities
968 were created by Andrew Tridgell. Samba is now developed
969 by the Samba Team as an Open Source project similar
970 to the way the Linux kernel is developed.</para>
972 <para>The original Samba man pages were written by Karl Auer.
973 The man page sources were converted to YODL format (another
974 excellent piece of Open Source software, available at <ulink url="ftp://ftp.icce.rug.nl/pub/unix/">
975 ftp://ftp.icce.rug.nl/pub/unix/</ulink>) and updated for the Samba 2.0
976 release by Jeremy Allison. The conversion to DocBook for
977 Samba 2.2 was done by Gerald Carter. The conversion to DocBook XML 4.2 for Samba 3.0
978 was done by Alexander Bokovoy.</para>