Changeset 988 for vendor/current/docs-xml/manpages/smbclient.1.xml
- Timestamp:
- Nov 24, 2016, 1:14:11 PM (9 years ago)
- Location:
- vendor/current/docs-xml/manpages
- Files:
-
- 1 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/docs-xml/manpages/smbclient.1.xml
r860 r988 8 8 <refmiscinfo class="source">Samba</refmiscinfo> 9 9 <refmiscinfo class="manual">User Commands</refmiscinfo> 10 <refmiscinfo class="version"> 3.6</refmiscinfo>10 <refmiscinfo class="version">4.4</refmiscinfo> 11 11 </refmeta> 12 12 … … 38 38 <arg choice="opt">-R <name resolve order></arg> 39 39 <arg choice="opt">-s <smb config file></arg> 40 <arg choice="opt">-t <per-operation timeout in seconds></arg> 40 41 <arg choice="opt">-k</arg> 41 42 <arg choice="opt">-P</arg> … … 68 69 <arg choice="opt">-R <name resolve order></arg> 69 70 <arg choice="opt">-s <smb config file></arg> 71 <arg choice="opt">-t <per-operation timeout in seconds></arg> 70 72 <arg choice="opt">-T<c|x>IXFqgbNan</arg> 71 73 <arg choice="opt">-k</arg> … … 79 81 <manvolnum>7</manvolnum></citerefentry> suite.</para> 80 82 81 <para><command>smbclient</command> is a client that can 83 <para><command>smbclient</command> is a client that can 82 84 'talk' to an SMB/CIFS server. It offers an interface 83 85 similar to that of the ftp program (see <citerefentry><refentrytitle>ftp</refentrytitle> 84 <manvolnum>1</manvolnum></citerefentry>). 85 Operations include things like getting files from the server 86 to the local machine, putting files from the local machine to 87 the server, retrieving directory information from the server 86 <manvolnum>1</manvolnum></citerefentry>). 87 Operations include things like getting files from the server 88 to the local machine, putting files from the local machine to 89 the server, retrieving directory information from the server 88 90 and so on. </para> 89 91 </refsect1> … … 92 94 <refsect1> 93 95 <title>OPTIONS</title> 94 96 95 97 <variablelist> 96 98 <varlistentry> 97 99 <term>servicename</term> 98 <listitem><para>servicename is the name of the service 100 <listitem><para>servicename is the name of the service 99 101 you want to use on the server. A service name takes the form 100 102 <filename>//server/service</filename> where <parameter>server 101 </parameter> is the NetBIOS name of the SMB/CIFS server 102 offering the desired service and <parameter>service</parameter> 103 is the name of the service offered. Thus to connect to103 </parameter> is the NetBIOS name of the SMB/CIFS server 104 offering the desired service and <parameter>service</parameter> 105 is the name of the service offered. Thus to connect to 104 106 the service "printer" on the SMB/CIFS server "smbserver", 105 107 you would use the servicename <filename>//smbserver/printer 106 108 </filename></para> 107 109 108 <para>Note that the server name required is NOT necessarily 109 the IP (DNS) host name of the server ! The name required is110 <para>Note that the server name required is NOT necessarily 111 the IP (DNS) host name of the server ! The name required is 110 112 a NetBIOS server name, which may or may not be the 111 113 same as the IP hostname of the machine running the server. 112 114 </para> 113 115 114 <para>The server name is looked up according to either 115 the <parameter>-R</parameter> parameter to <command>smbclient</command> or 116 using the name resolve order parameter in 116 <para>The server name is looked up according to either 117 the <parameter>-R</parameter> parameter to <command>smbclient</command> or 118 using the name resolve order parameter in 117 119 the <citerefentry><refentrytitle>smb.conf</refentrytitle> 118 <manvolnum>5</manvolnum></citerefentry> file, 119 allowing an administrator to change the order and methods 120 <manvolnum>5</manvolnum></citerefentry> file, 121 allowing an administrator to change the order and methods 120 122 by which server names are looked up. </para></listitem> 121 123 </varlistentry> … … 123 125 <varlistentry> 124 126 <term>password</term> 125 <listitem><para>The password required to access the specified 126 service on the specified server. If this parameter is 127 supplied, the <parameter>-N</parameter> option (suppress 127 <listitem><para>The password required to access the specified 128 service on the specified server. If this parameter is 129 supplied, the <parameter>-N</parameter> option (suppress 128 130 password prompt) is assumed. </para> 129 131 130 <para>There is no default password. If no password is supplied 131 on the command line (either by using this parameter or adding 132 a password to the <parameter>-U</parameter> option (see 133 below)) and the <parameter>-N</parameter> option is not 134 specified, the client will prompt for a password, even if 135 the desired service does not require one. (If no password is 132 <para>There is no default password. If no password is supplied 133 on the command line (either by using this parameter or adding 134 a password to the <parameter>-U</parameter> option (see 135 below)) and the <parameter>-N</parameter> option is not 136 specified, the client will prompt for a password, even if 137 the desired service does not require one. (If no password is 136 138 required, simply press ENTER to provide a null password.) 137 139 </para> 138 140 139 <para>Note: Some servers (including OS/2 and Windows for 140 Workgroups) insist on an uppercase password. Lowercase 141 or mixed case passwords may be rejected by these servers. 141 <para>Note: Some servers (including OS/2 and Windows for 142 Workgroups) insist on an uppercase password. Lowercase 143 or mixed case passwords may be rejected by these servers. 142 144 </para> 143 145 … … 145 147 </para></listitem> 146 148 </varlistentry> 147 149 148 150 <varlistentry> 149 151 <term>-R|--name-resolve <name resolve order></term> 150 <listitem><para>This option is used by the programs in the Samba 151 suite to determine what naming services and in what order to resolve 152 host names to IP addresses. The option takes a space-separated 152 <listitem><para>This option is used by the programs in the Samba 153 suite to determine what naming services and in what order to resolve 154 host names to IP addresses. The option takes a space-separated 153 155 string of different name resolution options.</para> 154 156 155 <para>The options are :"lmhosts", "host", "wins" and "bcast". They 157 <para>The options are :"lmhosts", "host", "wins" and "bcast". They 156 158 cause names to be resolved as follows:</para> 157 159 158 160 <itemizedlist> 159 <listitem><para><constant>lmhosts</constant>: Lookup an IP 160 address in the Samba lmhosts file. If the line in lmhosts has 161 no name type attached to the NetBIOS name (see 161 <listitem><para><constant>lmhosts</constant>: Lookup an IP 162 address in the Samba lmhosts file. If the line in lmhosts has 163 no name type attached to the NetBIOS name (see 162 164 the <citerefentry><refentrytitle>lmhosts</refentrytitle> 163 165 <manvolnum>5</manvolnum></citerefentry> for details) then 164 166 any name type matches for lookup.</para> 165 167 </listitem> 166 167 <listitem><para><constant>host</constant>: Do a standard host 168 169 <listitem><para><constant>host</constant>: Do a standard host 168 170 name to IP address resolution, using the system <filename>/etc/hosts 169 </filename>, NIS, or DNS lookups. This method of name resolution 170 is operating system dependent, for instance on IRIX or Solaris this 171 may be controlled by the <filename>/etc/nsswitch.conf</filename> 172 file). Note that this method is only used if the NetBIOS name173 type being queried is the 0x20 (server) name type, otherwise 171 </filename>, NIS, or DNS lookups. This method of name resolution 172 is operating system dependent, for instance on IRIX or Solaris this 173 may be controlled by the <filename>/etc/nsswitch.conf</filename> 174 file). Note that this method is only used if the NetBIOS name 175 type being queried is the 0x20 (server) name type, otherwise 174 176 it is ignored.</para> 175 177 </listitem> 176 177 <listitem><para><constant>wins</constant>: Query a name with 178 179 <listitem><para><constant>wins</constant>: Query a name with 178 180 the IP address listed in the <parameter>wins server</parameter> 179 parameter. 181 parameter. If no WINS server has 180 182 been specified this method will be ignored.</para> 181 183 </listitem> 182 183 <listitem><para><constant>bcast</constant>: Do a broadcast on 184 each of the known local interfaces listed in the 184 185 <listitem><para><constant>bcast</constant>: Do a broadcast on 186 each of the known local interfaces listed in the 185 187 <parameter>interfaces</parameter> 186 parameter. This is the least reliable of the name resolution 187 methods as it depends on the target host being on a locally 188 parameter. This is the least reliable of the name resolution 189 methods as it depends on the target host being on a locally 188 190 connected subnet.</para> 189 191 </listitem> 190 192 </itemizedlist> 191 193 192 <para>If this parameter is not set then the name resolve order 194 <para>If this parameter is not set then the name resolve order 193 195 defined in the <citerefentry><refentrytitle>smb.conf</refentrytitle> 194 <manvolnum>5</manvolnum></citerefentry> file parameter 196 <manvolnum>5</manvolnum></citerefentry> file parameter 195 197 (name resolve order) will be used. </para> 196 198 197 <para>The default order is lmhosts, host, wins, bcast and without 199 <para>The default order is lmhosts, host, wins, bcast and without 198 200 this parameter or any entry in the <parameter>name resolve order 199 201 </parameter> parameter of the <citerefentry><refentrytitle>smb.conf</refentrytitle> … … 201 203 methods will be attempted in this order. </para></listitem> 202 204 </varlistentry> 203 204 205 206 205 207 <varlistentry> 206 208 <term>-M|--message NetBIOS name</term> 207 <listitem><para>This options allows you to send messages, using 208 the "WinPopup" protocol, to another computer. Once a connection is 209 established you then type your message, pressing ^D (control-D) to 209 <listitem><para>This options allows you to send messages, using 210 the "WinPopup" protocol, to another computer. Once a connection is 211 established you then type your message, pressing ^D (control-D) to 210 212 end. </para> 211 213 212 <para>If the receiving computer is running WinPopup the user will 213 receive the message and probably a beep. If they are not running 214 WinPopup the message will be lost, and no error message will 214 <para>If the receiving computer is running WinPopup the user will 215 receive the message and probably a beep. If they are not running 216 WinPopup the message will be lost, and no error message will 215 217 occur. </para> 216 218 217 <para>The message is also automatically truncated if the message 218 is over 1600 bytes, as this is the limit of the protocol. 219 <para>The message is also automatically truncated if the message 220 is over 1600 bytes, as this is the limit of the protocol. 219 221 </para> 220 222 221 223 <para> 222 One useful trick is to pipe the message through <command>smbclient</command>. 223 For example: smbclient -M FRED < mymessage.txt will send the 224 message in the file <filename>mymessage.txt</filename> to the 224 One useful trick is to pipe the message through <command>smbclient</command>. 225 For example: smbclient -M FRED < mymessage.txt will send the 226 message in the file <filename>mymessage.txt</filename> to the 225 227 machine FRED. 226 228 </para> 227 229 228 <para>You may also find the <parameter>-U</parameter> and 229 <parameter>-I</parameter> options useful, as they allow you to 230 <para>You may also find the <parameter>-U</parameter> and 231 <parameter>-I</parameter> options useful, as they allow you to 230 232 control the FROM and TO parts of the message. </para> 231 233 232 234 <para>See the <parameter>message command</parameter> parameter in the <citerefentry><refentrytitle>smb.conf</refentrytitle> 233 <manvolnum>5</manvolnum></citerefentry> for a description of how to handle incoming 235 <manvolnum>5</manvolnum></citerefentry> for a description of how to handle incoming 234 236 WinPopup messages in Samba. </para> 235 237 236 <para><emphasis>Note</emphasis>: Copy WinPopup into the startup group 237 on your WfWg PCs if you want them to always be able to receive 238 <para><emphasis>Note</emphasis>: Copy WinPopup into the startup group 239 on your WfWg PCs if you want them to always be able to receive 238 240 messages. </para></listitem> 239 241 </varlistentry> … … 241 243 <varlistentry> 242 244 <term>-p|--port port</term> 243 <listitem><para>This number is the TCP port number that will be used 245 <listitem><para>This number is the TCP port number that will be used 244 246 when making connections to the server. The standard (well-known) 245 TCP port number for an SMB/CIFS server is 139, which is the 247 TCP port number for an SMB/CIFS server is 139, which is the 246 248 default. </para></listitem> 247 249 </varlistentry> … … 257 259 <varlistentry> 258 260 <term>-m|--max-protocol protocol</term> 259 <listitem><para>This parameter sets the maximum protocol version announced by the client. 261 <listitem><para>This allows the user to select the 262 highest SMB protocol level that smbclient will use to 263 connect to the server. By default this is set to 264 NT1, which is the highest available SMB1 protocol. 265 To connect using SMB2 or SMB3 protocol, use the 266 strings SMB2 or SMB3 respectively. Note that to connect 267 to a Windows 2012 server with encrypted transport selecting 268 a max-protocol of SMB3 is required. 260 269 </para></listitem> 261 270 </varlistentry> … … 268 277 </varlistentry> 269 278 270 &stdarg.help;271 272 279 <varlistentry> 273 280 <term>-I|--ip-address IP-address</term> … … 275 282 It should be specified in standard "a.b.c.d" notation. </para> 276 283 277 <para>Normally the client would attempt to locate a named 278 SMB/CIFS server by looking it up via the NetBIOS name resolution 279 mechanism described above in the <parameter>name resolve order</parameter> 284 <para>Normally the client would attempt to locate a named 285 SMB/CIFS server by looking it up via the NetBIOS name resolution 286 mechanism described above in the <parameter>name resolve order</parameter> 280 287 parameter above. Using this parameter will force the client 281 to assume that the server is on the machine with the specified IP 282 address and the NetBIOS name component of the resource being 288 to assume that the server is on the machine with the specified IP 289 address and the NetBIOS name component of the resource being 283 290 connected to will be ignored. </para> 284 291 285 <para>There is no default for this parameter. If not supplied, 286 it will be determined automatically by the client as described 292 <para>There is no default for this parameter. If not supplied, 293 it will be determined automatically by the client as described 287 294 above. </para></listitem> 288 295 </varlistentry> 289 296 290 297 <varlistentry> 291 298 <term>-E|--stderr</term> 292 <listitem><para>This parameter causes the client to write messages 293 to the standard error stream (stderr) rather than to the standard 299 <listitem><para>This parameter causes the client to write messages 300 to the standard error stream (stderr) rather than to the standard 294 301 output stream. </para> 295 296 <para>By default, the client writes messages to standard output 302 303 <para>By default, the client writes messages to standard output 297 304 - typically the user's tty. </para></listitem> 298 305 </varlistentry> 299 306 300 307 <varlistentry> 301 308 <term>-L|--list</term> 302 <listitem><para>This option allows you to look at what services 303 are available on a server. You use it as <command>smbclient -L 309 <listitem><para>This option allows you to look at what services 310 are available on a server. You use it as <command>smbclient -L 304 311 host</command> and a list should appear. The <parameter>-I 305 </parameter> option may be useful if your NetBIOS names don't 306 match your TCP/IP DNS host names or if you are trying to reach a 312 </parameter> option may be useful if your NetBIOS names don't 313 match your TCP/IP DNS host names or if you are trying to reach a 307 314 host on another network. </para></listitem> 308 315 </varlistentry> 309 310 <varlistentry> 316 317 <varlistentry> 311 318 <term>-b|--send-buffer buffersize</term> 312 <listitem><para> This option changes the transmit/send buffer313 size when getting or putting a file from/to the server. The default314 i s 65520 bytes. Setting this value smaller (to 1200 bytes) has been315 observed to speed up file transfers to and from a Win9x server.316 </para></listitem>317 </varlistentry>318 319 <varlistentry>320 <term>-e|--encrypt</term>321 <listitem><para>This command line parameter requires the remote322 server support the UNIX extensions. Request that the connection be323 encrypted. This is new for Samba 3.2 and will only work with Samba324 3.2 or above servers. Negotiates SMB encryption using GSSAPI. Uses 325 the given credentials for the encryption negotiation (either kerberos326 or NTLMv1/v2 if given domain/username/password triple. Fails the327 connection if encryption cannot be negotiated.328 </ para></listitem>329 </varlistentry> 330 319 <listitem><para> 320 When sending or receiving files, smbclient uses an 321 internal buffer sized by the maximum number of allowed requests 322 to the connected server. This command allows this size to be set to any 323 range between 0 (which means use the default server controlled size) bytes 324 and 16776960 (0xFFFF00) bytes. Using the server controlled size is the 325 most efficient as smbclient will pipeline as many simultaneous reads or 326 writes needed to keep the server as busy as possible. Setting this to 327 any other size will slow down the transfer. This can also be set 328 using the <command>iosize</command> command inside smbclient. 329 </para></listitem> 330 </varlistentry> 331 332 <varlistentry> 333 <term>-B|--browse</term> 334 <listitem><para>Browse SMB servers using DNS.</para> 335 </listitem> 336 </varlistentry> 337 331 338 &stdarg.client.debug; 332 339 &popt.common.samba; 333 340 &popt.common.credentials; 334 341 &popt.common.connection; 335 342 &popt.autohelp; 343 344 <varlistentry> 345 <term>-t|--timeout <timeout-seconds></term> 346 <listitem><para>This allows the user to tune the default 347 timeout used for each SMB request. The default setting is 348 20 seconds. Increase it if requests to the server sometimes 349 time out. This can happen when SMB3 encryption is selected 350 and smbclient is overwhelming the server with requests. 351 This can also be set using the <command>timeout</command> 352 command inside smbclient. 353 </para></listitem> 354 </varlistentry> 355 336 356 <varlistentry> 337 357 <term>-T|--tar tar options</term> 338 358 <listitem><para>smbclient may be used to create <command>tar(1) 339 359 </command> compatible backups of all the files on an SMB/CIFS 340 share. The secondary tar flags that can be given to this option 341 are :</para>342 360 share. The secondary tar flags that can be given to this option 361 are:</para> 362 343 363 <itemizedlist> 344 <listitem><para><parameter>c</parameter> - Create a tar file on UNIX. 345 Must be followed by the name of a tar file, tape device 346 or "-" for standard output. If using standard output you must 347 turn the log level to its lowest value -d0 to avoid corrupting 348 your tar file. This flag is mutually exclusive with the 364 <listitem><para><parameter>c</parameter> - Create a tar 365 backup archive on the local system. Must be followed by 366 the name of a tar file, tape device or "-" for standard 367 output. If using standard output you must turn the log 368 level to its lowest value -d0 to avoid corrupting your tar 369 file. This flag is mutually exclusive with the 349 370 <parameter>x</parameter> flag. </para></listitem> 350 351 <listitem><para><parameter>x</parameter> - Extract (restore) a local 352 tar file back to a share. Unless the -D option is given, the tar 353 files will be restored from the top level of the share. Must be 354 followed by the name of the tar file, device or "-" for standard 355 input. Mutually exclusive with the <parameter>c</parameter> flag. 371 372 <listitem><para><parameter>x</parameter> - Extract (restore) a local 373 tar file back to a share. Unless the -D option is given, the tar 374 files will be restored from the top level of the share. Must be 375 followed by the name of the tar file, device or "-" for standard 376 input. Mutually exclusive with the <parameter>c</parameter> flag. 356 377 Restored files have their creation times (mtime) set to the 357 date saved in the tar file. Directories currently do not get 378 date saved in the tar file. Directories currently do not get 358 379 their creation dates restored properly. </para></listitem> 359 360 <listitem><para><parameter>I</parameter> - Include files and directories. 361 Is the default behavior when filenames are specified above. Causes 362 files to be included in an extract or create (and therefore 363 everything else to be excluded). See example below. Filename globbing364 works in one of two ways. 365 366 <listitem><para><parameter>X</parameter> - Exclude files and directories. 367 Causes files to be excluded from an extract or create. See 368 example below. Filename globbing works in one of two ways now.380 381 <listitem><para><parameter>I</parameter> - Include files and directories. 382 Is the default behavior when filenames are specified above. Causes 383 files to be included in an extract or create (and therefore 384 everything else to be excluded). See example below. Filename globbing 385 works in one of two ways. See <parameter>r</parameter> below. </para></listitem> 386 387 <listitem><para><parameter>X</parameter> - Exclude files and directories. 388 Causes files to be excluded from an extract or create. See 389 example below. Filename globbing works in one of two ways. 369 390 See <parameter>r</parameter> below. </para></listitem> 370 391 371 392 <listitem><para><parameter>F</parameter> - File containing a list of files and directories. 372 393 The <parameter>F</parameter> causes the name following the tarfile to 373 create to be read as a filename that contains a list of files and directories to 394 create to be read as a filename that contains a list of files and directories to 374 395 be included in an extract or create (and therefore everything else to be excluded). 375 396 See example below. Filename globbing works in one of two ways. 376 397 See <parameter>r</parameter> below. 377 398 </para></listitem> 378 379 <listitem><para><parameter>b</parameter> - Blocksize. Must be followed 380 by a valid (greater than zero) blocksize. Causes tar file to be 381 written out in blocksize*TBLOCK ( usually 512 byte) blocks.399 400 <listitem><para><parameter>b</parameter> - Blocksize. Must be followed 401 by a valid (greater than zero) blocksize. Causes tar file to be 402 written out in blocksize*TBLOCK (512 byte) blocks. 382 403 </para></listitem> 383 384 <listitem><para><parameter>g</parameter> - Incremental. Only back up 385 files that have the archive bit set. Useful only with the 404 405 <listitem><para><parameter>g</parameter> - Incremental. Only back up 406 files that have the archive bit set. Useful only with the 386 407 <parameter>c</parameter> flag. </para></listitem> 387 408 388 <listitem><para><parameter>q</parameter> - Quiet. Keeps tar from printing 389 diagnostics as it works. This is the same as tarmode quiet. 409 <listitem><para><parameter>q</parameter> - Quiet. Keeps tar from printing 410 diagnostics as it works. This is the same as tarmode quiet. 390 411 </para></listitem> 391 392 <listitem><para><parameter>r</parameter> - Regular expression include 393 or exclude. Uses regular expression matching for 394 excluding or excluding files if compiled with HAVE_REGEX_H. 395 However this mode can be very slow. If not compiled with 396 HAVE_REGEX_H, does a limited wildcard match on '*' and '?'. 412 413 <listitem><para><parameter>r</parameter> - Use wildcard 414 matching to include or exclude. Deprecated. 397 415 </para></listitem> 398 399 <listitem><para><parameter>N</parameter> - Newer than. Must be followed 400 by the name of a file whose date is compared against files found 401 on the share during a create. Only files newer than the file 402 specified are backed up to the tar file. Useful only with the 416 417 <listitem><para><parameter>N</parameter> - Newer than. Must be followed 418 by the name of a file whose date is compared against files found 419 on the share during a create. Only files newer than the file 420 specified are backed up to the tar file. Useful only with the 403 421 <parameter>c</parameter> flag. </para></listitem> 404 405 <listitem><para><parameter>a</parameter> - Set archive bit. Causes the 406 archive bit to be reset when a file is backed up. Useful with the 407 <parameter>g</parameter> and <parameter>c</parameter> flags. 422 423 <listitem><para><parameter>a</parameter> - Set archive bit. Causes the 424 archive bit to be reset when a file is backed up. Useful with the 425 <parameter>g</parameter> and <parameter>c</parameter> flags. 408 426 </para></listitem> 409 427 </itemizedlist> 410 428 411 429 <para><emphasis>Tar Long File Names</emphasis></para> 412 413 <para><command>smbclient</command>'s tar option now supports long 414 file names both on backup and restore. However, the full path 415 name of the file must be less than 1024 bytes. 416 a tar archive is created, <command>smbclient</command>'s tar option places all 417 files in the archive with relative names, not absolute names. 430 431 <para><command>smbclient</command>'s tar option now supports long 432 file names both on backup and restore. However, the full path 433 name of the file must be less than 1024 bytes. Also, when 434 a tar archive is created, <command>smbclient</command>'s tar option places all 435 files in the archive with relative names, not absolute names. 418 436 </para> 419 437 420 438 <para><emphasis>Tar Filenames</emphasis></para> 421 422 <para>All file names can be given as DOS path names (with '\\' 423 as the component separator) or as UNIX path names (with '/' as 439 440 <para>All file names can be given as DOS path names (with '\\' 441 as the component separator) or as UNIX path names (with '/' as 424 442 the component separator). </para> 425 443 426 444 <para><emphasis>Examples</emphasis></para> 427 428 <para>Restore from tar file <filename>backup.tar</filename> into myshare on mypc 445 446 <para>Restore from tar file <filename>backup.tar</filename> into myshare on mypc 429 447 (no password on share). </para> 430 448 431 449 <para><command>smbclient //mypc/myshare "" -N -Tx backup.tar 432 450 </command></para> 433 451 434 452 <para>Restore everything except <filename>users/docs</filename> 435 453 </para> 436 437 <para><command>smbclient //mypc/myshare "" -N -TXx backup.tar 454 455 <para><command>smbclient //mypc/myshare "" -N -TXx backup.tar 438 456 users/docs</command></para> 439 457 440 458 <para>Create a tar file of the files beneath <filename> 441 459 users/docs</filename>. </para> 442 460 443 461 <para><command>smbclient //mypc/myshare "" -N -Tc 444 462 backup.tar users/docs </command></para> 445 446 <para>Create the same tar file as above, but now use 463 464 <para>Create the same tar file as above, but now use 447 465 a DOS path name. </para> 448 449 <para><command>smbclient //mypc/myshare "" -N - tc backup.tar466 467 <para><command>smbclient //mypc/myshare "" -N -Tc backup.tar 450 468 users\edocs </command></para> 451 469 452 470 <para>Create a tar file of the files listed in the file <filename>tarlist</filename>.</para> 453 471 454 472 <para><command>smbclient //mypc/myshare "" -N -TcF 455 473 backup.tar tarlist</command></para> 456 457 <para>Create a tar file of all the files and directories in 474 475 <para>Create a tar file of all the files and directories in 458 476 the share. </para> 459 477 460 478 <para><command>smbclient //mypc/myshare "" -N -Tc backup.tar * 461 479 </command></para> 462 480 </listitem> 463 481 </varlistentry> 464 482 465 483 <varlistentry> 466 484 <term>-D|--directory initial directory</term> 467 <listitem><para>Change to initial directory before starting. Probably 485 <listitem><para>Change to initial directory before starting. Probably 468 486 only of any use with the tar -T option. </para></listitem> 469 487 </varlistentry> 470 488 471 489 <varlistentry> 472 490 <term>-c|--command command string</term> 473 <listitem><para>command string is a semicolon-separated list of 491 <listitem><para>command string is a semicolon-separated list of 474 492 commands to be executed instead of prompting from stdin. <parameter> 475 493 -N</parameter> is implied by <parameter>-c</parameter>.</para> 476 494 477 <para>This is particularly useful in scripts and for printing stdin 495 <para>This is particularly useful in scripts and for printing stdin 478 496 to the server, e.g. <command>-c 'print -'</command>. </para></listitem> 479 497 </varlistentry> … … 486 504 <title>OPERATIONS</title> 487 505 488 <para>Once the client is running, the user is presented with 506 <para>Once the client is running, the user is presented with 489 507 a prompt : </para> 490 508 491 509 <para><prompt>smb:\> </prompt></para> 492 510 493 <para>The backslash ("\\") indicates the current working directory 494 on the server, and will change if the current working directory 511 <para>The backslash ("\\") indicates the current working directory 512 on the server, and will change if the current working directory 495 513 is changed. </para> 496 514 497 <para>The prompt indicates that the client is ready and waiting to 498 carry out a user command. Each command is a single word, optionally 499 followed by parameters specific to that command. Command and parameters 515 <para>The prompt indicates that the client is ready and waiting to 516 carry out a user command. Each command is a single word, optionally 517 followed by parameters specific to that command. Command and parameters 500 518 are space-delimited unless these notes specifically 501 state otherwise. All commands are case-insensitive. Parameters to502 commands may or may not be case sensitive, depending on the command. 519 state otherwise. All commands are case-insensitive. Parameters to 520 commands may or may not be case sensitive, depending on the command. 503 521 </para> 504 522 505 <para>You can specify file names which have spaces in them by quoting 523 <para>You can specify file names which have spaces in them by quoting 506 524 the name with double quotes, for example "a long file name". </para> 507 525 508 <para>Parameters shown in square brackets (e.g., "[parameter]") are 509 optional. If not given, the command will use suitable defaults. Parameters 526 <para>Parameters shown in square brackets (e.g., "[parameter]") are 527 optional. If not given, the command will use suitable defaults. Parameters 510 528 shown in angle brackets (e.g., "<parameter>") are required. 511 529 </para> 512 530 513 531 514 <para>Note that all commands operating on the server are actually 515 performed by issuing a request to the server. Thus the behavior may 516 vary from server to server, depending on how the server was implemented. 532 <para>Note that all commands operating on the server are actually 533 performed by issuing a request to the server. Thus the behavior may 534 vary from server to server, depending on how the server was implemented. 517 535 </para> 518 536 … … 556 574 2 means only operate on files with this bit set and reset it after operation, 557 575 3 means operate on all files and reset it after operation. The default is 0. 576 </para></listitem> 577 </varlistentry> 578 579 <varlistentry> 580 <term>backup</term> 581 <listitem><para>Toggle the state of the "backup intent" flag 582 sent to the server on directory listings and file opens. If 583 the "backup intent" flag is true, the server will try and 584 bypass some file system checks if the user has been granted 585 SE_BACKUP or SE_RESTORE privileges. This state is useful when 586 performing a backup or restore operation. 558 587 </para></listitem> 559 588 </varlistentry> … … 684 713 <varlistentry> 685 714 <term>iosize <bytes></term> 686 <listitem><para>When sending or receiving files, smbclient uses an 687 internal memory buffer by default of size 64512 bytes. This command 688 allows this size to be set to any range between 16384 (0x4000) bytes 689 and 16776960 (0xFFFF00) bytes. Larger sizes may mean more efficient 690 data transfer as smbclient will try and use the most efficient 691 read and write calls for the connected server. 715 <listitem><para> 716 When sending or receiving files, smbclient uses an 717 internal buffer sized by the maximum number of allowed requests 718 to the connected server. This command allows this size to be set to any 719 range between 0 (which means use the default server controlled size) bytes 720 and 16776960 (0xFFFF00) bytes. Using the server controlled size is the 721 most efficient as smbclient will pipeline as many simultaneous reads or 722 writes needed to keep the server as busy as possible. Setting this to 723 any other size will slow down the transfer. 692 724 </para></listitem> 693 725 </varlistentry> … … 736 768 737 769 <varlistentry> 770 <term>logoff</term> 771 <listitem><para>Logs the user off the server, closing the session. 772 Used for internal Samba testing purposes. 773 </para></listitem> 774 </varlistentry> 775 776 <varlistentry> 738 777 <term>lowercase</term> 739 778 <listitem><para>Toggle lowercasing of filenames for the get and 740 mget commands. 741 </para> 779 mget commands. 780 </para> 742 781 743 782 <para>When lowercasing is toggled ON, local filenames are converted … … 816 855 commands for more information. Note that all transfers in <command>smbclient</command> 817 856 are binary. </para></listitem> 857 </varlistentry> 858 859 <varlistentry> 860 <term>notify <dir name></term> 861 <listitem><para>Query a directory for change 862 notifications. This command issues a recursive 863 filechangenotify call for all possible changes. As 864 changes come in will print one line per change. See 865 <ulink url="https://msdn.microsoft.com/en-us/library/dn392331.aspx">https://msdn.microsoft.com/en-us/library/dn392331.aspx</ulink> 866 for a description of the action numbers that this 867 command prints.</para> 868 <para>This command never ends, it waits for event 869 indefinitely. 870 </para></listitem> 818 871 </varlistentry> 819 872 … … 954 1007 <varlistentry> 955 1008 <term>rmdir <directory name></term> 956 1009 <listitem><para>Remove the specified directory (user access 957 1010 privileges permitting) from the server. </para></listitem> 1011 </varlistentry> 1012 1013 <varlistentry> 1014 <term>scopy <source filename> <destination filename></term> 1015 <listitem><para>Attempt to copy a file on the server using the 1016 most efficient server-side copy calls. Falls back to using 1017 read then write if server doesn't support server-side copy. 1018 </para></listitem> 958 1019 </varlistentry> 959 1020 … … 998 1059 <varlistentry> 999 1060 <term>tar <c|x>[IXbgNa]</term> 1000 <listitem><para>Performs a tar operation - see the <parameter>-T1001 < /parameter> command line option above. Behavior may be affected1002 by the tarmode command (see below). Using g (incremental) and N1003 ( newer) will affect tarmode settings. Note that using the "-" option1004 with tar x may not work - use the command line option instead.1005 </para></listitem>1061 <listitem><para>Performs a tar operation - see the 1062 <parameter>-T</parameter> command line option above. Behavior 1063 may be affected by the tarmode command (see below). Using g 1064 (incremental) and N (newer) will affect tarmode settings. Note 1065 that using the "-" option with tar x may not work - use the 1066 command line option instead.</para></listitem> 1006 1067 </varlistentry> 1007 1068 … … 1010 1071 <listitem><para>Blocksize. Must be followed by a valid (greater 1011 1072 than zero) blocksize. Causes tar file to be written out in 1012 <replaceable>blocksize</replaceable>*TBLOCK (usually 512 byte) blocks. </para></listitem> 1013 </varlistentry> 1014 1015 <varlistentry> 1016 <term>tarmode <full|inc|reset|noreset></term> 1017 <listitem><para>Changes tar's behavior with regard to archive 1018 bits. In full mode, tar will back up everything regardless of the 1019 archive bit setting (this is the default mode). In incremental mode, 1020 tar will only back up files with the archive bit set. In reset mode, 1021 tar will reset the archive bit on all files it backs up (implies 1022 read/write share). </para></listitem> 1073 <replaceable>blocksize</replaceable>*TBLOCK (512 byte) blocks. </para></listitem> 1074 </varlistentry> 1075 1076 <varlistentry> 1077 <term>tarmode <full|inc|reset|noreset|system|nosystem|hidden|nohidden></term> 1078 <listitem><para>Changes tar's behavior with regard to DOS 1079 attributes. There are 4 modes which can be turned on or 1080 off.</para> 1081 1082 <para>Incremental mode (default off). When off (using 1083 <command>full</command>) tar will back up everything 1084 regardless of the <emphasis>archive</emphasis> bit 1085 setting. When on (using <command>inc</command>), tar will only 1086 back up files with the archive bit set.</para> 1087 1088 <para>Reset mode (default off). When on (using 1089 <command>reset</command>), tar will remove the archive bit on 1090 all files it backs up (implies read/write share). Use 1091 <command>noreset</command> to turn off.</para> 1092 1093 <para>System mode (default on). When off, tar will not backup 1094 system files. Use <command>nosystem</command> to turn off.</para> 1095 1096 <para>Hidden mode (default on). When off, tar will not backup 1097 hidden files. Use <command>nohidden</command> to turn off.</para> 1098 </listitem> 1099 </varlistentry> 1100 1101 <varlistentry> 1102 <term>timeout <per-operation timeout in seconds></term> 1103 <listitem><para>This allows the user to tune the default 1104 timeout used for each SMB request. The default setting is 1105 20 seconds. Increase it if requests to the server sometimes 1106 time out. This can happen when SMB3 encryption is selected 1107 and smbclient is overwhelming the server with requests. 1108 </para></listitem> 1023 1109 </varlistentry> 1024 1110 … … 1045 1131 </varlistentry> 1046 1132 1133 <varlistentry> 1134 <term>tcon <sharename></term> 1135 <listitem><para>Establishes a new tree connect (connection to a share). 1136 Replaces the current tree connect. Prints the new tid (tree id). 1137 Used for internal Samba testing purposes. 1138 </para></listitem> 1139 </varlistentry> 1140 1141 <varlistentry> 1142 <term>tdis</term> 1143 <listitem><para>Close the current share connection (tree disconnect). 1144 Used for internal Samba testing purposes. 1145 </para></listitem> 1146 </varlistentry> 1147 1148 <varlistentry> 1149 <term>tid <number></term> 1150 <listitem><para>Changes the current tree id (tid) in the 1151 protocol to a new arbitrary number. Without an argument, it 1152 prints out the tid currently used. 1153 Used for internal Samba testing purposes. 1154 </para></listitem> 1155 </varlistentry> 1156 1047 1157 </variablelist> 1048 1158 </refsect1> … … 1061 1171 name that would be known to the server.</para> 1062 1172 1063 <para>smbclient supports long file names where the server 1173 <para>smbclient supports long file names where the server 1064 1174 supports the LANMAN2 protocol or above. </para> 1065 1175 </refsect1> … … 1068 1178 <title>ENVIRONMENT VARIABLES</title> 1069 1179 1070 <para>The variable <envar>USER</envar> may contain the 1071 username of the person using the client. This information is1072 used only if the protocol level is high enough to support 1180 <para>The variable <envar>USER</envar> may contain the 1181 username of the person using the client. This information is 1182 used only if the protocol level is high enough to support 1073 1183 session-level passwords.</para> 1074 1184 1075 1185 1076 <para>The variable <envar>PASSWD</envar> may contain 1077 the password of the person using the client. This information is 1078 used only if the protocol level is high enough to support 1186 <para>The variable <envar>PASSWD</envar> may contain 1187 the password of the person using the client. This information is 1188 used only if the protocol level is high enough to support 1079 1189 session-level passwords. </para> 1080 1190 1081 <para>The variable <envar>LIBSMB_PROG</envar> may contain 1082 the path, executed with system(), which the client should connect 1083 1084 intended as a development aid, and works best when using a LMHOSTS 1085 1191 <para>The variable <envar>LIBSMB_PROG</envar> may contain 1192 the path, executed with system(), which the client should connect 1193 to instead of connecting to a server. This functionality is primarily 1194 intended as a development aid, and works best when using a LMHOSTS 1195 file</para> 1086 1196 </refsect1> 1087 1197 … … 1090 1200 <title>INSTALLATION</title> 1091 1201 1092 <para>The location of the client program is a matter for 1202 <para>The location of the client program is a matter for 1093 1203 individual system administrators. The following are thus 1094 1204 suggestions only. </para> … … 1096 1206 <para>It is recommended that the smbclient software be installed 1097 1207 in the <filename>/usr/local/samba/bin/</filename> or <filename> 1098 /usr/samba/bin/</filename> directory, this directory readable 1099 by all, writeable only by root. The client program itself should 1100 be executable by all. The client should <emphasis>NOT</emphasis> be 1208 /usr/samba/bin/</filename> directory, this directory readable 1209 by all, writeable only by root. The client program itself should 1210 be executable by all. The client should <emphasis>NOT</emphasis> be 1101 1211 setuid or setgid! </para> 1102 1212 1103 <para>The client log files should be put in a directory readable 1213 <para>The client log files should be put in a directory readable 1104 1214 and writeable only by the user. </para> 1105 1215 1106 <para>To test the client, you will need to know the name of a 1216 <para>To test the client, you will need to know the name of a 1107 1217 running SMB/CIFS server. It is possible to run <citerefentry><refentrytitle>smbd</refentrytitle> 1108 <manvolnum>8</manvolnum></citerefentry> as an ordinary user - running that server as a daemon 1218 <manvolnum>8</manvolnum></citerefentry> as an ordinary user - running that server as a daemon 1109 1219 on a user-accessible port (typically any port number over 1024) 1110 1220 would provide a suitable test server. </para> … … 1115 1225 <title>DIAGNOSTICS</title> 1116 1226 1117 <para>Most diagnostics issued by the client are logged in a 1118 specified log file. The log file name is specified at compile time, 1227 <para>Most diagnostics issued by the client are logged in a 1228 specified log file. The log file name is specified at compile time, 1119 1229 but may be overridden on the command line. </para> 1120 1230 1121 <para>The number and nature of diagnostics available depends 1122 on the debug level used by the client. If you have problems, 1231 <para>The number and nature of diagnostics available depends 1232 on the debug level used by the client. If you have problems, 1123 1233 set the debug level to 3 and peruse the log files. </para> 1124 1234 </refsect1> … … 1134 1244 <refsect1> 1135 1245 <title>AUTHOR</title> 1136 1137 <para>The original Samba software and related utilities 1246 1247 <para>The original Samba software and related utilities 1138 1248 were created by Andrew Tridgell. Samba is now developed 1139 by the Samba Team as an Open Source project similar 1249 by the Samba Team as an Open Source project similar 1140 1250 to the way the Linux kernel is developed.</para> 1141 1142 <para>The original Samba man pages were written by Karl Auer. 1143 The man page sources were converted to YODL format (another 1251 1252 <para>The original Samba man pages were written by Karl Auer. 1253 The man page sources were converted to YODL format (another 1144 1254 excellent piece of Open Source software, available at <ulink url="ftp://ftp.icce.rug.nl/pub/unix/"> 1145 ftp://ftp.icce.rug.nl/pub/unix/</ulink>) and updated for the Samba 2.0 1146 release by Jeremy Allison. The conversion to DocBook for1255 ftp://ftp.icce.rug.nl/pub/unix/</ulink>) and updated for the Samba 2.0 1256 release by Jeremy Allison. The conversion to DocBook for 1147 1257 Samba 2.2 was done by Gerald Carter. The conversion to DocBook XML 4.2 for Samba 3.0 1148 1258 was done by Alexander Bokovoy.</para>
Note:
See TracChangeset
for help on using the changeset viewer.