Ignore:
Timestamp:
Jun 29, 2007, 11:34:14 AM (14 years ago)
Author:
Paul Smedley
Message:

Update source to 3.0.25b

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/samba/docs/htmldocs/manpages/smbclient.1.html

    r39 r44  
    11<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>smbclient</title><link rel="stylesheet" href="samba.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.71.0"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en"><a name="smbclient.1"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>smbclient &#8212; ftp-like client to access SMB/CIFS resources
    2         on servers</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">smbclient</code>  [-b &lt;buffer size&gt;] [-d debuglevel] [-L &lt;netbios name&gt;] [-U username] [-I destinationIP] [-M &lt;netbios name&gt;] [-m maxprotocol] [-A authfile] [-N] [-i scope] [-O &lt;socket options&gt;] [-p port] [-R &lt;name resolve order&gt;] [-s &lt;smb config file&gt;] [-k] [-P] [-c &lt;command&gt;]</p></div><div class="cmdsynopsis"><p><code class="command">smbclient</code>  {servicename} [password] [-b &lt;buffer size&gt;] [-d debuglevel] [-D Directory] [-U username] [-W workgroup] [-M &lt;netbios name&gt;] [-m maxprotocol] [-A authfile] [-N] [-l logdir] [-I destinationIP] [-E] [-c &lt;command string&gt;] [-i scope] [-O &lt;socket options&gt;] [-p port] [-R &lt;name resolve order&gt;] [-s &lt;smb config file&gt;] [-T&lt;c|x&gt;IXFqgbNan] [-k]</p></div></div><div class="refsect1" lang="en"><a name="id260125"></a><h2>DESCRIPTION</h2><p>This tool is part of the <a href="samba.7.html"><span class="citerefentry"><span class="refentrytitle">samba</span>(7)</span></a> suite.</p><p><span><strong class="command">smbclient</strong></span> is a client that can
     2        on servers</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="literal">smbclient</code> [-b &lt;buffer size&gt;] [-d debuglevel] [-L &lt;netbios name&gt;] [-U username] [-I destinationIP] [-M &lt;netbios name&gt;] [-m maxprotocol] [-A authfile] [-N] [-i scope] [-O &lt;socket options&gt;] [-p port] [-R &lt;name resolve order&gt;] [-s &lt;smb config file&gt;] [-k] [-P] [-c &lt;command&gt;]</p></div><div class="cmdsynopsis"><p><code class="literal">smbclient</code> {servicename} [password] [-b &lt;buffer size&gt;] [-d debuglevel] [-D Directory] [-U username] [-W workgroup] [-M &lt;netbios name&gt;] [-m maxprotocol] [-A authfile] [-N] [-l logdir] [-I destinationIP] [-E] [-c &lt;command string&gt;] [-i scope] [-O &lt;socket options&gt;] [-p port] [-R &lt;name resolve order&gt;] [-s &lt;smb config file&gt;] [-T&lt;c|x&gt;IXFqgbNan] [-k]</p></div></div><div class="refsect1" lang="en"><a name="id260125"></a><h2>DESCRIPTION</h2><p>This tool is part of the <a href="samba.7.html"><span class="citerefentry"><span class="refentrytitle">samba</span>(7)</span></a> suite.</p><p><code class="literal">smbclient</code> is a client that can
    33        'talk' to an SMB/CIFS server. It offers an interface
    44        similar to that of the ftp program (see <a href="ftp.1.html"><span class="citerefentry"><span class="refentrytitle">ftp</span>(1)</span></a>). 
     
    1919                same as the IP hostname of the machine running the server.
    2020                </p><p>The server name is looked up according to either
    21                 the <em class="parameter"><code>-R</code></em> parameter to <span><strong class="command">smbclient</strong></span> or
     21                the <em class="parameter"><code>-R</code></em> parameter to <code class="literal">smbclient</code> or
    2222                using the name resolve order parameter in
    2323                the <a href="smb.conf.5.html"><span class="citerefentry"><span class="refentrytitle">smb.conf</span>(5)</span></a> file,
     
    7474                is over 1600 bytes, as this is the limit of the protocol.
    7575                </p><p>
    76                 One useful trick is to cat the message through <span><strong class="command">smbclient</strong></span>. For example:
     76                One useful trick is to cat the message through <code class="literal">smbclient</code>. For example:
    7777</p><pre class="programlisting">
    78 <span><strong class="command">cat mymessage.txt | smbclient -M FRED </strong></span>
     78<code class="literal">cat mymessage.txt | smbclient -M FRED </code>
    7979</pre><p>
    8080                will send the message in the file <code class="filename">mymessage.txt</code> to the machine FRED.
     
    103103                output stream. </p><p>By default, the client writes messages to standard output
    104104                - typically the user's tty. </p></dd><dt><span class="term">-L</span></dt><dd><p>This option allows you to look at what services
    105                 are available on a server. You use it as <span><strong class="command">smbclient -L
    106                 host</strong></span> and a list should appear.  The <em class="parameter"><code>-I
     105                are available on a server. You use it as <code class="literal">smbclient -L
     106                host</code> and a list should appear.  The <em class="parameter"><code>-I
    107107                </code></em> option may be useful if your NetBIOS names don't
    108108                match your TCP/IP DNS host names or if you are trying to reach a
    109                 host on another network. </p></dd><dt><span class="term">-t terminal code</span></dt><dd><p>This option tells <span><strong class="command">smbclient</strong></span> how to interpret
     109                host on another network. </p></dd><dt><span class="term">-t terminal code</span></dt><dd><p>This option tells <code class="literal">smbclient</code> how to interpret
    110110                filenames coming from the remote server. Usually Asian language
    111111                multibyte UNIX implementations use different character sets than
    112112                SMB/CIFS servers (<span class="emphasis"><em>EUC</em></span> instead of <span class="emphasis"><em>
    113113                SJIS</em></span> for example). Setting this parameter will let
    114                 <span><strong class="command">smbclient</strong></span> convert between the UNIX filenames and
     114                <code class="literal">smbclient</code> convert between the UNIX filenames and
    115115                the SMB filenames correctly. This option has not been seriously tested
    116116                and may have some problems. </p><p>The terminal codes include CWsjis, CWeuc, CWjis7, CWjis8,
     
    173173<em class="parameter"><code>-A</code></em> for more details. </p><p>Be cautious about including passwords in scripts. Also, on
    174174many systems the command line of a running process may be seen
    175 via the <span><strong class="command">ps</strong></span> command.  To be safe always allow
    176 <span><strong class="command">rpcclient</strong></span> to prompt for a password and type
     175via the <code class="literal">ps</code> command.  To be safe always allow
     176<code class="literal">rpcclient</code> to prompt for a password and type
    177177it in directly. </p></dd><dt><span class="term">-n &lt;primary NetBIOS name&gt;</span></dt><dd><p>This option allows you to override
    178178the NetBIOS name that Samba uses for itself. This is identical
     
    181181line setting will take precedence over settings in
    182182<code class="filename">smb.conf</code>.</p></dd><dt><span class="term">-i &lt;scope&gt;</span></dt><dd><p>This specifies a NetBIOS scope that
    183 <span><strong class="command">nmblookup</strong></span> will use to communicate with when
     183<code class="literal">nmblookup</code> will use to communicate with when
    184184generating NetBIOS names. For details on the use of NetBIOS
    185185scopes, see rfc1001.txt and rfc1002.txt. NetBIOS scopes are
     
    193193socket. See the socket options parameter in
    194194the <code class="filename">smb.conf</code> manual page for the list of valid
    195 options. </p></dd><dt><span class="term">-T tar options</span></dt><dd><p>smbclient may be used to create <span><strong class="command">tar(1)
    196                 </strong></span> compatible backups of all the files on an SMB/CIFS
     195options. </p></dd><dt><span class="term">-T tar options</span></dt><dd><p>smbclient may be used to create <code class="literal">tar(1)
     196                </code> compatible backups of all the files on an SMB/CIFS
    197197                share. The secondary tar flags that can be given to this option
    198198                are : </p><div class="itemizedlist"><ul type="disc"><li><p><em class="parameter"><code>c</code></em> - Create a tar file on UNIX.
     
    240240                        archive bit to be reset when a file is backed up. Useful with the
    241241                        <em class="parameter"><code>g</code></em> and <em class="parameter"><code>c</code></em> flags.
    242                         </p></li></ul></div><p><span class="emphasis"><em>Tar Long File Names</em></span></p><p><span><strong class="command">smbclient</strong></span>'s tar option now supports long
     242                        </p></li></ul></div><p><span class="emphasis"><em>Tar Long File Names</em></span></p><p><code class="literal">smbclient</code>'s tar option now supports long
    243243                file names both on backup and restore. However, the full path
    244244                name of the file must be less than 1024 bytes.  Also, when
    245                 a tar archive is created, <span><strong class="command">smbclient</strong></span>'s tar option places all
     245                a tar archive is created, <code class="literal">smbclient</code>'s tar option places all
    246246                files in the archive with relative names, not absolute names.
    247247                </p><p><span class="emphasis"><em>Tar Filenames</em></span></p><p>All file names can be given as DOS path names (with '\\'
    248248                as the component separator) or as UNIX path names (with '/' as
    249249                the component separator). </p><p><span class="emphasis"><em>Examples</em></span></p><p>Restore from tar file <code class="filename">backup.tar</code> into myshare on mypc
    250                 (no password on share). </p><p><span><strong class="command">smbclient //mypc/yshare "" -N -Tx backup.tar
    251                 </strong></span></p><p>Restore everything except <code class="filename">users/docs</code>
    252                 </p><p><span><strong class="command">smbclient //mypc/myshare "" -N -TXx backup.tar
    253                 users/docs</strong></span></p><p>Create a tar file of the files beneath <code class="filename">
    254                 users/docs</code>. </p><p><span><strong class="command">smbclient //mypc/myshare "" -N -Tc
    255                 backup.tar users/docs </strong></span></p><p>Create the same tar file as above, but now use
    256                 a DOS path name. </p><p><span><strong class="command">smbclient //mypc/myshare "" -N -tc backup.tar
    257                 users\edocs </strong></span></p><p>Create a tar file of the files listed in the file <code class="filename">tarlist</code>.</p><p><span><strong class="command">smbclient //mypc/myshare "" -N -TcF
    258                 backup.tar tarlist</strong></span></p><p>Create a tar file of all the files and directories in
    259                 the share. </p><p><span><strong class="command">smbclient //mypc/myshare "" -N -Tc backup.tar *
    260                 </strong></span></p></dd><dt><span class="term">-D initial directory</span></dt><dd><p>Change to initial directory before starting. Probably
     250                (no password on share). </p><p><code class="literal">smbclient //mypc/yshare "" -N -Tx backup.tar
     251                </code></p><p>Restore everything except <code class="filename">users/docs</code>
     252                </p><p><code class="literal">smbclient //mypc/myshare "" -N -TXx backup.tar
     253                users/docs</code></p><p>Create a tar file of the files beneath <code class="filename">
     254                users/docs</code>. </p><p><code class="literal">smbclient //mypc/myshare "" -N -Tc
     255                backup.tar users/docs </code></p><p>Create the same tar file as above, but now use
     256                a DOS path name. </p><p><code class="literal">smbclient //mypc/myshare "" -N -tc backup.tar
     257                users\edocs </code></p><p>Create a tar file of the files listed in the file <code class="filename">tarlist</code>.</p><p><code class="literal">smbclient //mypc/myshare "" -N -TcF
     258                backup.tar tarlist</code></p><p>Create a tar file of all the files and directories in
     259                the share. </p><p><code class="literal">smbclient //mypc/myshare "" -N -Tc backup.tar *
     260                </code></p></dd><dt><span class="term">-D initial directory</span></dt><dd><p>Change to initial directory before starting. Probably
    261261                only of any use with the tar -T option. </p></dd><dt><span class="term">-c command string</span></dt><dd><p>command string is a semicolon-separated list of
    262262                commands to be executed instead of prompting from stdin. <em class="parameter"><code>
    263263                -N</code></em> is implied by <em class="parameter"><code>-c</code></em>.</p><p>This is particularly useful in scripts and for printing stdin
    264                 to the server, e.g. <span><strong class="command">-c 'print -'</strong></span>. </p></dd></dl></div></div><div class="refsect1" lang="en"><a name="id301528"></a><h2>OPERATIONS</h2><p>Once the client is running, the user is presented with
     264                to the server, e.g. <code class="literal">-c 'print -'</code>. </p></dd></dl></div></div><div class="refsect1" lang="en"><a name="id301528"></a><h2>OPERATIONS</h2><p>Once the client is running, the user is presented with
    265265        a prompt : </p><p><code class="prompt">smb:\&gt; </code></p><p>The backslash ("\\") indicates the current working directory
    266266        on the server, and will change if the current working directory
     
    313313                the server to the machine running the client. If specified, name
    314314                the local copy <code class="filename">local file name</code>.  Note that all transfers in
    315                 <span><strong class="command">smbclient</strong></span> are binary. See also the
     315                <code class="literal">smbclient</code> are binary. See also the
    316316                lowercase command. </p></dd><dt><span class="term">help [command]</span></dt><dd><p>See the ? command above. </p></dd><dt><span class="term">lcd [directory name]</span></dt><dd><p>If <em class="replaceable"><code>directory name</code></em> is specified, the current
    317317                working directory on the local machine will be changed to
     
    345345                operation and non-recursive operation - refer to the recurse and
    346346                mask commands for more information. Note that all transfers in
    347                 <span><strong class="command">smbclient</strong></span> are binary. See also the lowercase command. </p></dd><dt><span class="term">mkdir &lt;directory name&gt;</span></dt><dd><p>Create a new directory on the server (user access
     347                <code class="literal">smbclient</code> are binary. See also the lowercase command. </p></dd><dt><span class="term">mkdir &lt;directory name&gt;</span></dt><dd><p>Create a new directory on the server (user access
    348348                privileges permitting) with the specified name. </p></dd><dt><span class="term">mput &lt;mask&gt;</span></dt><dd><p>Copy all files matching <em class="replaceable"><code>mask</code></em> in the current working
    349349                directory on the local machine to the current working directory on
    350350                the server. </p><p>Note that <em class="replaceable"><code>mask</code></em> is interpreted differently during recursive
    351351                operation and non-recursive operation - refer to the recurse and mask
    352                 commands for more information. Note that all transfers in <span><strong class="command">smbclient</strong></span>
     352                commands for more information. Note that all transfers in <code class="literal">smbclient</code>
    353353                are binary. </p></dd><dt><span class="term">print &lt;file name&gt;</span></dt><dd><p>Print the specified file from the local machine
    354354                through a printable service on the server. </p></dd><dt><span class="term">prompt</span></dt><dd><p>Toggle prompting for filenames during operation
     
    359359                machine running the client to the server. If specified,
    360360                name the remote copy <code class="filename">remote file name</code>. Note that all transfers
    361                 in <span><strong class="command">smbclient</strong></span> are binary. See also the lowercase command.
     361                in <code class="literal">smbclient</code> are binary. See also the lowercase command.
    362362                </p></dd><dt><span class="term">queue</span></dt><dd><p>Displays the print queue, showing the job id,
    363363                name, size and current status. </p></dd><dt><span class="term">quit</span></dt><dd><p>See the exit command. </p></dd><dt><span class="term">rd &lt;directory name&gt;</span></dt><dd><p>See the rmdir command. </p></dd><dt><span class="term">recurse</span></dt><dd><p>Toggle directory recursion for the commands mget
     
    373373                working directory on the server. </p></dd><dt><span class="term">rmdir &lt;directory name&gt;</span></dt><dd><p>Remove the specified directory (user access
    374374                privileges permitting) from the server. </p></dd><dt><span class="term">setmode &lt;filename&gt; &lt;perm=[+|\-]rsha&gt;</span></dt><dd><p>A version of the DOS attrib command to set
    375                 file permissions. For example: </p><p><span><strong class="command">setmode myfile +r </strong></span></p><p>would make myfile read only. </p></dd><dt><span class="term">stat file</span></dt><dd><p>This command depends on the server supporting the CIFS
     375                file permissions. For example: </p><p><code class="literal">setmode myfile +r </code></p><p>would make myfile read only. </p></dd><dt><span class="term">stat file</span></dt><dd><p>This command depends on the server supporting the CIFS
    376376                UNIX extensions and will fail if the server does not. The client requests the
    377377                UNIX basic info level and prints out the same info that the Linux stat command
     
    397397                tar will only back up files with the archive bit set. In reset mode,
    398398                tar will reset the archive bit on all files it backs up (implies
    399                 read/write share). </p></dd></dl></div></div><div class="refsect1" lang="en"><a name="id302270"></a><h2>NOTES</h2><p>Some servers are fussy about the case of supplied usernames,
     399                read/write share). </p></dd></dl></div></div><div class="refsect1" lang="en"><a name="id302201"></a><h2>NOTES</h2><p>Some servers are fussy about the case of supplied usernames,
    400400        passwords, share names (AKA service names) and machine names.
    401401        If you fail to connect try giving all parameters in uppercase.
     
    404404        on a valid NetBIOS name being used, so you need to supply a valid
    405405        name that would be known to the server.</p><p>smbclient supports long file names where the server
    406         supports the LANMAN2 protocol or above. </p></div><div class="refsect1" lang="en"><a name="id302291"></a><h2>ENVIRONMENT VARIABLES</h2><p>The variable <code class="envar">USER</code> may contain the
     406        supports the LANMAN2 protocol or above. </p></div><div class="refsect1" lang="en"><a name="id302222"></a><h2>ENVIRONMENT VARIABLES</h2><p>The variable <code class="envar">USER</code> may contain the
    407407        username of the person  using the client. This information is
    408408        used only if the protocol  level is high enough to support
     
    414414        to instead of connecting to a server.  This functionality is primarily
    415415        intended as a development aid, and works best when using a LMHOSTS
    416         file</p></div><div class="refsect1" lang="en"><a name="id302324"></a><h2>INSTALLATION</h2><p>The location of the client program is a matter for
     416        file</p></div><div class="refsect1" lang="en"><a name="id302255"></a><h2>INSTALLATION</h2><p>The location of the client program is a matter for
    417417        individual system administrators. The following are thus
    418418        suggestions only. </p><p>It is recommended that the smbclient software be installed
     
    425425        running SMB/CIFS server. It is possible to run <a href="smbd.8.html"><span class="citerefentry"><span class="refentrytitle">smbd</span>(8)</span></a> as an ordinary user - running that server as a daemon
    426426        on a user-accessible port (typically any port number over 1024)
    427         would provide a suitable test server. </p></div><div class="refsect1" lang="en"><a name="id302373"></a><h2>DIAGNOSTICS</h2><p>Most diagnostics issued by the client are logged in a
     427        would provide a suitable test server. </p></div><div class="refsect1" lang="en"><a name="id302304"></a><h2>DIAGNOSTICS</h2><p>Most diagnostics issued by the client are logged in a
    428428        specified log file. The log file name is specified at compile time,
    429429        but may be overridden on the command line. </p><p>The number and nature of diagnostics available depends
    430430        on the debug level used by the client. If you have problems,
    431         set the debug level to 3 and peruse the log files. </p></div><div class="refsect1" lang="en"><a name="id302389"></a><h2>VERSION</h2><p>This man page is correct for version 3 of the Samba suite.</p></div><div class="refsect1" lang="en"><a name="id302400"></a><h2>AUTHOR</h2><p>The original Samba software and related utilities
     431        set the debug level to 3 and peruse the log files. </p></div><div class="refsect1" lang="en"><a name="id302321"></a><h2>VERSION</h2><p>This man page is correct for version 3 of the Samba suite.</p></div><div class="refsect1" lang="en"><a name="id302331"></a><h2>AUTHOR</h2><p>The original Samba software and related utilities
    432432        were created by Andrew Tridgell. Samba is now developed
    433433        by the Samba Team as an Open Source project similar
Note: See TracChangeset for help on using the changeset viewer.