Changeset 44 for trunk/samba/docs/htmldocs/manpages/smbclient.1.html
- Timestamp:
- Jun 29, 2007, 1:34:14 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/samba/docs/htmldocs/manpages/smbclient.1.html
r39 r44 1 1 <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 — 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 <buffer size>] [-d debuglevel] [-L <netbios name>] [-U username] [-I destinationIP] [-M <netbios name>] [-m maxprotocol] [-A authfile] [-N] [-i scope] [-O <socket options>] [-p port] [-R <name resolve order>] [-s <smb config file>] [-k] [-P] [-c <command>]</p></div><div class="cmdsynopsis"><p><code class="command">smbclient</code> {servicename} [password] [-b <buffer size>] [-d debuglevel] [-D Directory] [-U username] [-W workgroup] [-M <netbios name>] [-m maxprotocol] [-A authfile] [-N] [-l logdir] [-I destinationIP] [-E] [-c <command string>] [-i scope] [-O <socket options>] [-p port] [-R <name resolve order>] [-s <smb config file>] [-T<c|x>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 can2 on servers</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="literal">smbclient</code> [-b <buffer size>] [-d debuglevel] [-L <netbios name>] [-U username] [-I destinationIP] [-M <netbios name>] [-m maxprotocol] [-A authfile] [-N] [-i scope] [-O <socket options>] [-p port] [-R <name resolve order>] [-s <smb config file>] [-k] [-P] [-c <command>]</p></div><div class="cmdsynopsis"><p><code class="literal">smbclient</code> {servicename} [password] [-b <buffer size>] [-d debuglevel] [-D Directory] [-U username] [-W workgroup] [-M <netbios name>] [-m maxprotocol] [-A authfile] [-N] [-l logdir] [-I destinationIP] [-E] [-c <command string>] [-i scope] [-O <socket options>] [-p port] [-R <name resolve order>] [-s <smb config file>] [-T<c|x>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 3 3 'talk' to an SMB/CIFS server. It offers an interface 4 4 similar to that of the ftp program (see <a href="ftp.1.html"><span class="citerefentry"><span class="refentrytitle">ftp</span>(1)</span></a>). … … 19 19 same as the IP hostname of the machine running the server. 20 20 </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> or21 the <em class="parameter"><code>-R</code></em> parameter to <code class="literal">smbclient</code> or 22 22 using the name resolve order parameter in 23 23 the <a href="smb.conf.5.html"><span class="citerefentry"><span class="refentrytitle">smb.conf</span>(5)</span></a> file, … … 74 74 is over 1600 bytes, as this is the limit of the protocol. 75 75 </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: 77 77 </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> 79 79 </pre><p> 80 80 will send the message in the file <code class="filename">mymessage.txt</code> to the machine FRED. … … 103 103 output stream. </p><p>By default, the client writes messages to standard output 104 104 - 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 -L106 host</ strong></span> and a list should appear. The <em class="parameter"><code>-I105 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 107 107 </code></em> option may be useful if your NetBIOS names don't 108 108 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 interpret109 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 110 110 filenames coming from the remote server. Usually Asian language 111 111 multibyte UNIX implementations use different character sets than 112 112 SMB/CIFS servers (<span class="emphasis"><em>EUC</em></span> instead of <span class="emphasis"><em> 113 113 SJIS</em></span> for example). Setting this parameter will let 114 < span><strong class="command">smbclient</strong></span> convert between the UNIX filenames and114 <code class="literal">smbclient</code> convert between the UNIX filenames and 115 115 the SMB filenames correctly. This option has not been seriously tested 116 116 and may have some problems. </p><p>The terminal codes include CWsjis, CWeuc, CWjis7, CWjis8, … … 173 173 <em class="parameter"><code>-A</code></em> for more details. </p><p>Be cautious about including passwords in scripts. Also, on 174 174 many 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 allow176 < span><strong class="command">rpcclient</strong></span> to prompt for a password and type175 via 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 177 177 it in directly. </p></dd><dt><span class="term">-n <primary NetBIOS name></span></dt><dd><p>This option allows you to override 178 178 the NetBIOS name that Samba uses for itself. This is identical … … 181 181 line setting will take precedence over settings in 182 182 <code class="filename">smb.conf</code>.</p></dd><dt><span class="term">-i <scope></span></dt><dd><p>This specifies a NetBIOS scope that 183 < span><strong class="command">nmblookup</strong></span> will use to communicate with when183 <code class="literal">nmblookup</code> will use to communicate with when 184 184 generating NetBIOS names. For details on the use of NetBIOS 185 185 scopes, see rfc1001.txt and rfc1002.txt. NetBIOS scopes are … … 193 193 socket. See the socket options parameter in 194 194 the <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/CIFS195 options. </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 197 197 share. The secondary tar flags that can be given to this option 198 198 are : </p><div class="itemizedlist"><ul type="disc"><li><p><em class="parameter"><code>c</code></em> - Create a tar file on UNIX. … … 240 240 archive bit to be reset when a file is backed up. Useful with the 241 241 <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 long242 </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 243 243 file names both on backup and restore. However, the full path 244 244 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 all245 a tar archive is created, <code class="literal">smbclient</code>'s tar option places all 246 246 files in the archive with relative names, not absolute names. 247 247 </p><p><span class="emphasis"><em>Tar Filenames</em></span></p><p>All file names can be given as DOS path names (with '\\' 248 248 as the component separator) or as UNIX path names (with '/' as 249 249 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.tar251 </ 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.tar253 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 -Tc255 backup.tar users/docs </ strong></span></p><p>Create the same tar file as above, but now use256 a DOS path name. </p><p>< span><strong class="command">smbclient //mypc/myshare "" -N -tc backup.tar257 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 -TcF258 backup.tar tarlist</ strong></span></p><p>Create a tar file of all the files and directories in259 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. Probably250 (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 261 261 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 262 262 commands to be executed instead of prompting from stdin. <em class="parameter"><code> 263 263 -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 with264 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 265 265 a prompt : </p><p><code class="prompt">smb:\> </code></p><p>The backslash ("\\") indicates the current working directory 266 266 on the server, and will change if the current working directory … … 313 313 the server to the machine running the client. If specified, name 314 314 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 the315 <code class="literal">smbclient</code> are binary. See also the 316 316 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 317 317 working directory on the local machine will be changed to … … 345 345 operation and non-recursive operation - refer to the recurse and 346 346 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 <directory name></span></dt><dd><p>Create a new directory on the server (user access347 <code class="literal">smbclient</code> are binary. See also the lowercase command. </p></dd><dt><span class="term">mkdir <directory name></span></dt><dd><p>Create a new directory on the server (user access 348 348 privileges permitting) with the specified name. </p></dd><dt><span class="term">mput <mask></span></dt><dd><p>Copy all files matching <em class="replaceable"><code>mask</code></em> in the current working 349 349 directory on the local machine to the current working directory on 350 350 the server. </p><p>Note that <em class="replaceable"><code>mask</code></em> is interpreted differently during recursive 351 351 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> 353 353 are binary. </p></dd><dt><span class="term">print <file name></span></dt><dd><p>Print the specified file from the local machine 354 354 through a printable service on the server. </p></dd><dt><span class="term">prompt</span></dt><dd><p>Toggle prompting for filenames during operation … … 359 359 machine running the client to the server. If specified, 360 360 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. 362 362 </p></dd><dt><span class="term">queue</span></dt><dd><p>Displays the print queue, showing the job id, 363 363 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 <directory name></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 … … 373 373 working directory on the server. </p></dd><dt><span class="term">rmdir <directory name></span></dt><dd><p>Remove the specified directory (user access 374 374 privileges permitting) from the server. </p></dd><dt><span class="term">setmode <filename> <perm=[+|\-]rsha></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 CIFS375 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 376 376 UNIX extensions and will fail if the server does not. The client requests the 377 377 UNIX basic info level and prints out the same info that the Linux stat command … … 397 397 tar will only back up files with the archive bit set. In reset mode, 398 398 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="id3022 70"></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, 400 400 passwords, share names (AKA service names) and machine names. 401 401 If you fail to connect try giving all parameters in uppercase. … … 404 404 on a valid NetBIOS name being used, so you need to supply a valid 405 405 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="id3022 91"></a><h2>ENVIRONMENT VARIABLES</h2><p>The variable <code class="envar">USER</code> may contain the406 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 407 407 username of the person using the client. This information is 408 408 used only if the protocol level is high enough to support … … 414 414 to instead of connecting to a server. This functionality is primarily 415 415 intended as a development aid, and works best when using a LMHOSTS 416 file</p></div><div class="refsect1" lang="en"><a name="id302 324"></a><h2>INSTALLATION</h2><p>The location of the client program is a matter for416 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 417 417 individual system administrators. The following are thus 418 418 suggestions only. </p><p>It is recommended that the smbclient software be installed … … 425 425 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 426 426 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="id3023 73"></a><h2>DIAGNOSTICS</h2><p>Most diagnostics issued by the client are logged in a427 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 428 428 specified log file. The log file name is specified at compile time, 429 429 but may be overridden on the command line. </p><p>The number and nature of diagnostics available depends 430 430 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="id3023 89"></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 utilities431 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 432 432 were created by Andrew Tridgell. Samba is now developed 433 433 by the Samba Team as an Open Source project similar
Note:
See TracChangeset
for help on using the changeset viewer.