1 <chapter id="problems">
7 <pubdate>8 Apr 2003</pubdate>
10 <title>Analysing and solving samba problems</title>
13 There are many sources of information available in the form
14 of mailing lists, RFC's and documentation. The docs that come
15 with the samba distribution contain very good explanations of
16 general SMB topics such as browsing.</para>
19 <title>Diagnostics tools</title>
21 <para>With SMB networking, it is often not immediately clear what
22 the cause is of a certain problem. Samba itself provides rather
23 useful information, but in some cases you might have to fall back
24 to using a <emphasis>sniffer</emphasis>. A sniffer is a program that
25 listens on your LAN, analyses the data sent on it and displays it
29 <title>Debugging with Samba itself</title>
32 One of the best diagnostic tools for debugging problems is Samba itself.
33 You can use the <option>-d option</option> for both &smbd; and &nmbd; to specify what
34 <smbconfoption><name>debug level</name></smbconfoption> at which to run. See the man pages on smbd, nmbd and
35 smb.conf for more information on debugging options. The debug
36 level can range from 1 (the default) to 10 (100 for debugging passwords).
40 Another helpful method of debugging is to compile samba using the
41 <userinput>gcc -g </userinput> flag. This will include debug
42 information in the binaries and allow you to attach gdb to the
43 running smbd / nmbd process. In order to attach gdb to an smbd
44 process for an NT workstation, first get the workstation to make the
45 connection. Pressing ctrl-alt-delete and going down to the domain box
46 is sufficient (at least, on the first time you join the domain) to
47 generate a 'LsaEnumTrustedDomains'. Thereafter, the workstation
48 maintains an open connection, and therefore there will be an smbd
49 process running (assuming that you haven't set a really short smbd
50 idle timeout) So, in between pressing ctrl alt delete, and actually
51 typing in your password, you can attach gdb and continue.
55 Some useful samba commands worth investigating:
59 &prompt;<userinput>testparm | more</userinput>
60 &prompt;<userinput>smbclient -L //{netbios name of server}</userinput>
66 <title>Tcpdump</title>
68 <para><ulink url="http://www.tcpdump.org/">Tcpdump</ulink> was the first
69 unix sniffer with SMB support. It is a command-line utility and
70 nowadays, it's SMB support is somewhat less then that of ethereal
76 <title>Ethereal</title>
79 <ulink url="http://www.ethereal.com/">Ethereal</ulink> is a graphical
80 sniffer, available for both unix (Gtk) and Windows. Ethereal's
81 SMB support is very good.</para>
83 <para>For details on the use of ethereal, read the well-written
84 ethereal User Guide.</para>
87 Listen for data on ports 137, 138, 139 and 445. E.g.
88 use the filter <userinput>port 137 or port 138 or port 139 or port 445</userinput>.</para>
90 <para>A console version of ethereal is available as well and is called
91 <command>tethereal</command>.</para>
96 <title>The Windows Network Monitor</title>
99 For tracing things on the Microsoft Windows NT, Network Monitor
100 (aka. netmon) is available on the Microsoft Developer Network CD's,
101 the Windows NT Server install CD and the SMS CD's. The version of
102 netmon that ships with SMS allows for dumping packets between any two
103 computers (i.e. placing the network interface in promiscuous mode).
104 The version on the NT Server install CD will only allow monitoring
105 of network traffic directed to the local NT box and broadcasts on the
106 local subnet. Be aware that Ethereal can read and write netmon
111 <title>Installing 'Network Monitor' on an NT Workstation</title>
114 Installing netmon on an NT workstation requires a couple
115 of steps. The following are for installing Netmon V4.00.349, which comes
116 with Microsoft Windows NT Server 4.0, on Microsoft Windows NT
117 Workstation 4.0. The process should be similar for other versions of
118 Windows NT / Netmon. You will need both the Microsoft Windows
119 NT Server 4.0 Install CD and the Workstation 4.0 Install CD.
123 Initially you will need to install <application>Network Monitor Tools and Agent</application>
124 on the NT Server. To do this
128 <listitem><para>Goto <guibutton>Start</guibutton> - <guibutton>Settings</guibutton> - <guibutton>Control Panel</guibutton> -
129 <guibutton>Network</guibutton> - <guibutton>Services</guibutton> - <guibutton>Add</guibutton> </para></listitem>
131 <listitem><para>Select the <guilabel>Network Monitor Tools and Agent</guilabel> and
132 click on <guibutton>OK</guibutton>.</para></listitem>
134 <listitem><para>Click <guibutton>OK</guibutton> on the Network Control Panel.
137 <listitem><para>Insert the Windows NT Server 4.0 install CD
138 when prompted.</para></listitem>
142 At this point the Netmon files should exist in
143 <filename>%SYSTEMROOT%\System32\netmon\*.*</filename>.
144 Two subdirectories exist as well, <filename>parsers\</filename>
145 which contains the necessary DLL's for parsing the netmon packet
146 dump, and <filename>captures\</filename>.
150 In order to install the Netmon tools on an NT Workstation, you will
151 first need to install the 'Network Monitor Agent' from the Workstation
156 <listitem><para>Goto <guibutton>Start</guibutton> - <guibutton>Settings</guibutton> - <guibutton>Control Panel</guibutton> -
157 <guibutton>Network</guibutton> - <guibutton>Services</guibutton> - <guibutton>Add</guibutton></para></listitem>
159 <listitem><para>Select the <guilabel>Network Monitor Agent</guilabel> and click
160 on <guibutton>OK</guibutton>.</para></listitem>
162 <listitem><para>Click <guibutton>OK</guibutton> on the Network Control Panel.
165 <listitem><para>Insert the Windows NT Workstation 4.0 install
166 CD when prompted.</para></listitem>
170 Now copy the files from the NT Server in <filename>%SYSTEMROOT%\System32\netmon\*.*</filename>
171 to <filename>%SYSTEMROOT%\System32\netmon\*.*</filename> on the Workstation and set
172 permissions as you deem appropriate for your site. You will need
173 administrative rights on the NT box to run netmon.
178 <title>Installing 'Network Monitor' on an 9x Workstation</title>
180 To install Netmon on a Windows 9x box install the network monitor agent
181 from the Windows 9x CD (<filename>\admin\nettools\netmon</filename>). There is a readme
182 file located with the netmon driver files on the CD if you need
183 information on how to do this. Copy the files from a working
191 <title>Useful URLs</title>
194 <listitem><para>See how Scott Merrill simulates a BDC behavior at
195 <ulink noescape="1" url="http://www.skippy.net/linux/smb-howto.html">
196 http://www.skippy.net/linux/smb-howto.html</ulink>. </para></listitem>
198 <listitem><para>FTP site for older SMB specs:
199 <ulink noescape="1" url="ftp://ftp.microsoft.com/developr/drg/CIFS/">
200 ftp://ftp.microsoft.com/developr/drg/CIFS/</ulink></para></listitem>
207 <title>Getting help from the mailing lists</title>
210 There are a number of Samba related mailing lists. Go to <ulink
211 noescape="1" url="http://samba.org">http://samba.org</ulink>, click on your nearest mirror
212 and then click on <command>Support</command> and then click on <command>
213 Samba related mailing lists</command>.
217 For questions relating to Samba TNG go to
218 <ulink noescape="1" url="http://www.samba-tng.org/">http://www.samba-tng.org/</ulink>
219 It has been requested that you don't post questions about Samba-TNG to the
220 main stream Samba lists.</para>
223 If you post a message to one of the lists please observe the following guide lines :
228 <listitem><para>Always remember that the developers are volunteers, they are
229 not paid and they never guarantee to produce a particular feature at
230 a particular time. Any time lines are 'best guess' and nothing more.
233 <listitem><para>Always mention what version of samba you are using and what
234 operating system its running under. You should probably list the
235 relevant sections of your &smb.conf; file, at least the options
236 in [global] that affect PDC support.</para></listitem>
238 <listitem><para>In addition to the version, if you obtained Samba via
239 CVS mention the date when you last checked it out.</para></listitem>
241 <listitem><para> Try and make your question clear and brief, lots of long,
242 convoluted questions get deleted before they are completely read !
243 Don't post html encoded messages (if you can select colour or font
244 size its html).</para></listitem>
246 <listitem><para> If you run one of those nifty 'I'm on holidays' things when
247 you are away, make sure its configured to not answer mailing lists.
250 <listitem><para> Don't cross post. Work out which is the best list to post to
251 and see what happens, i.e. don't post to both samba-ntdom and samba-technical.
252 Many people active on the lists subscribe to more
253 than one list and get annoyed to see the same message two or more times.
254 Often someone will see a message and thinking it would be better dealt
255 with on another, will forward it on for you.</para></listitem>
257 <listitem><para>You might include <emphasis>partial</emphasis>
258 log files written at a debug level set to as much as 20.
259 Please don't send the entire log but enough to give the context of the
260 error messages.</para></listitem>
262 <listitem><para>(Possibly) If you have a complete netmon trace ( from the opening of
263 the pipe to the error ) you can send the *.CAP file as well.</para></listitem>
265 <listitem><para>Please think carefully before attaching a document to an email.
266 Consider pasting the relevant parts into the body of the message. The samba
267 mailing lists go to a huge number of people, do they all need a copy of your
268 smb.conf in their attach directory?</para></listitem>
275 <title>How to get off the mailing lists</title>
277 <para>To have your name removed from a samba mailing list, go to the
278 same place you went to to get on it. Go to <ulink
279 noescape="1" url="http://lists.samba.org/">http://lists.samba.org</ulink>,
280 click on your nearest mirror and then click on <command>Support</command> and
281 then click on <command> Samba related mailing lists</command>.
285 Please don't post messages to the list asking to be removed, you will just
286 be referred to the above address (unless that process failed in some way...)