ctdb/docs: Include ceph rados namespace support in man page
[Samba.git] / docs-xml / manpages / smbclient.1.xml
blob40f9d896e30c71f338fa20d5b0f84319c322b45d
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">
5 <refmeta>
6         <refentrytitle>smbclient</refentrytitle>
7         <manvolnum>1</manvolnum>
8         <refmiscinfo class="source">Samba</refmiscinfo>
9         <refmiscinfo class="manual">User Commands</refmiscinfo>
10         <refmiscinfo class="version">&doc.version;</refmiscinfo>
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">-M|--message=HOST</arg>
24                 <arg choice="opt">-I|--ip-address=IP</arg>
25                 <arg choice="opt">-E|--stderr</arg>
26                 <arg choice="opt">-L|--list=HOST</arg>
27                 <arg choice="opt">-T|--tar=&lt;c|x&gt;IXFvgbNan</arg>
28                 <arg choice="opt">-D|--directory=DIR</arg>
29                 <arg choice="opt">-b|--send-buffer=BYTES</arg>
30                 <arg choice="opt">-t|--timeout=SECONDS</arg>
31                 <arg choice="opt">-p|--port=PORT</arg>
32                 <arg choice="opt">-g|--grepable</arg>
33                 <arg choice="opt">-q|--quiet</arg>
34                 <arg choice="opt">-B|--browse</arg>
35                 <arg choice="opt">-?|--help</arg>
36                 <arg choice="opt">--usage</arg>
37                 <arg choice="opt">-d|--debuglevel=DEBUGLEVEL</arg>
38                 <arg choice="opt">--debug-stdout</arg>
39                 <arg choice="opt">-s|--configfile=CONFIGFILE</arg>
40                 <arg choice="opt">--option=name=value</arg>
41                 <arg choice="opt">-l|--log-basename=LOGFILEBASE</arg>
42                 <arg choice="opt">--leak-report</arg>
43                 <arg choice="opt">--leak-report-full</arg>
44                 <arg choice="opt">-R|--name-resolve=NAME-RESOLVE-ORDER</arg>
45                 <arg choice="opt">-O|--socket-options=SOCKETOPTIONS</arg>
46                 <arg choice="opt">-m|--max-protocol=MAXPROTOCOL</arg>
47                 <arg choice="opt">-n|--netbiosname=NETBIOSNAME</arg>
48                 <arg choice="opt">--netbios-scope=SCOPE</arg>
49                 <arg choice="opt">-W|--workgroup=WORKGROUP</arg>
50                 <arg choice="opt">--realm=REALM</arg>
51                 <arg choice="opt">-U|--user=[DOMAIN/]USERNAME%[PASSWORD]</arg>
52                 <arg choice="opt">-N|--no-pass</arg>
53                 <arg choice="opt">--password=STRING</arg>
54                 <arg choice="opt">--pw-nt-hash</arg>
55                 <arg choice="opt">-A|--authentication-file=FILE</arg>
56                 <arg choice="opt">-P|--machine-pass</arg>
57                 <arg choice="opt">--simple-bind-dn=DN</arg>
58                 <arg choice="opt">--use-kerberos=desired|required|off</arg>
59                 <arg choice="opt">--use-krb5-ccache=CCACHE</arg>
60                 <arg choice="opt">--use-winbind-ccache</arg>
61                 <arg choice="opt">--client-protection=sign|encrypt|off</arg>
62                 <arg choice="opt">-V|--version</arg>
63                 <arg choice="opt">-c|--command=STRING</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>
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|--name-resolve</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>
140                 <varlistentry>
141                 <term>-M|--message NetBIOS name</term>
142                 <listitem><para>This options allows you to send messages, using
143                 the "WinPopup" protocol, to another computer. Once a connection is
144                 established you then type your message, pressing ^D (control-D) to
145                 end. </para>
147                 <para>If the receiving computer is running WinPopup the user will
148                 receive the message and probably a beep. If they are not running
149                 WinPopup the message will be lost, and no error message will
150                 occur. </para>
152                 <para>The message is also automatically truncated if the message
153                 is over 1600 bytes, as this is the limit of the protocol.
154                 </para>
156                 <para>
157                 One useful trick is to pipe the message through <command>smbclient</command>.
158                 For example: smbclient -M FRED &lt; mymessage.txt will send the
159                 message in the file <filename>mymessage.txt</filename> to the
160                 machine FRED.
161                 </para>
163                 <para>You may also find the <parameter>-U</parameter> and
164                 <parameter>-I</parameter> options useful, as they allow you to
165                 control the FROM and TO parts of the message. </para>
167                 <para>See the <parameter>message command</parameter> parameter in the <citerefentry><refentrytitle>smb.conf</refentrytitle>
168                 <manvolnum>5</manvolnum></citerefentry> for a description of how to handle incoming
169                 WinPopup messages in Samba. </para>
171                 <para><emphasis>Note</emphasis>: Copy WinPopup into the startup group
172                 on your WfWg PCs if you want them to always be able to receive
173                 messages. </para></listitem>
174                 </varlistentry>
176                 <varlistentry>
177                 <term>-p|--port port</term>
178                 <listitem><para>This number is the TCP port number that will be used
179                 when making connections to the server. The standard (well-known)
180                 TCP port number for an SMB/CIFS server is 139, which is the
181                 default. </para></listitem>
182                 </varlistentry>
184                 <varlistentry>
185                 <term>-g|--grepable</term>
186                 <listitem><para>This parameter provides combined with
187                 <parameter>-L</parameter> easy parseable output that allows processing
188                 with utilities such as grep and cut.
189                 </para></listitem>
190                 </varlistentry>
192                 <varlistentry>
193                 <term>-m|--max-protocol protocol</term>
194                 <listitem><para>This allows the user to select the
195                 highest SMB protocol level that smbclient will use to
196                 connect to the server. By default this is set to
197                 highest available SMB3 protocol version.
198                 To connect using SMB2 or SMB1 protocol, use the
199                 strings SMB2 or NT1 respectively. Note that to connect
200                 to a Windows 2012 server with encrypted transport selecting
201                 a max-protocol of SMB3 is required.
202                 </para></listitem>
203                 </varlistentry>
205                 <varlistentry>
206                 <term>-P|--machine-pass</term>
207                 <listitem><para>
208                 Make queries to the external server using the machine account of the local server.
209                 </para></listitem>
210                 </varlistentry>
212                 <varlistentry>
213                 <term>-I|--ip-address IP-address</term>
214                 <listitem><para><replaceable>IP address</replaceable> is the address of the server to connect to.
215                 It should be specified in standard "a.b.c.d" notation. </para>
217                 <para>Normally the client would attempt to locate a named
218                 SMB/CIFS server by looking it up via the NetBIOS name resolution
219                 mechanism described above in the <parameter>name resolve order</parameter>
220                 parameter above. Using this parameter will force the client
221                 to assume that the server is on the machine with the specified IP
222                 address and the NetBIOS name component of the resource being
223                 connected to will be ignored. </para>
225                 <para>There is no default for this parameter. If not supplied,
226                 it will be determined automatically by the client as described
227                 above. </para></listitem>
228                 </varlistentry>
230                 <varlistentry>
231                 <term>-E|--stderr</term>
232                 <listitem><para>This parameter causes the client to write messages
233                 to the standard error stream (stderr) rather than to the standard
234                 output stream. </para>
236                 <para>By default, the client writes messages to standard output
237                 - typically the user's tty. </para></listitem>
238                 </varlistentry>
240                 <varlistentry>
241                 <term>-L|--list</term>
242                 <listitem><para>This option allows you to look at what services
243                 are available on a server. You use it as <command>smbclient -L
244                 host</command> and a list should appear.  The <parameter>-I
245                 </parameter> option may be useful if your NetBIOS names don't
246                 match your TCP/IP DNS host names or if you are trying to reach a
247                 host on another network. </para></listitem>
248                 </varlistentry>
250                 <varlistentry>
251                 <term>-b|--send-buffer buffersize</term>
252                 <listitem><para>
253                 When sending or receiving files, smbclient uses an
254                 internal buffer sized by the maximum number of allowed requests
255                 to the connected server. This command allows this size to be set to any
256                 range between 0 (which means use the default server controlled size) bytes
257                 and 16776960 (0xFFFF00) bytes. Using the server controlled size is the
258                 most efficient as smbclient will pipeline as many simultaneous reads or
259                 writes needed to keep the server as busy as possible. Setting this to
260                 any other size will slow down the transfer. This can also be set
261                 using the <command>iosize</command> command inside smbclient.
262                 </para></listitem>
263                 </varlistentry>
265                 <varlistentry>
266                 <term>-B|--browse</term>
267                 <listitem><para>Browse SMB servers using DNS.</para>
268                 </listitem>
269                 </varlistentry>
271                 <varlistentry>
272                 <term>-t|--timeout &lt;timeout-seconds&gt;</term>
273                 <listitem><para>This allows the user to tune the default
274                 timeout used for each SMB request. The default setting is
275                 20 seconds. Increase it if requests to the server sometimes
276                 time out. This can happen when SMB3 encryption is selected
277                 and smbclient is overwhelming the server with requests.
278                 This can also be set using the <command>timeout</command>
279                 command inside smbclient.
280                 </para></listitem>
281                 </varlistentry>
283                 <varlistentry>
284                 <term>-T|--tar tar options</term>
285                 <listitem><para>smbclient may be used to create <command>tar(1)
286                 </command> compatible backups of all the files on an SMB/CIFS
287                 share. The secondary tar flags that can be given to this option
288                 are:</para>
290                 <itemizedlist>
291                         <listitem><para><parameter>c</parameter> - Create a tar
292                         backup archive on the local system.      Must be followed by
293                         the name of a tar file, tape device or "-" for standard
294                         output. If using standard output you must turn the log
295                         level to its lowest value -d0 to avoid corrupting your tar
296                         file. This flag is mutually exclusive with the
297                         <parameter>x</parameter> flag. </para></listitem>
299                         <listitem><para><parameter>n</parameter> - In
300                         combination with the <parameter>c</parameter>
301                         flag, do not actually create the archive,
302                         instead perform a dry run that attempts
303                         everything that involved in creation other than
304                         writing the file.</para></listitem>
306                         <listitem><para><parameter>x</parameter> - Extract (restore) a local
307                         tar file back to a share. Unless the -D option is given, the tar
308                         files will be restored from the top level of the share. Must be
309                         followed by the name of the tar file, device or "-" for standard
310                         input. Mutually exclusive with the <parameter>c</parameter> flag.
311                         Restored files have their creation times (mtime) set to the
312                         date saved in the tar file. Directories currently do not get
313                         their creation dates restored properly. </para></listitem>
315                         <listitem><para><parameter>I</parameter> - Include files and directories.
316                         Is the default behavior when filenames are specified above. Causes
317                         files to be included in an extract or create (and therefore
318                         everything else to be excluded). See example below.      Filename globbing
319                         works  in one of two ways.      See <parameter>r</parameter> below. </para></listitem>
321                         <listitem><para><parameter>X</parameter> - Exclude files and directories.
322                         Causes files to be excluded from an extract or create. See
323                         example below.  Filename globbing works in one of two ways.
324                         See <parameter>r</parameter> below. </para></listitem>
326                         <listitem><para><parameter>F</parameter> - File containing a list of files and directories.
327                         The <parameter>F</parameter> causes the name following the tarfile to
328                         create to be read as a filename that contains a list of files and directories to
329                         be included in an extract or create (and therefore everything else to be excluded).
330                         See example below. Filename globbing works in one of two ways.
331                         See <parameter>r</parameter> below.
332                         </para></listitem>
334                         <listitem><para><parameter>b</parameter> - Blocksize. Must be followed
335                         by a valid (greater than zero) blocksize.  Causes tar file to be
336                         written out in blocksize*TBLOCK (512 byte) blocks.
337                         </para></listitem>
339                         <listitem><para><parameter>g</parameter> - Incremental. Only back up
340                         files that have the archive bit set. Useful only with the
341                         <parameter>c</parameter> flag. </para></listitem>
343                         <listitem><para><parameter>v</parameter> - Verbose. Makes tar
344                         print out the files being processed. By default tar is not verbose.
345                         This is the same as tarmode verbose.
346                         </para></listitem>
348                         <listitem><para><parameter>r</parameter> - Use wildcard
349                         matching to include or exclude. Deprecated.
350                         </para></listitem>
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>
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>
363                 </itemizedlist>
365                 <para><emphasis>Tar Long File Names</emphasis></para>
367                 <para><command>smbclient</command>'s tar option now supports long
368                 file names both on backup and restore. However, the full path
369                 name of the file must be less than 1024 bytes.  Also, when
370                 a tar archive is created, <command>smbclient</command>'s tar option places all
371                 files in the archive with relative names, not absolute names.
372                 </para>
374                 <para><emphasis>Tar Filenames</emphasis></para>
376                 <para>All file names can be given as DOS path names (with '\\'
377                 as the component separator) or as UNIX path names (with '/' as
378                 the component separator). </para>
380                 <para><emphasis>Examples</emphasis></para>
382                 <para>Restore from tar file <filename>backup.tar</filename> into myshare on mypc
383                 (no password on share). </para>
385                 <para><command>smbclient //mypc/myshare "" -N -Tx backup.tar
386                 </command></para>
388                 <para>Restore everything except <filename>users/docs</filename>
389                 </para>
391                 <para><command>smbclient //mypc/myshare "" -N -TXx backup.tar
392                 users/docs</command></para>
394                 <para>Create a tar file of the files beneath <filename>
395                 users/docs</filename>. </para>
397                 <para><command>smbclient //mypc/myshare "" -N -Tc
398                 backup.tar users/docs </command></para>
400                 <para>Create the same tar file as above, but now use
401                 a DOS path name. </para>
403                 <para><command>smbclient //mypc/myshare "" -N -Tc backup.tar
404                 users\edocs </command></para>
406                 <para>Create a tar file of the files listed in the file <filename>tarlist</filename>.</para>
408                 <para><command>smbclient //mypc/myshare "" -N -TcF
409                 backup.tar tarlist</command></para>
411                 <para>Create a tar file of all the files and directories in
412                 the share. </para>
414                 <para><command>smbclient //mypc/myshare "" -N -Tc backup.tar *
415                 </command></para>
416                 </listitem>
417                 </varlistentry>
419                 <varlistentry>
420                 <term>-D|--directory initial directory</term>
421                 <listitem><para>Change to initial directory before starting. Probably
422                 only of any use with the tar -T option. </para></listitem>
423                 </varlistentry>
425                 <varlistentry>
426                 <term>-c|--command command string</term>
427                 <listitem><para>command string is a semicolon-separated list of
428                 commands to be executed instead of prompting from stdin. <parameter>
429                 -N</parameter> is implied by <parameter>-c</parameter>.</para>
431                 <para>This is particularly useful in scripts and for printing stdin
432                 to the server, e.g. <command>-c 'print -'</command>. </para></listitem>
433                 </varlistentry>
435                 &popt.autohelp;
436                 &cmdline.common.samba.client;
437                 &cmdline.common.connection;
438                 &cmdline.common.credentials;
439         </variablelist>
440 </refsect1>
443 <refsect1>
444         <title>OPERATIONS</title>
446         <para>Once the client is running, the user is presented with
447         a prompt : </para>
449         <para><prompt>smb:\&gt; </prompt></para>
451         <para>The backslash ("\\") indicates the current working directory
452         on the server, and will change if the current working directory
453         is changed. </para>
455         <para>The prompt indicates that the client is ready and waiting to
456         carry out a user command. Each command is a single word, optionally
457         followed by parameters specific to that command. Command and parameters
458         are space-delimited unless these notes specifically
459         state otherwise. All commands are case-insensitive.      Parameters to
460         commands may or may not be case sensitive, depending on the command.
461         </para>
463         <para>You can specify file names which have spaces in them by quoting
464         the name with double quotes, for example "a long file name". </para>
466         <para>Parameters shown in square brackets (e.g., "[parameter]") are
467         optional.  If not given, the command will use suitable defaults. Parameters
468         shown in angle brackets (e.g., "&lt;parameter&gt;") are required.
469         </para>
472         <para>Note that all commands operating on the server are actually
473         performed by issuing a request to the server. Thus the behavior may
474         vary from server to server, depending on how the server was implemented.
475         </para>
477         <para>The commands available are given here in alphabetical order. </para>
479         <variablelist>
480                 <varlistentry>
481                 <term>? [command]</term>
482                 <listitem><para>If <replaceable>command</replaceable> is specified, the ? command will display
483                 a brief informative message about the specified command.  If no
484                 command is specified, a list of available commands will
485                 be displayed. </para></listitem>
486                 </varlistentry>
488                 <varlistentry>
489                 <term>! [shell command]</term>
490                 <listitem><para>If <replaceable>shell command</replaceable> is specified, the !
491                 command will execute a shell locally and run the specified shell
492                 command. If no command is specified, a local shell will be run.
493                 </para></listitem>
494                 </varlistentry>
496                 <varlistentry>
497                 <term>allinfo file</term>
498                 <listitem><para>The client will request that the server return
499                 all known information about a file or directory (including streams).
500                 </para></listitem>
501                 </varlistentry>
503                 <varlistentry>
504                 <term>altname file</term>
505                 <listitem><para>The client will request that the server return
506                 the "alternate" name (the 8.3 name) for a file or directory.
507                 </para></listitem>
508                 </varlistentry>
510                 <varlistentry>
511                 <term>archive &lt;number&gt;</term>
512                 <listitem><para>Sets the archive level when operating on files.
513                 0 means ignore the archive bit, 1 means only operate on files with this bit set,
514                 2 means only operate on files with this bit set and reset it after operation,
515                 3 means operate on all files and reset it after operation. The default is 0.
516                 </para></listitem>
517                 </varlistentry>
519                 <varlistentry>
520                 <term>backup</term>
521                 <listitem><para>Toggle the state of the "backup intent" flag
522                 sent to the server on directory listings and file opens. If
523                 the "backup intent" flag is true, the server will try and
524                 bypass some file system checks if the user has been granted
525                 SE_BACKUP or SE_RESTORE privileges. This state is useful when
526                 performing a backup or restore operation.
527                 </para></listitem>
528                 </varlistentry>
530                 <varlistentry>
531                 <term>blocksize &lt;number&gt;</term>
532                 <listitem><para>Sets the blocksize parameter for a tar operation. The default is 20.
533                 Causes tar file to be written out in blocksize*TBLOCK (normally 512 byte) units.
534                 </para></listitem>
535                 </varlistentry>
537                 <varlistentry>
538                 <term>cancel jobid0 [jobid1] ... [jobidN]</term>
539                 <listitem><para>The client will request that the server cancel
540                 the printjobs identified by the given numeric print job ids.
541                 </para></listitem>
542                 </varlistentry>
544                 <varlistentry>
545                 <term>case_sensitive</term>
546                 <listitem><para>Toggles the setting of the flag in SMB packets that
547                 tells the server to treat filenames as case sensitive. Set to OFF by
548                 default (tells file server to treat filenames as case insensitive). Only
549                 currently affects Samba 3.0.5 and above file servers with the case sensitive
550                 parameter set to auto in the smb.conf.
551                 </para></listitem>
552                 </varlistentry>
554                 <varlistentry>
555                 <term>cd &lt;directory name&gt;</term>
556                 <listitem><para>If "directory name" is specified, the current
557                 working directory on the server will be changed to the directory
558                 specified. This operation will fail if for any reason the specified
559                 directory is inaccessible. </para>
561                 <para>If no directory name is specified, the current working
562                 directory on the server will be reported. </para></listitem>
563                 </varlistentry>
565                 <varlistentry>
566                 <term>chmod file mode in octal</term>
567                 <listitem><para>This command depends on the server supporting the CIFS
568                 UNIX extensions and will fail if the server does not. The client requests that the server
569                 change the UNIX permissions to the given octal mode, in standard UNIX format.
570                 </para></listitem>
571                 </varlistentry>
573                 <varlistentry>
574                 <term>chown file uid gid</term>
575                 <listitem><para>This command depends on the server supporting the CIFS
576                 UNIX extensions and will fail if the server does not. The client requests that the server
577                 change the UNIX user and group ownership to the given decimal values. Note there is
578                 currently no way to remotely look up the UNIX uid and gid values for a given name.
579                 This may be addressed in future versions of the CIFS UNIX extensions.
580                 </para></listitem>
581                 </varlistentry>
583                 <varlistentry>
584                 <term>close &lt;fileid&gt;</term>
585                 <listitem><para>Closes a file explicitly opened by the open command. Used for
586                 internal Samba testing purposes.
587                 </para></listitem>
588                 </varlistentry>
590                 <varlistentry>
591                 <term>del &lt;mask&gt;</term>
592                 <listitem><para>The client will request that the server attempt
593                 to delete all files matching <replaceable>mask</replaceable> from the current working
594                 directory on the server. </para></listitem>
595                 </varlistentry>
597                 <varlistentry>
598                 <term>deltree &lt;mask&gt;</term>
599                 <listitem><para>The client will request that the server attempt
600                 to delete all files and directories matching <replaceable>mask</replaceable> from the current working
601                 directory on the server. Note this will recursively delete files and directories within
602                 the directories selected even without the recurse command being set. If any of the delete
603                 requests fail the command will stop processing at that point, leaving files and directories
604                 not yet processed untouched. This is by design.</para></listitem>
605                 </varlistentry>
607                 <varlistentry>
608                 <term>dir &lt;mask&gt;</term>
609                 <listitem><para>A list of the files matching <replaceable>mask</replaceable> in the current
610                 working directory on the server will be retrieved from the server
611                 and displayed. </para></listitem>
612                 </varlistentry>
614                 <varlistentry>
615                 <term>du &lt;filename&gt;</term>
616                 <listitem><para>Does a directory listing and then prints out the current disk usage and free space on a share.
617                 </para></listitem>
618                 </varlistentry>
620                 <varlistentry>
621                 <term>echo &lt;number&gt; &lt;data&gt;</term>
622                 <listitem><para>Does an SMBecho request to ping the server. Used for internal Samba testing purposes.
623                 </para></listitem>
624                 </varlistentry>
626                 <varlistentry>
627                 <term>exit</term>
628                 <listitem><para>Terminate the connection with the server and exit
629                 from the program. </para></listitem>
630                 </varlistentry>
632                 <varlistentry>
633                 <term>get &lt;remote file name&gt; [local file name]</term>
634                 <listitem><para>Copy the file called <filename>remote file name</filename> from
635                 the server to the machine running the client. If specified, name
636                 the local copy <filename>local file name</filename>.  Note that all transfers in
637                 <command>smbclient</command> are binary. See also the
638                 lowercase command. </para></listitem>
639                 </varlistentry>
641                 <varlistentry>
642                 <term>getfacl &lt;filename&gt;</term>
643                 <listitem><para>Requires the server support the UNIX extensions. Requests and prints
644                 the POSIX ACL on a file.
645                 </para></listitem>
646                 </varlistentry>
648                 <varlistentry>
649                 <term>hardlink &lt;src&gt; &lt;dest&gt;</term>
650                 <listitem><para>Creates a hardlink on the server using Windows CIFS semantics.
651                 </para></listitem>
652                 </varlistentry>
654                 <varlistentry>
655                 <term>help [command]</term>
656                 <listitem><para>See the ? command above. </para></listitem>
657                 </varlistentry>
659                 <varlistentry>
660                 <term>history</term> <listitem><para>Displays the command history.</para></listitem>
661                 </varlistentry>
663                 <varlistentry>
664                 <term>iosize &lt;bytes&gt;</term>
665                 <listitem><para>
666                 When sending or receiving files, smbclient uses an
667                 internal buffer sized by the maximum number of allowed requests
668                 to the connected server. This command allows this size to be set to any
669                 range between 0 (which means use the default server controlled size) bytes
670                 and 16776960 (0xFFFF00) bytes. Using the server controlled size is the
671                 most efficient as smbclient will pipeline as many simultaneous reads or
672                 writes needed to keep the server as busy as possible. Setting this to
673                 any other size will slow down the transfer.
674                 </para></listitem>
675                 </varlistentry>
677                 <varlistentry>
678                 <term>lcd [directory name]</term>
679                 <listitem><para>If <replaceable>directory name</replaceable> is specified, the current
680                 working directory on the local machine will be changed to
681                 the directory specified. This operation will fail if for any
682                 reason the specified directory is inaccessible. </para>
684                 <para>If no directory name is specified, the name of the
685                 current working directory on the local machine will be reported.
686                 </para></listitem>
687                 </varlistentry>
689                 <varlistentry>
690                 <term>link target linkname</term>
691                 <listitem><para>This command depends on the server supporting the CIFS
692                 UNIX extensions and will fail if the server does not. The client requests that the server
693                 create a hard link between the linkname and target files. The linkname file
694                 must not exist.
695                 </para></listitem>
696                 </varlistentry>
698                 <varlistentry>
699                 <term>listconnect</term>
700                 <listitem><para>Show the current connections held for DFS purposes.
701                 </para></listitem>
702                 </varlistentry>
704                 <varlistentry>
705                 <term>lock &lt;filenum&gt; &lt;r|w&gt; &lt;hex-start&gt; &lt;hex-len&gt;</term>
706                 <listitem><para>This command depends on the server supporting the CIFS
707                 UNIX extensions and will fail if the server does not. Tries to set a POSIX
708                 fcntl lock of the given type on the given range. Used for internal Samba testing purposes.
709                 </para></listitem>
710                 </varlistentry>
712                 <varlistentry>
713                 <term>logon &lt;username&gt; &lt;password&gt;</term>
714                 <listitem><para>Establishes a new vuid for this session by logging on again.
715                 Replaces the current vuid. Prints out the new vuid. Used for internal Samba testing purposes.
716                 </para></listitem>
717                 </varlistentry>
719                 <varlistentry>
720                 <term>logoff</term>
721                 <listitem><para>Logs the user off the server, closing the session.
722                 Used for internal Samba testing purposes.
723                 </para></listitem>
724                 </varlistentry>
726                 <varlistentry>
727                 <term>lowercase</term>
728                 <listitem><para>Toggle lowercasing of filenames for the get and
729                 mget commands.
730                 </para>
732                 <para>When lowercasing is toggled ON, local filenames are converted
733                 to lowercase when using the get and mget commands. This is
734                 often useful when copying (say) MSDOS files from a server, because
735                 lowercase filenames are the norm on UNIX systems. </para></listitem>
736                 </varlistentry>
738                 <varlistentry>
739                 <term>ls &lt;mask&gt;</term>
740                 <listitem><para>See the dir command above. </para></listitem>
741                 </varlistentry>
743                 <varlistentry>
744                 <term>mask &lt;mask&gt;</term>
745                 <listitem><para>This command allows the user to set up a mask
746                 which will be used during recursive operation of the mget and
747                 mput commands. </para>
749                 <para>The masks specified to the mget and mput commands act as
750                 filters for directories rather than files when recursion is
751                 toggled ON. </para>
753                 <para>The mask specified with the mask command is necessary
754                 to filter files within those directories. For example, if the
755                 mask specified in an mget command is "source*" and the mask
756                 specified with the mask command is "*.c" and recursion is
757                 toggled ON, the mget command will retrieve all files matching
758                 "*.c" in all directories below and including all directories
759                 matching "source*" in the current working directory. </para>
761                 <para>Note that the value for mask defaults to blank (equivalent
762                 to "*") and remains so until the mask command is used to change it.
763                 It retains the most recently specified value indefinitely. To
764                 avoid unexpected results it would be wise to change the value of
765                 mask back to "*" after using the mget or mput commands. </para></listitem>
766                 </varlistentry>
768                 <varlistentry>
769                 <term>md &lt;directory name&gt;</term>
770                 <listitem><para>See the mkdir command. </para></listitem>
771                 </varlistentry>
773                 <varlistentry>
774                 <term>mget &lt;mask&gt;</term>
775                 <listitem><para>Copy all files matching <replaceable>mask</replaceable> from the server to
776                 the machine running the client. </para>
778                 <para>Note that <replaceable>mask</replaceable> is interpreted differently during recursive
779                 operation and non-recursive operation - refer to the recurse and
780                 mask commands for more information. Note that all transfers in
781                 <command>smbclient</command> are binary. See also the lowercase command. </para></listitem>
782                 </varlistentry>
784                 <varlistentry>
785                 <term>mkdir &lt;directory name&gt;</term>
786                 <listitem><para>Create a new directory on the server (user access
787                 privileges permitting) with the specified name. </para></listitem>
788                 </varlistentry>
790                 <varlistentry>
791                 <term>more &lt;file name&gt;</term>
792                 <listitem><para>Fetch a remote file and view it with the contents
793                 of your PAGER environment variable.
794                 </para></listitem>
795                 </varlistentry>
797                 <varlistentry>
798                 <term>mput &lt;mask&gt;</term>
799                 <listitem><para>Copy all files matching <replaceable>mask</replaceable> in the current working
800                 directory on the local machine to the current working directory on
801                 the server. </para>
803                 <para>Note that <replaceable>mask</replaceable> is interpreted differently during recursive
804                 operation and non-recursive operation - refer to the recurse and mask
805                 commands for more information. Note that all transfers in <command>smbclient</command>
806                 are binary. </para></listitem>
807                 </varlistentry>
809                 <varlistentry>
810                 <term>notify &lt;dir name&gt;</term>
811                 <listitem><para>Query a directory for change
812                 notifications. This command issues a recursive
813                 filechangenotify call for all possible changes. As
814                 changes come in will print one line per change. See
815                 <ulink url="https://msdn.microsoft.com/en-us/library/dn392331.aspx">https://msdn.microsoft.com/en-us/library/dn392331.aspx</ulink>
816                 for a description of the action numbers that this
817                 command prints.</para>
818                 <para>This command never ends, it waits for event
819                 indefinitely.
820                 </para></listitem>
821                 </varlistentry>
823                 <varlistentry>
824                 <term>posix</term>
825                 <listitem><para>Query the remote server to see if it supports the CIFS UNIX
826                 extensions and prints out the list of capabilities supported. If so, turn
827                 on POSIX pathname processing and large file read/writes (if available),.
828                 </para></listitem>
829                 </varlistentry>
831                 <varlistentry>
832                 <term>posix_encrypt &lt;domain&gt; &lt;username&gt; &lt;password&gt;</term>
833                 <listitem><para>This command depends on the server supporting the CIFS
834                 UNIX extensions and will fail if the server does not. Attempt to negotiate
835                 SMB encryption on this connection. If smbclient connected with kerberos
836                 credentials (-k) the arguments to this command are ignored and the kerberos
837                 credentials are used to negotiate GSSAPI signing and sealing instead. See
838                 also the -e option to smbclient to force encryption on initial connection.
839                 This command is new with Samba 3.2.
840                 </para></listitem>
841                 </varlistentry>
843                 <varlistentry>
844                 <term>posix_open &lt;filename&gt; &lt;octal mode&gt;</term>
845                 <listitem><para>This command depends on the server supporting the CIFS
846                 UNIX extensions and will fail if the server does not. Opens a remote file
847                 using the CIFS UNIX extensions and prints a fileid. Used for internal Samba
848                 testing purposes.
849                 </para></listitem>
850                 </varlistentry>
852                 <varlistentry>
853                 <term>posix_mkdir &lt;directoryname&gt; &lt;octal mode&gt;</term>
854                 <listitem><para>This command depends on the server supporting the CIFS
855                 UNIX extensions and will fail if the server does not. Creates a remote directory
856                 using the CIFS UNIX extensions with the given mode.
857                 </para></listitem>
858                 </varlistentry>
860                 <varlistentry>
861                 <term>posix_rmdir &lt;directoryname&gt;</term>
862                 <listitem><para>This command depends on the server supporting the CIFS
863                 UNIX extensions and will fail if the server does not. Deletes a remote directory
864                 using the CIFS UNIX extensions.
865                 </para></listitem>
866                 </varlistentry>
868                 <varlistentry>
869                 <term>posix_unlink &lt;filename&gt;</term>
870                 <listitem><para>This command depends on the server supporting the CIFS
871                 UNIX extensions and will fail if the server does not. Deletes a remote file
872                 using the CIFS UNIX extensions.
873                 </para></listitem>
874                 </varlistentry>
876                 <varlistentry>
877                 <term>posix_whoami</term>
878                 <listitem><para>Query the remote server for the user token using the CIFS UNIX
879                 extensions WHOAMI call. Prints out the guest status, user, group, group list and
880                 sid list that the remote server is using on behalf of the logged on user.
881                 </para></listitem>
882                 </varlistentry>
884                 <varlistentry>
885                 <term>print &lt;file name&gt;</term>
886                 <listitem><para>Print the specified file from the local machine
887                 through a printable service on the server. </para></listitem>
888                 </varlistentry>
890                 <varlistentry>
891                 <term>prompt</term>
892                 <listitem><para>Toggle prompting for filenames during operation
893                 of the mget and mput commands. </para>
895                 <para>When toggled ON, the user will be prompted to confirm
896                 the transfer of each file during these commands. When toggled
897                 OFF, all specified files will be transferred without prompting.
898                 </para></listitem>
899                 </varlistentry>
901                 <varlistentry>
902                 <term>put &lt;local file name&gt; [remote file name]</term>
903                 <listitem><para>Copy the file called <filename>local file name</filename> from the
904                 machine running the client to the server. If specified,
905                 name the remote copy <filename>remote file name</filename>. Note that all transfers
906                 in <command>smbclient</command> are binary. See also the lowercase command.
907                 </para></listitem>
908                 </varlistentry>
910                 <varlistentry>
911                 <term>queue</term>
912                 <listitem><para>Displays the print queue, showing the job id,
913                 name, size and current status. </para></listitem>
914                 </varlistentry>
916                 <varlistentry>
917                 <term>quit</term>
918                 <listitem><para>See the exit command. </para></listitem>
919                 </varlistentry>
921                 <varlistentry>
922                 <term>readlink symlinkname</term>
923                 <listitem><para>This command depends on the server supporting the CIFS
924                 UNIX extensions and will fail if the server does not. Print
925                 the value of the symlink "symlinkname".
926                 </para></listitem>
927                 </varlistentry>
929                 <varlistentry>
930                 <term>rd &lt;directory name&gt;</term>
931                 <listitem><para>See the rmdir command. </para></listitem>
932                 </varlistentry>
934                 <varlistentry>
935                 <term>recurse</term>
936                 <listitem><para>Toggle directory recursion for the commands mget
937                 and mput. </para>
939                 <para>When toggled ON, these commands will process all directories
940                 in the source directory (i.e., the directory they are copying
941                 from ) and will recurse into any that match the mask specified
942                 to the command. Only files that match the mask specified using
943                 the mask command will be retrieved. See also the mask command.
944                 </para>
946                 <para>When recursion is toggled OFF, only files from the current
947                 working directory on the source machine that match the mask specified
948                 to the mget or mput commands will be copied, and any mask specified
949                 using the mask command will be ignored. </para></listitem>
950                 </varlistentry>
952                 <varlistentry>
953                 <term>rename &lt;old filename&gt; &lt;new filename&gt; [-f]</term>
954                 <listitem><para>Rename files in the current working directory on the
955                 server from <replaceable>old filename</replaceable> to
956                 <replaceable>new filename</replaceable>. The optional
957                 -f switch allows for superseding the destination file,
958                 if it exists. This is supported by NT1 protocol dialect
959                 and SMB2 protocol family.</para></listitem>
960                 </varlistentry>
962                 <varlistentry>
963                 <term>rm &lt;mask&gt;</term>
964                 <listitem><para>Remove all files matching <replaceable>mask</replaceable> from the current
965                 working directory on the server. </para></listitem>
966                 </varlistentry>
968                 <varlistentry>
969                 <term>rmdir &lt;directory name&gt;</term>
970                 <listitem><para>Remove the specified directory (user access
971                 privileges permitting) from the server. </para></listitem>
972                 </varlistentry>
974                 <varlistentry>
975                 <term>scopy &lt;source filename&gt; &lt;destination filename&gt;</term>
976                 <listitem><para>Attempt to copy a file on the server using the
977                 most efficient server-side copy calls. Falls back to using
978                 read then write if server doesn't support server-side copy.
979                 </para></listitem>
980                 </varlistentry>
982                 <varlistentry>
983                 <term>setmode &lt;filename&gt; &lt;perm=[+|\-]rsha&gt;</term>
984                 <listitem><para>A version of the DOS attrib command to set
985                 file permissions. For example: </para>
987                 <para><command>setmode myfile +r </command></para>
989                 <para>would make myfile read only. </para></listitem>
990                 </varlistentry>
992                 <varlistentry>
993                 <term>showconnect</term>
994                 <listitem><para>Show the currently active connection held for DFS purposes.
995                 </para></listitem>
996                 </varlistentry>
998                 <varlistentry>
999                 <term>stat file</term>
1000                 <listitem><para>This command depends on the server supporting the CIFS
1001                 UNIX extensions and will fail if the server does not. The client requests the
1002                 UNIX basic info level and prints out the same info that the Linux stat command
1003                 would about the file. This includes the size, blocks used on disk, file type,
1004                 permissions, inode number, number of links and finally the three timestamps
1005                 (access, modify and change). If the file is a special file (symlink, character or
1006                 block device, fifo or socket) then extra information may also be printed.
1007                 </para></listitem>
1008                 </varlistentry>
1010                 <varlistentry>
1011                 <term>symlink target linkname</term>
1012                 <listitem><para>This command depends on the server supporting the CIFS
1013                 UNIX extensions and will fail if the server does not. The client requests that the server
1014                 create a symbolic hard link between the target and linkname files. The linkname file
1015                 must not exist. Note that the server will not create a link to any path that lies
1016                 outside the currently connected share. This is enforced by the Samba server.
1017                 </para></listitem>
1018                 </varlistentry>
1020                 <varlistentry>
1021                 <term>tar &lt;c|x&gt;[IXbgNa]</term>
1022                 <listitem><para>Performs a tar operation - see the
1023                 <parameter>-T</parameter> command line option above. Behavior
1024                 may be affected by the tarmode command (see below). Using g
1025                 (incremental) and N (newer) will affect tarmode settings. Note
1026                 that using the "-" option with tar x may not work - use the
1027                 command line option instead.</para></listitem>
1028                 </varlistentry>
1030                 <varlistentry>
1031                 <term>blocksize &lt;blocksize&gt;</term>
1032                 <listitem><para>Blocksize. Must be followed by a valid (greater
1033                 than zero) blocksize. Causes tar file to be written out in
1034                 <replaceable>blocksize</replaceable>*TBLOCK (512 byte) blocks. </para></listitem>
1035                 </varlistentry>
1037                 <varlistentry>
1038                 <term>tarmode &lt;full|inc|reset|noreset|system|nosystem|hidden|nohidden|verbose|noverbose&gt;</term>
1039                 <listitem><para>Changes tar's behavior with regard to DOS
1040                 attributes. There are 4 modes which can be turned on or
1041                 off.</para>
1043                 <para>Incremental mode (default off). When off (using
1044                 <command>full</command>) tar will back up everything
1045                 regardless of the <emphasis>archive</emphasis> bit
1046                 setting. When on (using <command>inc</command>), tar will only
1047                 back up files with the archive bit set.</para>
1049                 <para>Reset mode (default off). When on (using
1050                 <command>reset</command>), tar will remove the archive bit on
1051                 all files it backs up (implies read/write share). Use
1052                 <command>noreset</command> to turn off.</para>
1054                 <para>System mode (default on). When off, tar will not backup
1055                 system files. Use <command>nosystem</command> to turn off.</para>
1057                 <para>Hidden mode (default on). When off, tar will not backup
1058                 hidden files. Use <command>nohidden</command> to turn off.</para>
1059                 </listitem>
1060                 </varlistentry>
1062                 <varlistentry>
1063                 <term>timeout &lt;per-operation timeout in seconds&gt;</term>
1064                 <listitem><para>This allows the user to tune the default
1065                 timeout used for each SMB request. The default setting is
1066                 20 seconds. Increase it if requests to the server sometimes
1067                 time out. This can happen when SMB3 encryption is selected
1068                 and smbclient is overwhelming the server with requests.
1069                 </para></listitem>
1070                 </varlistentry>
1072                 <varlistentry>
1073                 <term>unlock &lt;filenum&gt; &lt;hex-start&gt; &lt;hex-len&gt;</term>
1074                 <listitem><para>This command depends on the server supporting the CIFS
1075                 UNIX extensions and will fail if the server does not. Tries to unlock a POSIX
1076                 fcntl lock on the given range. Used for internal Samba testing purposes.
1077                 </para></listitem>
1078                 </varlistentry>
1080                 <varlistentry>
1081                 <term>volume</term>
1082                 <listitem><para>Prints the current volume name of the share.
1083                 </para></listitem>
1084                 </varlistentry>
1086                 <varlistentry>
1087                 <term>vuid &lt;number&gt;</term>
1088                 <listitem><para>Changes the currently used vuid in the protocol to
1089                 the given arbitrary number. Without an argument prints out the current
1090                 vuid being used. Used for internal Samba testing purposes.
1091                 </para></listitem>
1092                 </varlistentry>
1094                 <varlistentry>
1095                 <term>tcon &lt;sharename&gt;</term>
1096                 <listitem><para>Establishes a new tree connect (connection to a share).
1097                 Replaces the current tree connect. Prints the new tid (tree id).
1098                 Used for internal Samba testing purposes.
1099                 </para></listitem>
1100                 </varlistentry>
1102                 <varlistentry>
1103                 <term>tdis</term>
1104                 <listitem><para>Close the current share connection (tree disconnect).
1105                 Used for internal Samba testing purposes.
1106                 </para></listitem>
1107                 </varlistentry>
1109                 <varlistentry>
1110                 <term>tid &lt;number&gt;</term>
1111                 <listitem><para>Changes the current tree id (tid) in the
1112                 protocol to a new arbitrary number. Without an argument, it
1113                 prints out the tid currently used.
1114                 Used for internal Samba testing purposes.
1115                 </para></listitem>
1116                 </varlistentry>
1118                 <varlistentry>
1119                 <term>utimes &lt;filename&gt; &lt;create time&gt; &lt;access time&gt; &lt;write time&gt; &lt;
1120                 change time&gt;</term>
1121                 <listitem><para>Changes the timestamps on a file by name.
1122                 Times should be specified in the format [YY]YY:MM:DD-HH:MM:SS or -1 for no change.
1123                 </para></listitem>
1124                 </varlistentry>
1126         </variablelist>
1127 </refsect1>
1129 <refsect1>
1130         <title>NOTES</title>
1132         <para>Some servers are fussy about the case of supplied usernames,
1133         passwords, share names (AKA service names) and machine names.
1134         If you fail to connect try giving all parameters in uppercase.
1135         </para>
1137         <para>It is often necessary to use the -n option when connecting
1138         to some types of servers. For example OS/2 LanManager insists
1139         on a valid NetBIOS name being used, so you need to supply a valid
1140         name that would be known to the server.</para>
1142         <para>smbclient supports long file names where the server
1143         supports the LANMAN2 protocol or above. </para>
1144 </refsect1>
1146 <refsect1>
1147         <title>ENVIRONMENT VARIABLES</title>
1149         <para>See the <command>--user</command> and
1150         <command>--password</command> options for details on ways to
1151         specify a username and password via an environment variable.
1152         </para>
1153 </refsect1>
1156 <refsect1>
1157         <title>INSTALLATION</title>
1159         <para>The location of the client program is a matter for
1160         individual system administrators. The following are thus
1161         suggestions only. </para>
1163         <para>It is recommended that the smbclient software be installed
1164         in the <filename>/usr/local/samba/bin/</filename> or <filename>
1165         /usr/samba/bin/</filename> directory, this directory readable
1166         by all, writeable only by root. The client program itself should
1167         be executable by all. The client should <emphasis>NOT</emphasis> be
1168         setuid or setgid! </para>
1170         <para>The client log files should be put in a directory readable
1171         and writeable only by the user. </para>
1173         <para>To test the client, you will need to know the name of a
1174         running SMB/CIFS server. It is possible to run <citerefentry><refentrytitle>smbd</refentrytitle>
1175         <manvolnum>8</manvolnum></citerefentry> as an ordinary user - running that server as a daemon
1176         on a user-accessible port (typically any port number over 1024)
1177         would provide a suitable test server. </para>
1178 </refsect1>
1181 <refsect1>
1182         <title>DIAGNOSTICS</title>
1184         <para>Most diagnostics issued by the client are logged in a
1185         specified log file. The log file name is specified at compile time,
1186         but may be overridden on the command line. </para>
1188         <para>The number and nature of diagnostics available depends
1189         on the debug level used by the client. If you have problems,
1190         set the debug level to 3 and peruse the log files. </para>
1191 </refsect1>
1194 <refsect1>
1195         <title>VERSION</title>
1197         <para>This man page is part of version &doc.version; of the Samba suite.</para>
1198 </refsect1>
1201 <refsect1>
1202         <title>AUTHOR</title>
1204         <para>The original Samba software and related utilities
1205         were created by Andrew Tridgell. Samba is now developed
1206         by the Samba Team as an Open Source project similar
1207         to the way the Linux kernel is developed.</para>
1208 </refsect1>
1210 </refentry>