05a7dfae22151d977222040afe3bc4dd1a69eed8
[samba.git] / docs-xml / using_samba / appd.xml
1 <appendix label="D" id="SAMBA-AP-D">
2 <title>Summary of Samba Daemons and Commands</title>
3
4
5
6
7 <para>This appendix is a reference listing of command-line options and other information to help you use the executables that come with Samba distribution.</para>
8
9
10
11
12
13
14
15
16
17
18
19 <sect1 role="" label="D.1" id="appd-SECT-1">
20 <title>Samba Distribution Programs</title>
21
22
23 <para>The following sections provide information about the command-line parameters for Samba programs.</para>
24
25
26 <sect2 role="" label="D.1.1" id="appd-SECT-1.1">
27 <title>smbd</title>
28
29
30 <para>
31 <indexterm id="appd-idx-993627-0" class="startofrange"><primary>smbd daemon</primary></indexterm>
32 <indexterm id="appd-idx-993627-1" class="startofrange"><primary>daemons</primary></indexterm>The <emphasis>smbd</emphasis> program provides Samba's file and printer services, using one TCP/IP stream and one daemon per client. It is controlled from the default configuration file, <replaceable>samba_dir</replaceable><emphasis>/lib/smb.conf</emphasis>, and can be overridden by command-line options.</para>
33
34
35 <para>The configuration file is automatically re-evaluated every minute. If it has changed, most new options are immediately effective. You can force Samba to immediately reload the configuration file if you send a SIGHUP to <emphasis>smbd</emphasis>. Reloading the configuration file, however, will not affect any clients that are already connected. To escape this "grandfather" configuration, a client would need to disconnect and reconnect, or the server itself would have to be restarted, forcing all clients to reconnect.</para>
36
37
38 <sect3 role="" label="D.1.1.1" id="appd-SECT-1.1.1">
39 <title>Other signals</title>
40
41
42 <para>To shut down a <emphasis>smbd</emphasis> process, send it the termination signal SIGTERM (-15) which allows it to die gracefully instead of a SIGKILL (-9). To increment the debug logging level of <emphasis>smbd</emphasis> at runtime, send the program a SIGUSR1 signal. To decrement it at runtime, send the program a SIGUSR2 signal.</para>
43 </sect3>
44
45
46
47 <sect3 role="" label="D.1.1.2" id="appd-SECT-1.1.2">
48 <title>Command-line options</title>
49
50
51 <variablelist>
52 <varlistentry><term><literal>-D</literal></term>
53 <listitem><para>The <emphasis>smbd</emphasis> program is run as a daemon. This is the recommended way to use <emphasis>smbd</emphasis> (it is also the default action). In addition, <emphasis>smbd</emphasis> can also be run from <emphasis>inetd</emphasis>.</para></listitem>
54 </varlistentry>
55
56
57 <varlistentry><term><literal>-d</literal> <replaceable>debuglevel</replaceable></term>
58 <listitem><para>Sets the debug (sometimes called logging) level. The level can range from 0 all the way to 10. Specifying the value on the command line overrides the value specified in the <filename>smb.conf</filename> file. Debug level 0 logs only the most important messages; level 1 is normal; levels 3 and above are primarily for debugging and slow <emphasis>smbd</emphasis> considerably.</para></listitem>
59 </varlistentry>
60
61
62 <varlistentry><term><literal>-h</literal> </term>
63 <listitem><para>Prints command-line usage information for the <filename>smbd</filename> program.</para></listitem>
64 </varlistentry>
65 </variablelist>
66 </sect3>
67
68
69
70 <sect3 role="" label="D.1.1.3" id="appd-SECT-1.1.3">
71 <title>Testing/debugging options</title>
72
73
74 <variablelist>
75 <varlistentry><term><literal>-a</literal></term>
76 <listitem><para>If this is specified, each new connection to the Samba server will append all logging messages to the log file. This option is the opposite of <literal>-o</literal>, and is the default.</para></listitem>
77 </varlistentry>
78
79
80 <varlistentry><term><literal>-i</literal> <replaceable>scope</replaceable></term>
81 <listitem><para>This sets a NetBIOS scope identifier. Only machines with the same identifier will communicate with the server. The scope identifier was a predecessor to workgroups, and this option is included only for backwards compatibility.</para></listitem>
82 </varlistentry>
83
84
85 <varlistentry><term><literal>-l</literal> <replaceable>log_file</replaceable></term>
86 <listitem><para>Send the log messages to somewhere other than the location compiled in or specified in the <filename>smb.conf</filename> file. The default is often <filename>/usr/local/samba/var/log.smb</filename>, <filename>/usr/samba/var/log.smb,</filename> or <filename>/var/log/log.smb</filename>. The first two are strongly discouraged on Linux, where <filename>/usr</filename> may be a read-only filesystem.</para></listitem>
87 </varlistentry>
88
89
90 <varlistentry><term><literal>-O</literal> <replaceable>socket_options</replaceable></term>
91 <listitem><para>This sets the TCP/IP socket options, using the same parameters as the <literal>socket</literal> <literal>options</literal> configuration option. It is often used for performance tuning and testing.</para></listitem>
92 </varlistentry>
93
94
95 <varlistentry><term><literal>-o</literal></term>
96 <listitem><para>This option is the opposite of <literal>-a</literal>. It causes log files to be overwritten when opened. Using this option saves hunting for the right log entries if you are performing a series of tests and inspecting the log file each time.</para></listitem>
97 </varlistentry>
98
99
100 <varlistentry><term><literal>-P</literal></term>
101 <listitem><para>This option forces <filename>smbd</filename> not to send any network data out. This option is typically used only by Samba developers.<indexterm id="appd-idx-994096-0" class="endofrange" startref="appd-idx-993627-0"/></para></listitem>
102 </varlistentry>
103
104
105 <varlistentry><term><literal>-P</literal></term>
106 <listitem><para>This option forces <filename>smbd</filename> not to send any network data out. This option is typically used only by Samba developers.  <indexterm id="appd-idx-994102-0" class="endofrange" startref="appd-idx-993627-0"/></para></listitem>
107 </varlistentry>
108
109
110 <varlistentry><term><literal>-p</literal> <replaceable>port_number</replaceable></term>
111 <listitem><para>This sets the TCP/IP port number that the server will accept requests from. Currently, all Microsoft clients send only to the default port: 139.</para></listitem>
112 </varlistentry>
113
114
115 <varlistentry><term><literal>-s</literal> <replaceable>configuration_file</replaceable></term>
116 <listitem><para>Specifies the location of the Samba configuration file. Although the file defaults to <filename>/usr/local/samba/lib/smb.conf</filename>, you can override it here on the command line, typically for debugging.</para></listitem>
117 </varlistentry>
118 </variablelist>
119 </sect3>
120 </sect2>
121
122
123
124
125
126 <sect2 role="" label="D.1.2" id="appd-SECT-1.2">
127 <title>nmbd</title>
128
129
130 <para>
131 <indexterm id="appd-idx-993645-0" class="startofrange"><primary>nmbd daemon</primary></indexterm>The <emphasis>nmbd</emphasis> program is Samba's NetBIOS name and browsing daemon. It replies to broadcast NetBIOS over TCP/IP (NBT) name-service requests from SMB clients and optionally to Microsoft's Windows Internet Name Service (WINS) requests. Both of these are versions of the name-to-address lookup required by SMB clients. The broadcast version uses UDP/IP broadcast on the local subnet only, while WINS uses TCP/IP, which may be routed. If running as a WINS server, <emphasis>nmbd</emphasis> keeps a current name and address database in the file <filename>wins.dat</filename> in the <literal>samba_dir</literal><filename>/var/locks</filename> directory.</para>
132
133
134 <para>An active <emphasis>nmbd</emphasis> program can also respond to browsing protocol requests used by the Windows Network Neighborhood. Browsing is a combined advertising, service announcement, and active directory protocol. This protocol provides a dynamic directory of servers and the disks and printers that the servers are providing. As with WINS, this was initially done by making UDP/IP broadcasts on the local subnet. Now, with the concept of a local master browser, it is done by making TCP/IP connections to a server. If <emphasis>nmbd</emphasis> is acting as a local master browser, it stores the browsing database in the file <filename>browse.dat</filename> in the <literal>samba_dir</literal><filename>/var/locks</filename> directory.</para>
135
136
137 <sect3 role="" label="D.1.2.1" id="appd-SECT-1.2.1">
138 <title>Signals</title>
139
140
141 <para>Like <emphasis>smbd</emphasis>, the <emphasis>nmbd</emphasis> program responds to several Unix signals. Sending <emphasis>nmbd</emphasis> a SIGHUP signal will cause it to dump the names it knows about to the file <filename>namelist.debug</filename> in the <literal>samba_dir</literal>/<emphasis>locks</emphasis> directory and its browsing database to the <filename>browse.dat </filename>file in the same directory. To shut down a <emphasis>nmbd</emphasis> process send it a SIGTERM (-15) signal instead of a SIGKILL (-9) to allow it to die gracefully. You can increment the debug logging level of <emphasis>nmbd</emphasis> by sending it a SIGUSR1 signal; you can decrement it by sending a SIGUSR2 signal.</para>
142 </sect3>
143
144
145
146 <sect3 role="" label="D.1.2.2" id="appd-SECT-1.2.2">
147 <title>Command-line options</title>
148
149
150 <variablelist>
151 <varlistentry><term><literal>-D</literal></term>
152 <listitem><para>Instructs the <filename>nmbd</filename> program to run as a daemon. This is the recommended way to use <filename>nmbd</filename>. In addition, <filename>nmbd</filename> can also be run from <firstterm>inetd</firstterm>.</para></listitem>
153 </varlistentry>
154
155
156 <varlistentry><term><literal>-d</literal> <replaceable>debuglevel</replaceable></term>
157 <listitem><para>Sets the debug (sometimes called logging) level. The level can range from 0, all the way to 10. Specifying the value on the command line overrides the value specified in the <filename>smb.conf</filename> file. Debug level 0 logs only the most important messages; level 1 is normal; level 3 and above are primarily for debugging, and slow <emphasis>nmbd</emphasis> considerably.</para></listitem>
158 </varlistentry>
159
160
161 <varlistentry><term><literal>-h</literal> </term>
162 <listitem><para>Prints command-line usage information for the <filename>nmbd</filename> program (also <literal>-?</literal>).</para></listitem>
163 </varlistentry>
164 </variablelist>
165 </sect3>
166
167
168
169 <sect3 role="" label="D.1.2.3" id="appd-SECT-1.2.3">
170 <title>Testing/debugging options</title>
171
172
173 <variablelist>
174 <varlistentry><term><literal>-a</literal></term>
175 <listitem><para>If this is specified, each new connection to the Samba server will append all logging messages to the log file. This option is the opposite of <literal>-o</literal>, and is the default.</para></listitem>
176 </varlistentry>
177
178
179 <varlistentry><term><literal>-H</literal> <replaceable>hosts_  file</replaceable></term>
180 <listitem><para>This option loads a standard <emphasis>hosts</emphasis> file for name resolution.</para></listitem>
181 </varlistentry>
182
183
184 <varlistentry><term><literal>-i</literal> <replaceable>scope</replaceable></term>
185 <listitem><para>This sets a NetBIOS scope identifier. Only machines with the same identifier will communicate with the server. The scope identifier was a predecessor to workgroups, and this option is included only for backward<indexterm id="appd-idx-994134-0" class="endofrange" startref="appd-idx-993627-1"/> compatibility.<indexterm id="appd-idx-994135-0" class="endofrange" startref="appd-idx-993645-0"/></para></listitem>
186 </varlistentry>
187
188
189 <varlistentry><term><literal>-l</literal> <replaceable>log_file</replaceable></term>
190 <listitem><para>Sends the log messages to somewhere other than the location compiled-in or specified in the <filename>smb.conf</filename> file. The default is often <filename>/usr/local/samba/var/log.nmb</filename>, <filename>/usr/samba/var/log.nmb,</filename> or <filename>/var/log/log.nmb</filename>. The first two are strongly discouraged on Linux, where <filename>/usr</filename> may be a read-only filesystem.</para></listitem>
191 </varlistentry>
192
193
194 <varlistentry><term><literal>-n</literal> <replaceable>NetBIOS_name</replaceable></term>
195 <listitem><para>This option allows you to override the NetBIOS name by which the daemon will advertise itself. Specifying the option on the command line overrides the <literal>netbios</literal> <literal>name</literal> option in the Samba configuration file.</para></listitem>
196 </varlistentry>
197
198
199 <varlistentry><term><literal>-O</literal> <replaceable>socket_options</replaceable></term>
200 <listitem><para>This sets the TCP/IP socket options, using the same parameters as the <literal>socket</literal> <literal>options</literal> configuration option. It is often used for performance tuning and testing.</para></listitem>
201 </varlistentry>
202
203
204 <varlistentry><term><literal>-o</literal></term>
205 <listitem><para>This option is the opposite of <literal>-a</literal>. It causes log files to be overwritten when opened. Using this option saves hunting for the right log entries if you are performing a series of tests and inspecting the log file each time.</para></listitem>
206 </varlistentry>
207
208
209 <varlistentry><term><literal>-p</literal> <replaceable>port_number</replaceable></term>
210 <listitem><para>This sets the UDP/IP port number from which the server will accept requests. Currently, all Microsoft clients send only to the default port: 137.</para></listitem>
211 </varlistentry>
212
213
214 <varlistentry><term><literal>-s</literal> <replaceable>configuration_file</replaceable></term>
215 <listitem><para>Specifies the location of the Samba configuration file. Although the file defaults to <filename>/usr/local/samba/lib/smb.conf</filename>, you can override it here on the command line, typically for debugging.</para></listitem>
216 </varlistentry>
217
218
219 <varlistentry><term><literal>-v</literal></term>
220 <listitem><para>This option prints the current version of Samba.</para></listitem>
221 </varlistentry>
222 </variablelist>
223 </sect3>
224 </sect2>
225
226
227
228
229
230 <sect2 role="" label="D.1.3" id="appd-SECT-1.3">
231 <title>Samba Startup File </title>
232
233
234 <para>
235 <indexterm id="appd-idx-993647-0"><primary>Samba</primary><secondary>startup file</secondary></indexterm>
236 <indexterm id="appd-idx-993647-1"><primary>scripts</primary><secondary sortas="Samba startup file">for Samba startup file</secondary></indexterm>
237 <indexterm id="appd-idx-993647-2"><primary>directories</primary><secondary sortas="Samba startup file">for Samba startup file</secondary></indexterm>Samba is normally started by running it from your Unix system's <filename>rc</filename> files at boot time. For systems with a System V-like set of <filename>/etc/rcN.d</filename> directories, this can be done by placing a suitably named script in the <filename>/rc</filename> directory. Usually, the script  starting Samba is called <emphasis>S91samba</emphasis>, while the script stopping or "killing" Samba is called <emphasis>K91samba.</emphasis> On Linux, the usual subdirectory for the scripts is <filename>/etc/rc2.d.</filename> On Solaris, the directory is <filename>/etc/rc3.d</filename>. For machines with <filename>/etc/rc.local</filename> files, you would normally add the following lines to that file:</para>
238
239
240 <programlisting>/usr/local/samba/bin/smbd -D
241 /usr/local/samba/bin/nmbd -D</programlisting>
242
243
244 <para>The following example script supports two extra commands, <literal>status</literal> and <literal>restart</literal>, in addition to the normal <literal>start</literal> and <literal>stop</literal> for System V machines:</para>
245
246
247 <programlisting>#!/bin/sh
248 #
249 # /etc/rc2.d./S91Samba  --manage the SMB server in a System V manner
250 #
251 OPTS="-D"
252 #DEBUG=-d3
253 PS="ps  ax"
254 SAMBA_DIR=/usr/local/samba
255 case "$1" in
256 'start')
257         echo "samba "
258         $SAMBA_DIR/bin/smbd $OPTS $DEBUG
259         $SAMBA_DIR/bin/nmbd $OPTS $DEBUG
260         ;;
261 'stop')
262         echo "Stopping samba"
263         $PS | awk '/usr.local.samba.bin/ { print $1}' |\
264         xargs kill
265         ;;
266 'status')
267         x=`$PS | grep -v grep | grep '$SAMBA_DIR/bin'`
268         if [ ! "$x" ]; then
269                 echo "No samba processes running"
270         else
271                 echo "  PID TT STAT  TIME COMMAND"
272                 echo "$x"
273         fi
274         ;;
275 'restart')
276         /etc/rc2.d/S91samba stop
277         /etc/rc2.d/S91samba start
278         /etc/rc2.d/S91samba status
279         ;;
280 *)
281         echo "$0: Usage error -- you must say $0 start,  stop, status or restart ."
282         ;;
283 esac
284 exit</programlisting>
285
286
287 <para>You'll need to set the actual paths and <literal>ps</literal> options to suit the machine you're using. In addition, you might want to add additional commands to tell Samba to reload its <filename>smb.conf</filename> file or dump its <emphasis>nmbd</emphasis> tables, depending on your actual needs.</para>
288 </sect2>
289
290
291
292
293
294 <sect2 role="" label="D.1.4" id="appd-SECT-1.4">
295 <title>smbsh</title>
296
297
298 <para>The <emphasis>smbsh</emphasis>
299 <indexterm id="appd-idx-993744-0"><primary>smbsh program</primary></indexterm> program lets you use a remote Windows share on your Samba server as if the share was a regular Unix directory. When it's run, it provides an extra directory tree under <filename>/smb</filename>. Subdirectories of <filename>/smb</filename> are servers, and subdirectories of the servers are their individual disk and printer shares. Commands run by <emphasis>smbsh</emphasis> treat the <filename>/smb</filename> filesystem as if it were local to Unix. This means that you don't need <emphasis>smbmount</emphasis> in your kernel to mount Windows filesystems the way you mount with NFS filesystems. However, you do need to configure Samba with the <literal>--with-smbwrappers</literal> option to enable <filename>smbsh</filename>.</para>
300
301
302 <sect3 role="" label="D.1.4.1" id="appd-SECT-1.4.1">
303 <title>Options</title>
304
305
306 <variablelist>
307 <varlistentry><term><literal>-d</literal> debuglevel</term>
308 <listitem><para>Sets the debug (sometimes called logging) level. The level can range from 0, the default, all the way to 10. Debug level 0 logs only the most important messages; level 1 is normal; level 3 and above are primarily for debugging, and slow <emphasis>smbsh</emphasis> considerably.</para></listitem>
309 </varlistentry>
310
311
312 <varlistentry><term><literal>-l</literal> <replaceable>logfile</replaceable></term>
313 <listitem><para>Sets the name of the logfile to use.</para></listitem>
314 </varlistentry>
315
316
317 <varlistentry><term><literal>-P</literal> <replaceable>prefix</replaceable></term>
318 <listitem><para>Sets the root directory to mount the SMB filesystem. The default is <filename>/smb</filename>.</para></listitem>
319 </varlistentry>
320
321
322 <varlistentry><term><literal>-R</literal> <replaceable>resolve order</replaceable></term>
323 <listitem><para>Sets the resolve order of the name servers. This option is similar to the <literal>resolve order</literal> configuration option, and can take any of the four parameters, <literal>lmhosts</literal>, <literal>host</literal>, <literal>wins</literal>, and <literal>bcast</literal>, in any order.</para></listitem>
324 </varlistentry>
325
326
327 <varlistentry><term><literal>-U</literal> <replaceable>user</replaceable></term>
328 <listitem><para>Supports <replaceable>user%password.</replaceable></para></listitem>
329 </varlistentry>
330
331
332 <varlistentry><term><literal>-W</literal> <replaceable>workgroup</replaceable></term>
333 <listitem><para>Sets the NetBIOS workgroup to which the client will connect.</para></listitem>
334 </varlistentry>
335 </variablelist>
336 </sect3>
337 </sect2>
338
339
340
341
342
343 <sect2 role="" label="D.1.5" id="appd-SECT-1.5">
344 <title>smbclient</title>
345
346
347 <para>The <emphasis>smbclient</emphasis>
348 <indexterm id="appd-idx-993745-0" class="startofrange"><primary>smbclient program</primary></indexterm>
349 <indexterm id="appd-idx-993745-1" class="startofrange"><primary>testing</primary><secondary>smbclient program</secondary></indexterm> program is the maid-of-all-work of the Samba suite. Initially intended as a testing tool, it has become a full command-line Unix client, with an FTP-like interactive client. Some of its options are still used for testing and tuning, and it makes a simple tool for ensuring that Samba is running on a server.</para>
350
351
352 <para>It's convenient to look at <emphasis>smbclient</emphasis> as a suite of programs:</para>
353
354
355 <itemizedlist>
356 <listitem><para>FTP-like interactive file transfer program</para></listitem>
357 <listitem><para>Interactive printing program</para></listitem>
358 <listitem><para>Interactive tar program</para></listitem>
359 <listitem><para>Command-line message program</para></listitem>
360 <listitem><para>Command-line <emphasis>tar</emphasis> program (but see <emphasis>smbtar</emphasis> later)</para></listitem>
361 <listitem><para>"What services do you have" query program</para></listitem>
362 <listitem><para>Command-line debugging program</para></listitem>
363 </itemizedlist>
364
365 <sect3 role="" label="D.1.5.1" id="appd-SECT-1.5.1">
366 <title>General command-line options</title>
367
368
369 <para>The program has the usual set of <emphasis>smbd</emphasis>-like options, which apply to all the interactive and command-line use. The syntax is:</para>
370
371
372 <programlisting>smbclient //<replaceable>server_name</replaceable>/<replaceable>share_name</replaceable> [<replaceable>password</replaceable>] [-<replaceable>options</replaceable>]</programlisting>
373
374
375 <para>Here is an explanation of each of the command-line options:</para>
376
377
378 <variablelist>
379 <varlistentry><term><literal>-d</literal> <replaceable>debug_level</replaceable></term>
380 <listitem><para>Sets the debug (logging) level, from 0 to 10, with <literal>A</literal> for all. Overrides the value in <filename>smb.conf</filename>. Debug level 0 logs only the most important messages; level 1 is normal; debug level 3 and above are for debugging, and slow <emphasis>smbclient</emphasis> considerably.</para></listitem>
381 </varlistentry>
382
383
384 <varlistentry><term><literal>-h</literal></term>
385 <listitem><para>Prints the command-line help information (usage) for smbclient.</para></listitem>
386 </varlistentry>
387
388
389 <varlistentry><term><literal>-n</literal> <replaceable>NetBIOS_name</replaceable></term>
390 <listitem><para>Allows you to override the NetBIOS name by which the program will advertise itself.</para></listitem>
391 </varlistentry>
392 </variablelist>
393 </sect3>
394
395
396
397 <sect3 role="" label="D.1.5.2" id="appd-SECT-1.5.2">
398 <title>Smbclient operations</title>
399
400
401 <para>Running <literal>smbclient</literal> <literal>//</literal><replaceable>server_name</replaceable><literal>/</literal><replaceable>share</replaceable> will cause it to prompt you for a username and password. If the login is successful, it will connect to the share and give you a prompt much like an FTP prompt (the backslash in the prompt will be replaced by the current directory within the share as you move around the filesystem):</para>
402
403
404 <programlisting>smb:\&gt;</programlisting>
405
406
407 <para>
408 <indexterm id="appd-idx-994034-0" class="startofrange"><primary>commands for Samba</primary></indexterm>From this command line, you can use several FTP-like commands, as listed in <link linkend="appd-89417">Table 4.1</link>. Arguments in square brackets are optional.</para>
409
410
411 <table label="D.1" id="appd-89417">
412 <title>smbclient Commands </title>
413
414 <tgroup cols="2">
415 <colspec colnum="1" colname="col1"/>
416 <colspec colnum="2" colname="col2"/>
417 <thead>
418 <row>
419
420 <entry colname="col1"><para>Command</para></entry>
421
422 <entry colname="col2"><para>Description</para></entry>
423
424 </row>
425
426 </thead>
427
428 <tbody>
429 <row>
430
431 <entry colname="col1"><para><literal>?</literal> <replaceable>command</replaceable></para></entry>
432
433 <entry colname="col2"><para>Provides list of commands or help on specified command.</para></entry>
434
435 </row>
436
437 <row>
438
439 <entry colname="col1"><para><literal>help</literal> [<replaceable>command</replaceable>]</para></entry>
440
441 <entry colname="col2"><para>Provides list of commands or help on specified command.</para></entry>
442
443 </row>
444
445 <row>
446
447 <entry colname="col1"><para><literal>!</literal> [<replaceable>command</replaceable>]</para></entry>
448
449 <entry colname="col2"><para>If a command is specified, it will be run in a local shell. If not, you will be placed into a local shell on the client.</para></entry>
450
451 </row>
452
453 <row>
454
455 <entry colname="col1"><para><literal>dir</literal> [<replaceable>filename</replaceable>]</para></entry>
456
457 <entry colname="col2"><para>Displays any files matching <replaceable>filename</replaceable> in the current directory on the server, or all files if <replaceable>filename</replaceable> is omitted.</para></entry>
458
459 </row>
460
461 <row>
462
463 <entry colname="col1"><para><literal>ls</literal> [<replaceable>filename</replaceable>]</para></entry>
464
465 <entry colname="col2"><para>Displays any files matching <replaceable>filename</replaceable> in the current directory on the server, or all files if <replaceable>filename</replaceable> is omitted.</para></entry>
466
467 </row>
468
469 <row>
470
471 <entry colname="col1"><para><literal>cd</literal> [<replaceable>directory</replaceable>]</para></entry>
472
473 <entry colname="col2"><para>If <replaceable>directory</replaceable> is specified, changes to the specified directory on the remote server. If not, reports the current directory on the remote machine.</para></entry>
474
475 </row>
476
477 <row>
478
479 <entry colname="col1"><para><literal>lcd</literal> [<replaceable>director</replaceable><literal>y</literal>]</para></entry>
480
481 <entry colname="col2"><para>If <replaceable>directory</replaceable> is specified, the current directory on the local machine will be changed. If not, the name of the current directory on the local machine will be reported.</para></entry>
482
483 </row>
484
485 <row>
486
487 <entry colname="col1"><para><literal>get</literal> <emphasis>remotefile</emphasis> [<replaceable>localfile</replaceable>]</para></entry>
488
489 <entry colname="col2"><para>Copies the file <replaceable>remotefile</replaceable> to the local machine. If a <replaceable>localfile</replaceable> is specified, uses that name to copy the file to. Treats the file as binary; does <emphasis>not</emphasis> do LF to CR/LF conversions.</para></entry>
490
491 </row>
492
493 <row>
494
495 <entry colname="col1"><para><literal>put</literal> <emphasis>localfile</emphasis> [<replaceable>remotefile</replaceable>]</para></entry>
496
497 <entry colname="col2"><para>Copies <replaceable>localfile</replaceable> to the remote machine. If a <replaceable>remotefile</replaceable> is specified, uses that as the name to copy to on the remote server. Treats the file as binary; does <emphasis>not</emphasis> do LF to CR/LF conversions.</para></entry>
498
499 </row>
500
501 <row>
502
503 <entry colname="col1"><para><literal>mget</literal> <replaceable>pattern</replaceable></para></entry>
504
505 <entry colname="col2"><para>Gets all files matching <replaceable>pattern</replaceable> from the remote machine.</para></entry>
506
507 </row>
508
509 <row>
510
511 <entry colname="col1"><para><literal>mput</literal><replaceable> pattern</replaceable></para></entry>
512
513 <entry colname="col2"><para>Places all local files matching <replaceable>pattern</replaceable> on the remote machine.</para></entry>
514
515 </row>
516
517 <row>
518
519 <entry colname="col1"><para><literal>prompt</literal></para></entry>
520
521 <entry colname="col2"><para>Toggles interactive prompting on and off for <literal>mget</literal> and <literal>mput</literal>.</para></entry>
522
523 </row>
524
525 <row>
526
527 <entry colname="col1"><para><literal>lowercase ON </literal>(or<literal> OFF </literal>)</para></entry>
528
529 <entry colname="col2"><para>If lowercase is on, <emphasis>smbclient</emphasis> will convert filenames to lowercase during an <literal>mget</literal> or <literal>get</literal> (but not a <literal>mput</literal> or <literal>put</literal>).</para></entry>
530
531 </row>
532
533 <row>
534
535 <entry colname="col1"><para><literal>del</literal> <replaceable>filename</replaceable></para></entry>
536
537 <entry colname="col2"><para>Delete a file on the remote machine.</para></entry>
538
539 </row>
540
541 <row>
542
543 <entry colname="col1"><para><literal>md</literal> <replaceable>directory</replaceable></para></entry>
544
545 <entry colname="col2"><para>Create a directory on the remote machine.</para></entry>
546
547 </row>
548
549 <row>
550
551 <entry colname="col1"><para><literal>mkdir</literal> <replaceable>directory</replaceable></para></entry>
552
553 <entry colname="col2"><para>Create a directory on the remote machine.</para></entry>
554
555 </row>
556
557 <row>
558
559 <entry colname="col1"><para><literal>rd</literal> <replaceable>directory</replaceable></para></entry>
560
561 <entry colname="col2"><para>Remove the specified directory on the remote machine.</para></entry>
562
563 </row>
564
565 <row>
566
567 <entry colname="col1"><para><literal>rmdir</literal> <replaceable>directory</replaceable></para></entry>
568
569 <entry colname="col2"><para>Remove the specified directory on the remote machine.</para></entry>
570
571 </row>
572
573 <row>
574
575 <entry colname="col1"><para><literal>setmode</literal> <replaceable>filename</replaceable> <literal>[+|-]rsha</literal></para></entry>
576
577 <entry colname="col2"><para>Set DOS filesystem attribute bits, using Unix-like modes. <literal>r</literal> is read-only, <literal>s</literal> is system, <literal>h</literal> is hidden, and <literal>a</literal> is archive.</para></entry>
578
579 </row>
580
581 <row>
582
583 <entry colname="col1"><para><literal>exit</literal></para></entry>
584
585 <entry colname="col2"><para>Exits <emphasis>smbclient</emphasis>.</para></entry>
586
587 </row>
588
589 <row>
590
591 <entry colname="col1"><para><literal>quit</literal></para></entry>
592
593 <entry colname="col2"><para>Exits <emphasis>smbclient</emphasis>.</para></entry>
594
595 </row>
596
597 </tbody>
598 </tgroup>
599 </table>
600
601
602 <para>There are also mask and recursive commands for large copies; see the <filename>smbclient</filename> manual page for details on how to use these. With the exception of mask, recursive, and the lack of an ASCII transfer mode, <emphasis>smbclient</emphasis> works exactly the same as FTP. Note that because it does binary transfers, Windows files copied to Unix will have lines ending in carriage-return and linefeed (<literal>\r\n</literal>), not Unix's linefeed (<literal>\n</literal>).</para>
603 </sect3>
604
605
606
607 <sect3 role="" label="D.1.5.3" id="appd-SECT-1.5.3">
608 <title>Printing commands</title>
609
610
611 <para>The <emphasis>smbclient</emphasis> program can also be used for access to a printer by connecting to a print share. Once connected, the commands shown in <link linkend="appd-39300">Table 4.2</link> can be used to print.</para>
612
613
614 <table label="D.2" id="appd-39300">
615 <title>smbclient Printing Commands </title>
616
617 <tgroup cols="2">
618 <colspec colnum="1" colname="col1"/>
619 <colspec colnum="2" colname="col2"/>
620 <thead>
621 <row>
622
623 <entry colname="col1"><para>Command</para></entry>
624
625 <entry colname="col2"><para>Description</para></entry>
626
627 </row>
628
629 </thead>
630
631 <tbody>
632 <row>
633
634 <entry colname="col1"><para><literal>print</literal><replaceable> filename</replaceable></para></entry>
635
636 <entry colname="col2"><para>Prints the file by copying it from the local machine to the remote one and then submitting it as a print job there.</para></entry>
637
638 </row>
639
640 <row>
641
642 <entry colname="col1"><para><literal>printmode</literal> <replaceable>text </replaceable>|<replaceable> graphics</replaceable></para></entry>
643
644 <entry colname="col2"><para>Instructs the server that the following files will be plain text (ASCII) or the binary graphics format that the printer requires. It's up to the user to ensure that the file is indeed the right kind.</para></entry>
645
646 </row>
647
648 <row>
649
650 <entry colname="col1"><para><literal>queue</literal></para></entry>
651
652 <entry colname="col2"><para>Displays the queue for the print share you're connected to, showing job ID, name, size, and status.</para></entry>
653
654 </row>
655
656 </tbody>
657 </tgroup>
658 </table>
659
660
661 <para>Finally, to print from the <emphasis>smbclient</emphasis>, use the <literal>-c</literal> option:</para>
662
663
664 <programlisting>cat <replaceable>printfile</replaceable> | smbclient //<replaceable>server</replaceable>/<replaceable>printer_name</replaceable>  -c "print -"</programlisting>
665 </sect3>
666
667
668
669 <sect3 role="" label="D.1.5.4" id="appd-SECT-1.5.4">
670 <title>Tar commands</title>
671
672
673 <para><emphasis>smbclient</emphasis> can tar up files from a file share. This is normally done from the command line using the <emphasis>smbtar</emphasis> command, but the commands shown in <link linkend="appd-54517">Table 4.3</link> are also available interactively.</para>
674
675
676 <table label="D.3" id="appd-54517">
677 <title>smbclient Printing Commands </title>
678
679 <tgroup cols="2">
680 <colspec colnum="1" colname="col1"/>
681 <colspec colnum="2" colname="col2"/>
682 <thead>
683 <row>
684
685 <entry colname="col1"><para>Command</para></entry>
686
687 <entry colname="col2"><para>Description</para></entry>
688
689 </row>
690
691 </thead>
692
693 <tbody>
694 <row>
695
696 <entry colname="col1"><para><literal>tar c|x[IXbgNa]</literal> <replaceable>operands</replaceable></para></entry>
697
698 <entry colname="col2"><para>Performs a creation or extraction <emphasis>tar</emphasis> similar to the command-line program.</para></entry>
699
700 </row>
701
702 <row>
703
704 <entry colname="col1"><para><literal>blocksize</literal> <replaceable>size</replaceable></para></entry>
705
706 <entry colname="col2"><para>Sets the block size to be used by <emphasis>tar</emphasis>, in 512-byte blocks.</para></entry>
707
708 </row>
709
710 <row>
711
712 <entry colname="col1"><para><literal>noreset</literal></para></entry>
713
714 <entry colname="col2"><para>Makes <emphasis>tar</emphasis> pay attention to DOS archive bit for all following commands. In <literal>full</literal> mode (the default), <emphasis>tar</emphasis> will back up everything. In <literal>inc</literal> (incremental) mode, <emphasis>tar</emphasis> will back up only those files with the archive bit set. In <literal>reset</literal> mode, <emphasis>tar</emphasis> will reset the archive bit on all files it backs up. (this requires the share to be writable), and in <literal>noreset</literal> mode the archive bit will not be reset even after the file has been backed up.</para></entry>
715
716 </row>
717
718 </tbody>
719 </tgroup>
720 </table>
721 </sect3>
722
723
724
725 <sect3 role="" label="D.1.5.5" id="appd-SECT-1.5.5">
726 <title>Command-line message program options</title>
727
728
729 <variablelist>
730 <varlistentry><term><literal>-M</literal> <replaceable>NetBIOS_machine_name</replaceable></term>
731 <listitem><para>This option allows you to send immediate messages using the WinPopup protocol to another computer. Once a connection is established, you can type your message, pressing control-D to end. If WinPopup is not running on the receiving machine, the program returns an error.</para></listitem>
732 </varlistentry>
733
734
735 <varlistentry><term><literal>-U</literal> <replaceable>user</replaceable> </term>
736 <listitem><para>This<replaceable> </replaceable>option allows you to indirectly control the FROM part of the message.</para></listitem>
737 </varlistentry>
738 </variablelist>
739 </sect3>
740
741
742
743 <sect3 role="" label="D.1.5.6" id="appd-SECT-1.5.6">
744 <title>Command-line tar program options</title>
745
746
747 <para>The <literal>-T</literal> (tar), <literal>-D</literal> (starting directory), and <literal>-c</literal> (command) options are used together to tar up files interactively. This is better done with <filename>smbtar</filename>, which will be discussed shortly. We don't recommend using <emphasis>smbclient</emphasis> directly as a <emphasis>tar</emphasis> program.</para>
748
749
750 <variablelist>
751 <varlistentry><term><literal>-D</literal> <replaceable>initial_directory</replaceable></term>
752 <listitem><para>Changes to initial directory before starting.</para></listitem>
753 </varlistentry>
754
755
756 <varlistentry><term><literal>-c</literal> <replaceable>command_string</replaceable> </term>
757 <listitem><para>Passes a command string to the <emphasis>smbclient</emphasis> command interpreter, which treats it as a semicolon-separated list of commands to be executed. This is handy to say things such as <literal>tarmode</literal> <literal>inc</literal>, for example, which forces <literal>smbclient</literal> <literal>-T</literal> to back up only files with the archive bit set.</para></listitem>
758 </varlistentry>
759
760
761 <varlistentry><term><literal>-T</literal> <replaceable>command filename</replaceable></term>
762 <listitem><para>Runs the <emphasis>tar</emphasis> driver, which is <emphasis>gtar</emphasis> compatible. The two main commands are: <literal>c</literal> (create) and <literal>x</literal> (extract), which may be followed by any of:</para></listitem>
763 </varlistentry>
764
765
766 <varlistentry><term><literal>a</literal></term>
767 <listitem><para>Resets archive bits once files are saved.</para></listitem>
768 </varlistentry>
769
770
771 <varlistentry><term><literal>b</literal> <replaceable>size</replaceable></term>
772 <listitem><para>Sets blocksize in 512-byte units.</para></listitem>
773 </varlistentry>
774
775
776 <varlistentry><term><literal>g</literal></term>
777 <listitem><para>Backs up only files with the archive bit set.</para></listitem>
778 </varlistentry>
779
780
781 <varlistentry><term><literal>I</literal> <replaceable>file</replaceable></term>
782 <listitem><para>Includes files and directories (this is the default). Does not do pattern-matching.</para></listitem>
783 </varlistentry>
784
785
786 <varlistentry><term><literal>N</literal> <replaceable>filename</replaceable></term>
787 <listitem><para>Backs up only those files newer than <replaceable>filename.</replaceable></para></listitem>
788 </varlistentry>
789
790
791 <varlistentry><term><literal>q</literal></term>
792 <listitem><para>Does not produce diagnostics.</para></listitem>
793 </varlistentry>
794
795
796 <varlistentry><term><literal>X</literal> <replaceable>file</replaceable></term>
797 <listitem><para>Excludes files.</para></listitem>
798 </varlistentry>
799 </variablelist>
800 </sect3>
801
802
803
804 <sect3 role="" label="D.1.5.7" id="appd-SECT-1.5.7">
805 <title>Command-line query program</title>
806
807
808 <para>If <filename>smbclient</filename> is run as:</para>
809
810
811 <programlisting>smbclient -L <replaceable>server_name</replaceable></programlisting>
812
813
814 <para>it will list the shares and other services that machine provides. This is handy if you don't have <filename>smbwrappers</filename>. It can also be helpful as a testing program in its own right.</para>
815 </sect3>
816
817
818
819 <sect3 role="" label="D.1.5.8" id="appd-SECT-1.5.8">
820 <title>Command-line debugging /diagnostic program options</title>
821
822
823 <para>Any of the various modes of operation of <emphasis>smbclient</emphasis> can be used with the debugging and testing command-line options:</para>
824
825
826 <variablelist>
827 <varlistentry><term><literal>-B</literal> <replaceable>IP_addr</replaceable></term>
828 <listitem><para>Sets the broadcast address.</para></listitem>
829 </varlistentry>
830
831
832 <varlistentry><term><literal>-d</literal> <replaceable>debug_level</replaceable></term>
833 <listitem><para>Sets the debug (sometimes called logging) level. The level can range from 0 all the way to 10. In addition, you can specify <literal>A</literal> for all debugging options. Debug level 0 logs only the most important messages; level 1 is normal; level 3 and above are primarily for debugging and slow operations considerably.</para></listitem>
834 </varlistentry>
835
836
837 <varlistentry><term><literal>-E</literal></term>
838 <listitem><para>Sends all messages to stderr instead of stdout.</para></listitem>
839 </varlistentry>
840
841
842 <varlistentry><term><literal>-I</literal> <replaceable>IP_address</replaceable> </term>
843 <listitem><para>Sets the IP address of the server to which it connects.</para></listitem>
844 </varlistentry>
845
846
847 <varlistentry><term><literal>-i</literal> <replaceable>scope</replaceable></term>
848 <listitem><para>This sets a NetBIOS scope identifier. Only machines with the same identifier will communicate with the server. The scope identifier was a predecessor to workgroups, and this option is included only for backward compatibility.</para></listitem>
849 </varlistentry>
850
851
852 <varlistentry><term><literal>-l</literal> <replaceable>log_file</replaceable></term>
853 <listitem><para>Sends the log messages to the specified file.</para></listitem>
854 </varlistentry>
855
856
857 <varlistentry><term><literal>-N</literal></term>
858 <listitem><para>Suppresses the password prompt. Unless a password is specified on the command line or this parameter is specified, the client will prompt for a password.</para></listitem>
859 </varlistentry>
860
861
862 <varlistentry><term><literal>-n</literal> <replaceable>NetBIOS_name</replaceable></term>
863 <listitem><para>This option allows you to override the NetBIOS name by which the daemon will advertise itself.</para></listitem>
864 </varlistentry>
865 </variablelist>
866
867
868 <variablelist>
869 <varlistentry><term><literal>-O</literal> <replaceable>socket_options</replaceable></term>
870 <listitem><para>Sets the TCP/IP socket options using the same parameters as the <literal>socket</literal> <literal>options</literal> configuration option. It is often used for performance tuning and testing.</para></listitem>
871 </varlistentry>
872
873
874 <varlistentry><term><literal>-p</literal> <replaceable>port_number</replaceable></term>
875 <listitem><para>Sets the port number from which the client will accept requests.</para></listitem>
876 </varlistentry>
877
878
879 <varlistentry><term><literal>-R</literal> <replaceable>resolve_order</replaceable></term>
880 <listitem><para>Sets the resolve order of the name servers. This option is similar to the <literal>resolve</literal> <literal>order</literal> configuration option, and can take any of the four parameters, <literal>lmhosts</literal>, <literal>host</literal>, <literal>wins</literal>, and <literal>bcast</literal>, in any order .</para></listitem>
881 </varlistentry>
882
883
884 <varlistentry><term><literal>-s</literal> <replaceable>configuration_file</replaceable></term>
885 <listitem><para>Specifies the location of the Samba configuration file. Used for debugging.</para></listitem>
886 </varlistentry>
887
888
889 <varlistentry><term><literal>-t</literal> <replaceable>terminal_code</replaceable></term>
890 <listitem><para>Sets the terminal code for Asian languages.</para></listitem>
891 </varlistentry>
892
893
894 <varlistentry><term><literal>-U</literal> <replaceable>username</replaceable></term>
895 <listitem><para>Sets the username and optionally password (e.g., <literal>-U</literal> <literal>fred%secret</literal>).</para></listitem>
896 </varlistentry>
897
898
899 <varlistentry><term><literal>-W</literal> <replaceable>workgroup</replaceable></term>
900 <listitem><para>Specifies the workgroup that you want the client to connect as.</para></listitem>
901 </varlistentry>
902 </variablelist>
903
904
905 <para>If you want to test a particular name service, run <emphasis>smbclient</emphasis> with <literal>-R</literal> and just the name of the service. This will force <emphasis>smbclient</emphasis> to use only the service you gave.<emphasis></emphasis>
906 <indexterm id="appd-idx-993802-0" class="endofrange" startref="appd-idx-993745-0"/>
907 <indexterm id="appd-idx-993802-1" class="endofrange" startref="appd-idx-993745-1"/></para>
908 </sect3>
909 </sect2>
910
911
912
913
914
915 <sect2 role="" label="D.1.6" id="appd-SECT-1.6">
916 <title>smbstatus</title>
917
918
919 <para>The <filename>smbstatus</filename>
920 <indexterm id="appd-idx-993754-0"><primary>smbstatus program</primary></indexterm>
921 <indexterm id="appd-idx-993754-1"><primary>connections</primary><secondary>current, list of</secondary></indexterm> program lists the current connections on a Samba server. There are three separate sections. The first section lists various shares that are in use by specific users. The second section lists the locked files that Samba currently has on all of its shares. Finally, the third section lists the amount of memory usage for each of the shares. For example:</para>
922
923
924 <programlisting># <emphasis role="bold">smbstatus</emphasis>
925 Samba version 2.0.3
926 Service      uid      gid      pid     machine
927 ----------------------------------------------
928 network      davecb   davecb   7470   phoenix  (192.168.220.101) Sun May 16
929 network      davecb   davecb   7589   chimaera (192.168.220.102) Sun May 16
930
931 Locked files:
932 Pid    DenyMode   R/W        Oplock           Name
933 --------------------------------------------------
934 7589   DENY_NONE  RDONLY   EXCLUSIVE+BATCH  /home/samba/quicken/inet/common/system/help.bmp
935 Sun May 16 21:23:40 1999
936 7470   DENY_WRITE RDONLY   NONE             /home/samba/word/office/findfast.exe
937 Sun May 16 20:51:08 1999
938 7589   DENY_WRITE RDONLY   EXCLUSIVE+BATCH  /home/samba/quicken/lfbmp70n.dll
939 Sun May 16 21:23:39 1999
940 7589   DENY_WRITE RDWR     EXCLUSIVE+BATCH  /home/samba/quicken/inet/qdata/runtime.dat
941 Sun May 16 21:23:41 1999
942 7470   DENY_WRITE RDONLY   EXCLUSIVE+BATCH  /home/samba/word/office/osa.exe
943 Sun May 16 20:51:09 1999
944 7589   DENY_WRITE RDONLY   NONE             /home/samba/quicken/qversion.dll
945 Sun May 16 21:20:33 1999
946 7470   DENY_WRITE RDONLY   NONE             /home/samba/quicken/qversion.dll
947 Sun May 16 20:51:11 1999
948
949 Share mode memory usage (bytes):
950    1043432(99%) free + 4312(0%) used + 832(0%) overhead = 1048576(100%) total</programlisting>
951
952
953 <sect3 role="" label="D.1.6.1" id="appd-SECT-1.6.1">
954 <title>Options</title>
955
956
957 <variablelist>
958 <varlistentry><term><literal>-b</literal></term>
959 <listitem><para>Forces <filename>smbstatus</filename> to produce brief output. This includes the version of Samba and auditing information about the users that have logged into the server.</para></listitem>
960 </varlistentry>
961
962
963 <varlistentry><term><literal>-d</literal></term>
964 <listitem><para>Gives verbose output, including each of the three reporting sections listed in the previous example. This is the default.</para></listitem>
965 </varlistentry>
966
967
968 <varlistentry><term><literal>-L</literal></term>
969 <listitem><para>Forces <filename>smbstatus</filename> to print only the current file locks it has. This corresponds to the second section in a verbose output.</para></listitem>
970 </varlistentry>
971
972
973 <varlistentry><term><literal>-p</literal></term>
974 <listitem><para>Prints a list of <filename>smbd</filename> process IDs only. This is often used for scripts.</para></listitem>
975 </varlistentry>
976
977
978 <varlistentry><term><literal>-S</literal></term>
979 <listitem><para>Prints only a list of shares and their connections. This corresponds to the first section in a verbose output.</para></listitem>
980 </varlistentry>
981
982
983 <varlistentry><term><literal>-s</literal> <replaceable>configuration_file</replaceable></term>
984 <listitem><para>Sets the Samba configuration file to use when processing this command.</para></listitem>
985 </varlistentry>
986
987
988 <varlistentry><term><literal>-u</literal> <replaceable>username</replaceable></term>
989 <listitem><para>Limits the <filename>smbstatus</filename> report to the activity of a single user.</para></listitem>
990 </varlistentry>
991 </variablelist>
992 </sect3>
993 </sect2>
994
995
996
997
998
999 <sect2 role="" label="D.1.7" id="appd-SECT-1.7">
1000 <title>smbtar</title>
1001
1002
1003 <para>The <emphasis>smbtar</emphasis>
1004 <indexterm id="appd-idx-993755-0"><primary>smbtar program</primary><secondary>tar operations and</secondary></indexterm>
1005 <indexterm id="appd-idx-993755-1"><primary>tar operations</primary></indexterm> program is a shell script on top of <emphasis>smbclient</emphasis> that gives the program more intelligible options when doing tar operations. Functionally, it is equivalent to the Unix <emphasis>tar</emphasis> program.</para>
1006
1007
1008 <sect3 role="" label="D.1.7.1" id="appd-SECT-1.7.1">
1009 <title>Options</title>
1010
1011
1012 <variablelist>
1013 <varlistentry><term><literal>-a</literal></term>
1014 <listitem><para>Resets the archive bit mode</para></listitem>
1015 </varlistentry>
1016
1017
1018 <varlistentry><term><literal>-b</literal> <replaceable>blocksize</replaceable></term>
1019 <listitem><para>Blocking size. Defaults to 20.</para></listitem>
1020 </varlistentry>
1021
1022
1023 <varlistentry><term><literal>-d</literal> <replaceable>directory</replaceable></term>
1024 <listitem><para>Changes to initial directory before restoring or backing up files.</para></listitem>
1025 </varlistentry>
1026
1027
1028 <varlistentry><term><literal>-i</literal></term>
1029 <listitem><para>Incremental mode; tar files are backed up only if they have the DOS archive bit set. The archive bit is reset after each file is read.</para></listitem>
1030 </varlistentry>
1031
1032
1033 <varlistentry><term><literal>-l</literal> <replaceable>log_level</replaceable></term>
1034 <listitem><para> Sets the logging level.</para></listitem>
1035 </varlistentry>
1036
1037
1038 <varlistentry><term><literal>-N</literal> <replaceable>filename</replaceable></term>
1039 <listitem><para>Backs up only the files newer than the last modification date of <replaceable>filename</replaceable>. For incremental backups.</para></listitem>
1040 </varlistentry>
1041
1042
1043 <varlistentry><term><literal>-p</literal> <replaceable>password</replaceable></term>
1044 <listitem><para>Specifies the password to use to access a share.</para></listitem>
1045 </varlistentry>
1046
1047
1048 <varlistentry><term><literal>-r</literal></term>
1049 <listitem><para>Restores files to the share from the tar file.</para></listitem>
1050 </varlistentry>
1051
1052
1053 <varlistentry><term><literal>-s</literal> <replaceable>server</replaceable></term>
1054 <listitem><para>Specifies the SMB/CIFS server in which the share resides.</para></listitem>
1055 </varlistentry>
1056
1057
1058 <varlistentry><term><literal>-t</literal> <replaceable>tape</replaceable></term>
1059 <listitem><para>Tape device or file. Default is the value of the environment variable <literal>$TAPE</literal>, or <emphasis>tar.out</emphasis> if <literal>$TAPE</literal> isn't set.</para></listitem>
1060 </varlistentry>
1061
1062
1063 <varlistentry><term><literal>-u</literal> <replaceable>user</replaceable></term>
1064 <listitem><para>Specifies the user to connect to the share as. You can specify the password as well, in the format <replaceable>username</replaceable><literal>%</literal><replaceable>password</replaceable>.</para></listitem>
1065 </varlistentry>
1066
1067
1068 <varlistentry><term><literal>-v</literal></term>
1069 <listitem><para>Specifies the use of verbose mode.</para></listitem>
1070 </varlistentry>
1071
1072
1073 <varlistentry><term><literal>-X</literal> <replaceable>file</replaceable></term>
1074 <listitem><para>Tells <firstterm>smbtar</firstterm> to exclude the specified file from the <emphasis>tar</emphasis> create or restore.</para></listitem>
1075 </varlistentry>
1076
1077
1078 <varlistentry><term><literal>-x</literal> <replaceable>share</replaceable></term>
1079 <listitem><para>States the share name on the server to connect to. The default is <literal>backup</literal>, which is a common share name to perform backups with.</para></listitem>
1080 </varlistentry>
1081 </variablelist>
1082
1083
1084 <para>For example, a trivial backup command to archive the data for user <literal>sue</literal> is:</para>
1085
1086
1087 <programlisting># <emphasis role="bold">smbtar -s pc_name -x sue -u sue -p secret -t sue.tar</emphasis></programlisting>
1088 </sect3>
1089 </sect2>
1090
1091
1092
1093
1094
1095 <sect2 role="" label="D.1.8" id="appd-SECT-1.8">
1096 <title>nmblookup</title>
1097
1098
1099 <para>The <filename>nmblookup</filename>
1100 <indexterm id="appd-idx-993756-0"><primary>nmblookup program</primary></indexterm>
1101 <indexterm id="appd-idx-993756-1"><primary>name services</primary><secondary>nmblookup program</secondary></indexterm> program is a client program that exercises the NetBIOS-over-UDP/IP name service for resolving NBT machine names into IP addresses. The command works by broadcasting its queries on the local subnet until a machine with that name responds. You can think of it as a Windows <emphasis>nslookup(1)</emphasis> or <emphasis>dig(1)</emphasis>. This is useful for looking up both normal NetBIOS names, and the odd ones like <literal>_ _MSBROWSE_ _</literal> that the Windows name services use to provide directory-like services. If you wish to query for a particular type of NetBIOS name, add the NetBIOS <literal>&lt;type&gt;</literal> to the end of the name.</para>
1102
1103
1104 <para>The command line is:</para>
1105
1106
1107 <programlisting>nmblookup [-options] <replaceable>name</replaceable></programlisting>
1108
1109
1110 <para>The options supported are:</para>
1111
1112
1113 <variablelist>
1114 <varlistentry><term><literal>-A</literal></term>
1115 <listitem><para>Interprets <replaceable>name</replaceable> as an IP address and do a node-status query on this address.</para></listitem>
1116 </varlistentry>
1117
1118
1119 <varlistentry><term><literal>-B</literal> <replaceable>broadcast _address</replaceable></term>
1120 <listitem><para>Sends the query to the given broadcast address. The default is to send the query to the broadcast address of the primary network interface.</para></listitem>
1121 </varlistentry>
1122
1123
1124 <varlistentry><term><literal>-d</literal> <replaceable>debuglevel</replaceable></term>
1125 <listitem><para>Sets the debug (sometimes called logging) level. The level can range from 0 all the way to 10. Debug level 0 logs only the most important messages; level 1 is normal; level 3 and above are primarily for debugging and slow the program considerably.</para></listitem>
1126 </varlistentry>
1127
1128
1129 <varlistentry><term><literal>-h</literal></term>
1130 <listitem><para>Prints command-line usage information for the program.</para></listitem>
1131 </varlistentry>
1132
1133
1134 <varlistentry><term><literal>-i</literal> <replaceable>scope</replaceable></term>
1135 <listitem><para>Sets a NetBIOS scope identifier. Only machines with the same identifier will communicate with the server. The scope identifier was a predecessor to workgroups, and this option is included only for backward compatibility.</para></listitem>
1136 </varlistentry>
1137
1138
1139 <varlistentry><term><literal>-M</literal></term>
1140 <listitem><para>Searches for a local master browser. This is done with a broadcast searching for a machine that will respond to the special name <literal>_ _MSBROWSE_ _ </literal>, and then asking that machine for information, instead of broadcasting the query itself.</para></listitem>
1141 </varlistentry>
1142
1143
1144 <varlistentry><term><literal>-R</literal></term>
1145 <listitem><para>Sets the recursion desired bit in the packet. This will cause the machine that responds to try to do a WINS lookup and return the address and any other information the WINS server has saved.</para></listitem>
1146 </varlistentry>
1147
1148
1149 <varlistentry><term><literal>-r</literal></term>
1150 <listitem><para>Use the root port of 137 for Windows 95 machines.</para></listitem>
1151 </varlistentry>
1152
1153
1154 <varlistentry><term><literal>-S</literal></term>
1155 <listitem><para>Once the name query has returned an IP address, does a node status query as well. This returns all the resource types that the machine knows about, with their numeric attributes. For example:</para></listitem>
1156 </varlistentry>
1157 </variablelist>
1158
1159
1160 <programlisting>% <emphasis role="bold">nmblookup -d 4 -S elsbeth</emphasis>
1161 received 6 names
1162       ELSBETH                &lt;00&gt; - &lt;GROUP&gt; B &lt;ACTIVE&gt;
1163       ELSBETH                &lt;03&gt; -         B &lt;ACTIVE&gt;
1164       ELSBETH                &lt;1d&gt; -         B &lt;ACTIVE&gt;
1165       ELSBETH                &lt;1e&gt; - &lt;GROUP&gt; B &lt;ACTIVE&gt;
1166       ELSBETH                &lt;20&gt; -         B &lt;ACTIVE&gt;
1167       .._ _MSBROWSE_   _..   &lt;01&gt; - &lt;GROUP&gt; B &lt;ACTIVE&gt;</programlisting>
1168
1169
1170 <variablelist>
1171 <varlistentry><term><literal>-s</literal> <replaceable>configuration_file</replaceable></term>
1172 <listitem><para>Specifies the location of the Samba configuration file. Although the file defaults to <filename>/usr/local/samba/lib/smb.conf</filename>, you can override it here on the command-line, normally for debugging.</para></listitem>
1173 </varlistentry>
1174
1175
1176 <varlistentry><term><literal>-T</literal></term>
1177 <listitem><para>This option can be used to translate IP addresses into resolved names.</para></listitem>
1178 </varlistentry>
1179
1180
1181 <varlistentry><term><literal>-U</literal> <replaceable>unicast_address</replaceable></term>
1182 <listitem><para>Performs a unicast query to the specified address. Used with <literal>-R</literal> to query WINS servers.</para></listitem>
1183 </varlistentry>
1184 </variablelist>
1185
1186
1187 <para>Note that there is no workgroup option for <emphasis>nmblookup</emphasis> ; you can get around this by putting <literal>workgroup</literal> <literal>=</literal> <replaceable>workgroup_name </replaceable>in a file and passing it to <emphasis>nmblookup</emphasis> with the <literal>-s</literal> <replaceable>smb.conf_file</replaceable> option.</para>
1188 </sect2>
1189
1190
1191
1192
1193
1194 <sect2 role="" label="D.1.9" id="appd-SECT-1.9">
1195 <title>smbpasswd</title>
1196
1197
1198 <para>The <emphasis>smbpasswd</emphasis>
1199 <indexterm id="appd-idx-993757-0"><primary>smbpasswd program</primary></indexterm>
1200 <indexterm id="appd-idx-993757-1"><primary>passwords</primary><secondary>smbpasswd program </secondary></indexterm> password has two distinct sets of functions. When run by users, it changes their encrypted passwords. When run by <literal>root</literal>, it updates the encrypted password file. When run by an ordinary user with no options, it connects to the primary domain controller and changes his or her Windows password.</para>
1201
1202
1203 <para>The program will fail if <emphasis>smbd</emphasis> is not operating, if the <literal>hosts</literal> <literal>allow</literal> or <literal>hosts</literal> <literal>deny</literal> configuration options will not permit connections from localhost (IP address 127.0.0.1), or the <literal>encrypted</literal> <literal>passwords</literal> <literal>=</literal> <literal>no</literal> option is set.</para>
1204
1205
1206 <sect3 role="" label="D.1.9.1" id="appd-SECT-1.9.1">
1207 <title>Regular user options</title>
1208
1209
1210 <variablelist>
1211 <varlistentry><term><literal>-D</literal> <replaceable>debug_level</replaceable></term>
1212 <listitem><para>Sets the debug (also called logging) level. The level can range from 0 to 10. Debug level 0 logs only the most important messages; level 1 is normal; level 3 and above are primarily for debugging and slow the program considerably.</para></listitem>
1213 </varlistentry>
1214
1215
1216 <varlistentry><term><literal>-h</literal></term>
1217 <listitem><para>Prints command-line usage information for the program.</para></listitem>
1218 </varlistentry>
1219
1220
1221 <varlistentry><term><literal>-r</literal> <replaceable>remote_machine_name</replaceable></term>
1222 <listitem><para>Specifies on which machine the password should change. The remote machine must be a primary domain controller (PDC).</para></listitem>
1223 </varlistentry>
1224
1225
1226 <varlistentry><term><literal>-R</literal> <replaceable>resolve_order</replaceable></term>
1227 <listitem><para>Sets the resolve order of the name servers. This option is similar to the <literal>resolve</literal> <literal>order</literal> configuration option, and can take any of the four parameters, <literal>lmhosts</literal>, <literal>host</literal>, <literal>wins</literal>, and <literal>bcast</literal>,<literal> </literal>in any order.</para></listitem>
1228 </varlistentry>
1229
1230
1231 <varlistentry><term><literal>-U</literal> <replaceable>username</replaceable></term>
1232 <listitem><para>Used only with <literal>-r</literal>, to modify a username that is spelled differently on the remote machine.</para></listitem>
1233 </varlistentry>
1234 </variablelist>
1235 </sect3>
1236
1237
1238
1239 <sect3 role="" label="D.1.9.2" id="appd-SECT-1.9.2">
1240 <title>Root-only options</title>
1241
1242
1243 <variablelist>
1244 <varlistentry><term><literal>-a</literal> <replaceable>username</replaceable></term>
1245 <listitem><para>Adds a user to the encrypted password file.</para></listitem>
1246 </varlistentry>
1247
1248
1249 <varlistentry><term><literal>-d</literal> <replaceable>username</replaceable></term>
1250 <listitem><para>Disables a user in the encrypted password file.</para></listitem>
1251 </varlistentry>
1252
1253
1254 <varlistentry><term><literal>-e</literal> <replaceable>username</replaceable></term>
1255 <listitem><para>Enables a disabled user in the encrypted password file.</para></listitem>
1256 </varlistentry>
1257
1258
1259 <varlistentry><term><literal>-m</literal> <replaceable>machine_name</replaceable></term>
1260 <listitem><para>Changes a machine account's password. The machine accounts are used to authenticate machines when they connect to a primary or backup domain controller.</para></listitem>
1261 </varlistentry>
1262
1263
1264 <varlistentry><term><literal>-j</literal> <replaceable>domain_name</replaceable></term>
1265 <listitem><para>Adds a Samba server to a Windows NT Domain.</para></listitem>
1266 </varlistentry>
1267
1268
1269 <varlistentry><term><literal>-n</literal></term>
1270 <listitem><para>Sets no password for the user.</para></listitem>
1271 </varlistentry>
1272
1273
1274 <varlistentry><term><literal>-s</literal> <replaceable>username</replaceable></term>
1275 <listitem><para>Causes <emphasis>smbpasswd</emphasis> to be silent and to read its old and new passwords from standard input, rather than from <filename>/dev/tty</filename>. This is useful for writing scripts.</para></listitem>
1276 </varlistentry>
1277 </variablelist>
1278 </sect3>
1279 </sect2>
1280
1281
1282
1283
1284
1285 <sect2 role="" label="D.1.10" id="appd-SECT-1.10">
1286 <title>testparm</title>
1287
1288
1289 <para>The <emphasis>testparm</emphasis>
1290 <indexterm id="appd-idx-993999-0"><primary>testparm program</primary></indexterm>
1291 <indexterm id="appd-idx-993999-1"><primary>smb.conf (Samba configuration) file</primary><secondary>testparm program for</secondary></indexterm> program checks an <filename>smb.conf</filename> file for obvious errors and self-consistency. Its command line is:</para>
1292
1293
1294 <programlisting>testparm [options] <replaceable>configfile_name [hostname IP_addr]</replaceable></programlisting>
1295
1296
1297 <para>If the configuration file is not specified, the file at <replaceable>samba_dir</replaceable><filename>/lib/smb.conf</filename> is checked by default. If you specify a hostname and an IP address, an extra check will be made to ensure that the specified machine would be allowed to connect to Samba. If a hostname is specified, an IP address should be present as well.</para>
1298
1299
1300 <sect3 role="" label="D.1.10.1" id="appd-SECT-1.10.1">
1301 <title>Options</title>
1302
1303
1304 <variablelist>
1305 <varlistentry><term><literal>-h</literal></term>
1306 <listitem><para>Prints command-line information for the program.</para></listitem>
1307 </varlistentry>
1308
1309
1310 <varlistentry><term><literal>-L</literal> server_name</term>
1311 <listitem><para>Resets the <literal>%L</literal> configuration variable to the specified server name.</para></listitem>
1312 </varlistentry>
1313
1314
1315 <varlistentry><term><literal>-s</literal></term>
1316 <listitem><para>This option prevents the <emphasis>testparm</emphasis> program from prompting the user to press the Enter key before printing a list of the configuration options for the server.</para></listitem>
1317 </varlistentry>
1318 </variablelist>
1319 </sect3>
1320 </sect2>
1321
1322
1323
1324
1325
1326 <sect2 role="" label="D.1.11" id="appd-SECT-1.11">
1327 <title>testprns</title>
1328
1329
1330 <para>The<indexterm id="appd-idx-993761-0"><primary>testprns program</primary></indexterm>
1331 <indexterm id="appd-idx-993761-1"><primary>printers</primary><secondary>names</secondary><tertiary>checking</tertiary></indexterm> <emphasis>testprns</emphasis> program checks a specified printer name against the system printer capabilities (<filename>printcap</filename>) file. Its command line is:</para>
1332
1333
1334 <programlisting>testprns <replaceable>printername</replaceable> [<replaceable>printcapname</replaceable>]</programlisting>
1335
1336
1337 <para>If the <literal>printcapname</literal> isn't specified, Samba attempts to use one located in the <filename>smb.conf</filename> file. If one isn't specified there, Samba will try <filename>/etc/printcap</filename>. If that fails, the program will generate an error.</para>
1338 </sect2>
1339
1340
1341
1342
1343
1344 <sect2 role="" label="D.1.12" id="appd-SECT-1.12">
1345 <title>rpcclient</title>
1346
1347
1348 <para>This is a new client that exercises the <indexterm id="appd-idx-993762-0"><primary>RPC (remote procedure call)</primary></indexterm>
1349 <indexterm id="appd-idx-993762-1"><primary>remote procedure call (RPC)</primary></indexterm>RPC (remote procedure call) interfaces of an SMB server. Like <emphasis>smbclient</emphasis>, <emphasis>rpcclient</emphasis>
1350 <indexterm id="appd-idx-993763-0"><primary>rpcclient program</primary></indexterm> started its life as a test program for the Samba developers and will likely stay that way for a while. Its command line is:</para>
1351
1352
1353 <programlisting>rpcclient //<replaceable>server</replaceable>/<replaceable>share</replaceable></programlisting>
1354
1355
1356 <para>The command-line options are the same as the Samba 2.0 <emphasis>smbclient</emphasis>, and the operations you can try are listed in <link linkend="appd-65243">Table 4.4</link>.</para>
1357
1358
1359 <table label="D.4" id="appd-65243">
1360 <title>rpcclient commands </title>
1361
1362 <tgroup cols="2">
1363 <colspec colnum="1" colname="col1"/>
1364 <colspec colnum="2" colname="col2"/>
1365 <thead>
1366 <row>
1367
1368 <entry colname="col1"><para>Command</para></entry>
1369
1370 <entry colname="col2"><para>Description</para></entry>
1371
1372 </row>
1373
1374 </thead>
1375
1376 <tbody>
1377 <row>
1378
1379 <entry colname="col1"><para><literal>regenum keyname</literal></para></entry>
1380
1381 <entry colname="col2"><para>Registry Enumeration (keys, values)</para></entry>
1382
1383 </row>
1384
1385 <row>
1386
1387 <entry colname="col1"><para><literal>regdeletekey keyname </literal></para></entry>
1388
1389 <entry colname="col2"><para>Registry Key Delete</para></entry>
1390
1391 </row>
1392
1393 <row>
1394
1395 <entry colname="col1"><para><literal>regcreatekey keyname [keyvalue]</literal></para></entry>
1396
1397 <entry colname="col2"><para>Registry Key Create</para></entry>
1398
1399 </row>
1400
1401 <row>
1402
1403 <entry colname="col1"><para><literal>regquerykey keyname</literal></para></entry>
1404
1405 <entry colname="col2"><para>Registry Key Query</para></entry>
1406
1407 </row>
1408
1409 <row>
1410
1411 <entry colname="col1"><para><literal>regdeleteval valname</literal></para></entry>
1412
1413 <entry colname="col2"><para>Registry Value Delete</para></entry>
1414
1415 </row>
1416
1417 <row>
1418
1419 <entry colname="col1"><para><literal>regcreateval valname valtype value</literal></para></entry>
1420
1421 <entry colname="col2"><para>Registry Key Create</para></entry>
1422
1423 </row>
1424
1425 <row>
1426
1427 <entry colname="col1"><para><literal>reggetsec keyname</literal></para></entry>
1428
1429 <entry colname="col2"><para>Registry Key Security</para></entry>
1430
1431 </row>
1432
1433 <row>
1434
1435 <entry colname="col1"><para><literal>regtestsec keyname</literal></para></entry>
1436
1437 <entry colname="col2"><para>Test Registry Key Security</para></entry>
1438
1439 </row>
1440
1441 <row>
1442
1443 <entry colname="col1"><para><literal>ntlogin [username] [password]</literal></para></entry>
1444
1445 <entry colname="col2"><para>NT Domain Login Test</para></entry>
1446
1447 </row>
1448
1449 <row>
1450
1451 <entry colname="col1"><para><literal>wksinfo</literal></para></entry>
1452
1453 <entry colname="col2"><para>Workstation Query Info</para></entry>
1454
1455 </row>
1456
1457 <row>
1458
1459 <entry colname="col1"><para><literal>srvinfo</literal></para></entry>
1460
1461 <entry colname="col2"><para>Server Query Info</para></entry>
1462
1463 </row>
1464
1465 <row>
1466
1467 <entry colname="col1"><para><literal>srvsessions</literal></para></entry>
1468
1469 <entry colname="col2"><para>List Sessions on a Server</para></entry>
1470
1471 </row>
1472
1473 <row>
1474
1475 <entry colname="col1"><para><literal>srvshares</literal></para></entry>
1476
1477 <entry colname="col2"><para>List shares on a server</para></entry>
1478
1479 </row>
1480
1481 <row>
1482
1483 <entry colname="col1"><para><literal>srvconnections</literal></para></entry>
1484
1485 <entry colname="col2"><para>List connections on a server</para></entry>
1486
1487 </row>
1488
1489 <row>
1490
1491 <entry colname="col1"><para><literal>srvfiles</literal></para></entry>
1492
1493 <entry colname="col2"><para>List files on a server</para></entry>
1494
1495 </row>
1496
1497 <row>
1498
1499 <entry colname="col1"><para><literal>lsaquery</literal></para></entry>
1500
1501 <entry colname="col2"><para>Query Info Policy (domain member or server)</para></entry>
1502
1503 </row>
1504
1505 <row>
1506
1507 <entry colname="col1"><para><literal>lookupsids</literal></para></entry>
1508
1509 <entry colname="col2"><para>Resolve names from SIDs</para></entry>
1510
1511 </row>
1512
1513 <row>
1514
1515 <entry colname="col1"><para><literal>ntpass</literal></para></entry>
1516
1517 <entry colname="col2"><para>NT SAM Password Change</para></entry>
1518
1519 </row>
1520
1521 </tbody>
1522 </tgroup>
1523 </table>
1524 </sect2>
1525
1526
1527
1528
1529
1530 <sect2 role="" label="D.1.13" id="appd-SECT-1.13">
1531 <title>tcpdump</title>
1532
1533
1534 <para>The <emphasis>tcpdump</emphasis>
1535 <indexterm id="appd-idx-993765-0"><primary>tcpdump utility</primary></indexterm>
1536 <indexterm id="appd-idx-993765-1"><primary>packets</primary><secondary>headers for, tcpdump utility and</secondary></indexterm> utility, a classic system administration tool, dumps all the packet headers it sees on an interface that match an expression. The version included in the Samba distribution is enhanced to understand the SMB protocol. The <emphasis>expression</emphasis> is a logical expression with "and," "or," and "not," although sometimes it's very simple. For example, <literal>host</literal> <literal>escrime</literal> would select every packet going to or from <literal>escrime</literal>. The expression is normally one or more of:</para>
1537
1538
1539 <itemizedlist>
1540
1541 <listitem><para><literal>host</literal> <replaceable>name</replaceable></para></listitem>
1542
1543 <listitem><para><literal>ne</literal>t <replaceable>network_number</replaceable></para></listitem>
1544 <listitem><para><literal>port</literal> <replaceable>number</replaceable></para></listitem>
1545 <listitem><para><literal>src</literal> <replaceable>name </replaceable></para></listitem>
1546 <listitem><para><literal>dst</literal> <replaceable>name</replaceable></para></listitem>
1547 </itemizedlist>
1548
1549 <para>The most common options are <literal>src</literal> (source), <literal>dst</literal> (destination), and <literal>port</literal>. For example, in the book we used the command:</para>
1550
1551
1552 <programlisting>tcpdump port not telnet</programlisting>
1553
1554
1555 <para>This dumps all the packets except telnet; we were logged-in via telnet and  wanted to see only the SMB packets.</para>
1556
1557
1558 <para>Another <emphasis>tcpdump</emphasis> example is selecting traffic between server and either <literal>sue</literal> or <literal>joe</literal>:</para>
1559
1560
1561 <programlisting>tcpdump host server and \( sue or joe \)</programlisting>
1562
1563
1564 <para>We recommend using the <literal>-s</literal> <literal>1500</literal> option so that you capture all of the SMB messages sent, instead of just the header information.</para>
1565
1566
1567 <sect3 role="" label="D.1.13.1" id="appd-SECT-1.13.1">
1568 <title>Options</title>
1569
1570
1571 <para>There are many options, and many other kinds of expressions that can be used with <emphasis>tcpdump</emphasis>. See the manual page for details on the advanced options. The most common options are as follows:</para>
1572
1573
1574 <variablelist>
1575 <varlistentry><term><literal>-c</literal> <replaceable>count</replaceable></term>
1576 <listitem><para>Forces the program to exit after receiving the specified number of packets.</para></listitem>
1577 </varlistentry>
1578
1579
1580 <varlistentry><term><literal>-F</literal> <replaceable>file</replaceable></term>
1581 <listitem><para>Reads the expression from the specified file and ignores expressions on the command line.</para></listitem>
1582 </varlistentry>
1583
1584
1585 <varlistentry><term><literal>-i</literal> <replaceable>interface</replaceable></term>
1586 <listitem><para>Forces the program to listen on the specified interface.</para></listitem>
1587 </varlistentry>
1588
1589
1590 <varlistentry><term><literal>-r</literal> <replaceable>file</replaceable></term>
1591 <listitem><para>Reads packets from the specified file (captured with <literal>-w</literal>).</para></listitem>
1592 </varlistentry>
1593
1594
1595 <varlistentry><term><literal>-s</literal> <replaceable>length</replaceable></term>
1596 <listitem><para>Saves the specified number of bytes of data from each packet (rather than 68 bytes).</para></listitem>
1597 </varlistentry>
1598
1599
1600 <varlistentry><term><literal>-w</literal> <replaceable>file</replaceable></term>
1601 <listitem><para>Writes the packets to the specified file.<indexterm id="appd-idx-993743-0" class="endofrange" startref="appd-idx-994034-0"/></para></listitem>
1602 </varlistentry>
1603 </variablelist>
1604 </sect3>
1605 </sect2>
1606 </sect1>
1607
1608
1609
1610
1611
1612
1613
1614
1615 </appendix>