trying to get HEAD building again. If you want the code
[abartlet/samba.git/.git] / docs / htmldocs / diagnosis.html
1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 33. The Samba checklist</title><link rel="stylesheet" href="samba.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"><link rel="home" href="index.html" title="SAMBA Project Documentation"><link rel="up" href="troubleshooting.html" title="Part V. Troubleshooting"><link rel="previous" href="troubleshooting.html" title="Part V. Troubleshooting"><link rel="next" href="problems.html" title="Chapter 34. Analysing and solving samba problems"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 33. The Samba checklist</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="troubleshooting.html">Prev</a> </td><th width="60%" align="center">Part V. Troubleshooting</th><td width="20%" align="right"> <a accesskey="n" href="problems.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="diagnosis"></a>Chapter 33. The Samba checklist</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Andrew</span> <span class="surname">Tridgell</span></h3><div class="affiliation"><span class="orgname">Samba Team<br></span><div class="address"><p><tt class="email">&lt;<a href="mailto:tridge@samba.org">tridge@samba.org</a>&gt;</tt></p></div></div></div></div><div><div class="author"><h3 class="author"><span class="firstname">Jelmer</span> <span class="othername">R.</span> <span class="surname">Vernooij</span></h3><div class="affiliation"><span class="orgname">The Samba Team<br></span><div class="address"><p><tt class="email">&lt;<a href="mailto:jelmer@samba.org">jelmer@samba.org</a>&gt;</tt></p></div></div></div></div><div><p class="pubdate">Wed Jan 15</p></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="diagnosis.html#id3006072">Introduction</a></dt><dt><a href="diagnosis.html#id3007931">Assumptions</a></dt><dt><a href="diagnosis.html#id3008108">The tests</a></dt><dt><a href="diagnosis.html#id3009283">Still having troubles?</a></dt></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id3006072"></a>Introduction</h2></div></div><div></div></div><p>
2 This file contains a list of tests you can perform to validate your
3 Samba server. It also tells you what the likely cause of the problem
4 is if it fails any one of these steps. If it passes all these tests
5 then it is probably working fine.
6 </p><p>
7 You should do ALL the tests, in the order shown. We have tried to
8 carefully choose them so later tests only use capabilities verified in
9 the earlier tests.  However, do not stop at the first error as there
10 have been some instances when continuing with the tests has helped
11 to solve a problem.
12 </p><p>
13 If you send one of the samba mailing lists  an email saying &quot;it doesn't work&quot;
14 and you have not followed this test procedure then you should not be surprised
15 if your email is ignored.
16 </p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id3007931"></a>Assumptions</h2></div></div><div></div></div><p>
17 In all of the tests it is assumed you have a Samba server called 
18 BIGSERVER and a PC called ACLIENT both in workgroup TESTGROUP.
19 </p><p>
20 The procedure is similar for other types of clients.
21 </p><p>
22 It is also assumed you know the name of an available share in your
23 <tt class="filename">smb.conf</tt>. I will assume this share is called <i class="replaceable"><tt>tmp</tt></i>.
24 You can add a <i class="replaceable"><tt>tmp</tt></i> share like this by adding the
25 following to <tt class="filename">smb.conf</tt>:
26 </p><pre class="programlisting">
27
28 [tmp]
29  comment = temporary files 
30  path = /tmp
31  read only = yes
32
33 </pre><p>
34 </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
35 These tests assume version 3.0 or later of the samba suite.
36 Some commands shown did not exist in earlier versions. 
37 </p></div><p>
38 Please pay attention to the error messages you receive. If any error message
39 reports that your server is being unfriendly you should first check that your
40 IP name resolution is correctly set up. eg: Make sure your <tt class="filename">/etc/resolv.conf</tt>
41 file points to name servers that really do exist.
42 </p><p>
43 Also, if you do not have DNS server access for name resolution please check
44 that the settings for your <tt class="filename">smb.conf</tt> file results in <b class="command">dns proxy = no</b>. The
45 best way to check this is with <b class="userinput"><tt>testparm smb.conf</tt></b>.
46 </p><p>
47 It is helpful to monitor the log files during testing by using the
48 <b class="command">tail -F <i class="replaceable"><tt>log_file_name</tt></i></b> in a separate
49 terminal console (use ctrl-alt-F1 through F6 or multiple terminals in X). 
50 Relevant log files can be found (for default installations) in
51 <tt class="filename">/usr/local/samba/var</tt>.  Also, connection logs from
52 machines can be found here or possibly in <tt class="filename">/var/log/samba</tt>
53 depending on how or if you specified logging in your <tt class="filename">smb.conf</tt> file.
54 </p><p>
55 If you make changes to your <tt class="filename">smb.conf</tt> file while going through these test,
56 don't forget to restart <span class="application">smbd</span> and <span class="application">nmbd</span>.
57 </p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id3008108"></a>The tests</h2></div></div><div></div></div><div class="procedure"><p class="title"><b>Procedure 33.1. Diagnosing your samba server</b></p><ol type="1"><li><p>
58 In the directory in which you store your <tt class="filename">smb.conf</tt> file, run the command
59 <b class="userinput"><tt>testparm smb.conf</tt></b>. If it reports any errors then your <tt class="filename">smb.conf</tt>
60 configuration file is faulty.
61 </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
62 Your <tt class="filename">smb.conf</tt> file may be located in: <tt class="filename">/etc/samba</tt>
63 Or in:   <tt class="filename">/usr/local/samba/lib</tt>
64 </p></div></li><li><p>
65 Run the command <b class="userinput"><tt>ping BIGSERVER</tt></b> from the PC and 
66 <b class="userinput"><tt>ping ACLIENT</tt></b> from
67 the unix box. If you don't get a valid response then your TCP/IP
68 software is not correctly installed. 
69 </p><p>
70 Note that you will need to start a &quot;dos prompt&quot; window on the PC to
71 run ping.
72 </p><p>
73 If you get a message saying <span class="errorname">host not found</span> or similar then your DNS
74 software or <tt class="filename">/etc/hosts</tt> file is not correctly setup.
75 It is possible to
76 run samba without DNS entries for the server and client, but I assume
77 you do have correct entries for the remainder of these tests. 
78 </p><p>
79 Another reason why ping might fail is if your host is running firewall 
80 software. You will need to relax the rules to let in the workstation
81 in question, perhaps by allowing access from another subnet (on Linux
82 this is done via the <span class="application">ipfwadm</span> program.)
83 </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
84 Modern Linux distributions install ipchains/iptables by default. 
85 This is a common problem that is often overlooked.
86 </p></div></li><li><p>
87 Run the command <b class="userinput"><tt>smbclient -L BIGSERVER</tt></b> on the unix box. You
88 should get a list of available shares back. 
89 </p><p>
90 If you get a error message containing the string &quot;Bad password&quot; then
91 you probably have either an incorrect <b class="command">hosts allow</b>, 
92 <b class="command">hosts deny</b> or <b class="command">valid users</b> line in your 
93 <tt class="filename">smb.conf</tt>, or your guest account is not
94 valid. Check what your guest account is using <span class="application">testparm</span> and
95 temporarily remove any <b class="command">hosts allow</b>, <b class="command">hosts deny</b>, <b class="command">valid users</b> or <b class="command">invalid users</b> lines.
96 </p><p>
97 If you get a <span class="errorname">connection refused</span> response then the smbd server may
98 not be running. If you installed it in inetd.conf then you probably edited
99 that file incorrectly. If you installed it as a daemon then check that
100 it is running, and check that the netbios-ssn port is in a LISTEN
101 state using <b class="userinput"><tt>netstat -a</tt></b>.
102 </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
103 Some Unix / Linux systems use <b class="command">xinetd</b> in place of
104 <b class="command">inetd</b>. Check your system documentation for the location
105 of the control file/s for your particular system implementation of
106 this network super daemon.
107 </p></div><p>
108 If you get a <span class="errorname">session request failed</span> then the server refused the
109 connection. If it says &quot;Your server software is being unfriendly&quot; then
110 its probably because you have invalid command line parameters to <span class="application">smbd</span>,
111 or a similar fatal problem with the initial startup of <span class="application">smbd</span>. Also
112 check your config file (<tt class="filename">smb.conf</tt>) for syntax errors with <span class="application">testparm</span>
113 and that the various directories where samba keeps its log and lock
114 files exist.
115 </p><p>
116 There are a number of reasons for which smbd may refuse or decline
117 a session request. The most common of these involve one or more of
118 the following <tt class="filename">smb.conf</tt> file entries:
119 </p><pre class="programlisting">
120         hosts deny = ALL
121         hosts allow = xxx.xxx.xxx.xxx/yy
122         bind interfaces only = Yes
123 </pre><p>
124 In the above, no allowance has been made for any session requests that
125 will automatically translate to the loopback adapter address 127.0.0.1.
126 To solve this problem change these lines to:
127 </p><pre class="programlisting">
128         hosts deny = ALL
129         hosts allow = xxx.xxx.xxx.xxx/yy 127.
130 </pre><p>
131 Do <span class="emphasis"><em>not</em></span> use the <b class="command">bind interfaces only</b> parameter where you 
132 may wish to
133 use the samba password change facility, or where <span class="application">smbclient</span> may need to
134 access a local service for name resolution or for local resource
135 connections. (Note: the <b class="command">bind interfaces only</b> parameter deficiency
136 where it will not allow connections to the loopback address will be
137 fixed soon).
138 </p><p>
139 Another common cause of these two errors is having something already running 
140 on port <tt class="constant">139</tt>, such as Samba 
141 (ie: <span class="application">smbd</span> is running from <span class="application">inetd</span> already) or
142 something like Digital's Pathworks. Check your <tt class="filename">inetd.conf</tt> file before trying
143 to start <span class="application">smbd</span> as a daemon, it can avoid a lot of frustration!
144 </p><p>
145 And yet another possible cause for failure of this test is when the subnet mask
146 and / or broadcast address settings are incorrect. Please check that the
147 network interface IP Address / Broadcast Address / Subnet Mask settings are
148 correct and that Samba has correctly noted these in the <tt class="filename">log.nmbd</tt> file.
149 </p></li><li><p>
150 Run the command <b class="userinput"><tt>nmblookup -B BIGSERVER __SAMBA__</tt></b>. You should get the
151 IP address of your Samba server back.
152 </p><p>
153 If you don't then nmbd is incorrectly installed. Check your <tt class="filename">inetd.conf</tt>
154 if you run it from there, or that the daemon is running and listening
155 to udp port 137.
156 </p><p>
157 One common problem is that many inetd implementations can't take many
158 parameters on the command line. If this is the case then create a
159 one-line script that contains the right parameters and run that from
160 inetd.
161 </p></li><li><p>run the command <b class="userinput"><tt>nmblookup -B ACLIENT '*'</tt></b></p><p>
162 You should get the PCs IP address back. If you don't then the client
163 software on the PC isn't installed correctly, or isn't started, or you
164 got the name of the PC wrong. 
165 </p><p>
166 If ACLIENT doesn't resolve via DNS then use the IP address of the
167 client in the above test.
168 </p></li><li><p>
169 Run the command <b class="userinput"><tt>nmblookup -d 2 '*'</tt></b>
170 </p><p>
171 This time we are trying the same as the previous test but are trying
172 it via a broadcast to the default broadcast address. A number of
173 NetBIOS / TCP/IP hosts on the network should respond, although Samba may
174 not catch all of the responses in the short time it listens. You
175 should see <span class="errorname">got a positive name query response</span>
176 messages from several hosts.
177 </p><p>
178 If this doesn't give a similar result to the previous test then
179 nmblookup isn't correctly getting your broadcast address through its
180 automatic mechanism. In this case you should experiment with the
181 <b class="command">interfaces</b> option in <tt class="filename">smb.conf</tt> to manually configure your IP
182 address, broadcast and netmask. 
183 </p><p>
184 If your PC and server aren't on the same subnet then you will need to
185 use the <i class="parameter"><tt>-B</tt></i> option to set the broadcast address to that of the PCs
186 subnet.
187 </p><p>
188 This test will probably fail if your subnet mask and broadcast address are
189 not correct. (Refer to TEST 3 notes above).
190 </p></li><li><p>
191 Run the command <b class="userinput"><tt>smbclient //BIGSERVER/TMP</tt></b>. You should 
192 then be prompted for a password. You should use the password of the account
193 you are logged into the unix box with. If you want to test with
194 another account then add the <i class="parameter"><tt>-U <i class="replaceable"><tt>accountname</tt></i></tt></i> option to the end of
195 the command line.  eg: 
196 <b class="userinput"><tt>smbclient //bigserver/tmp -Ujohndoe</tt></b>
197 </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
198 It is possible to specify the password along with the username
199 as follows:
200 <b class="userinput"><tt>smbclient //bigserver/tmp -Ujohndoe%secret</tt></b>
201 </p></div><p>
202 Once you enter the password you should get the <tt class="prompt">smb&gt;</tt> prompt. If you
203 don't then look at the error message. If it says <span class="errorname">invalid network
204 name</span> then the service <span class="emphasis"><em>&quot;tmp&quot;</em></span> is not correctly setup in your <tt class="filename">smb.conf</tt>.
205 </p><p>
206 If it says <span class="errorname">bad password</span> then the likely causes are:
207 </p><div class="orderedlist"><ol type="1"><li><p>
208         you have shadow passwords (or some other password system) but didn't
209         compile in support for them in <span class="application">smbd</span>
210         </p></li><li><p>
211         your <b class="command">valid users</b> configuration is incorrect
212         </p></li><li><p>
213         you have a mixed case password and you haven't enabled the <b class="command">password
214         level</b> option at a high enough level
215         </p></li><li><p>
216         the <b class="command">path =</b> line in <tt class="filename">smb.conf</tt> is incorrect. Check it with <span class="application">testparm</span>
217         </p></li><li><p>
218         you enabled password encryption but didn't map unix to samba users
219         </p></li></ol></div><p>
220 Once connected you should be able to use the commands 
221 <b class="command">dir</b> <b class="command">get</b> <b class="command">put</b> etc. 
222 Type <b class="command">help <i class="replaceable"><tt>command</tt></i></b> for instructions. You should
223 especially check that the amount of free disk space shown is correct
224 when you type <b class="command">dir</b>.
225 </p></li><li><p>
226 On the PC, type the command <b class="userinput"><tt>net view \\BIGSERVER</tt></b>. You will 
227 need to do this from within a &quot;dos prompt&quot; window. You should get back a 
228 list of available shares on the server.
229 </p><p>
230 If you get a <span class="errorname">network name not found</span> or similar error then netbios
231 name resolution is not working. This is usually caused by a problem in
232 nmbd. To overcome it you could do one of the following (you only need
233 to choose one of them):
234 </p><div class="orderedlist"><ol type="1"><li><p>
235         fixup the <span class="application">nmbd</span> installation
236 </p></li><li><p>
237         add the IP address of BIGSERVER to the <b class="command">wins server</b> box in the
238         advanced TCP/IP setup on the PC.
239 </p></li><li><p>
240         enable windows name resolution via DNS in the advanced section of
241         the TCP/IP setup
242 </p></li><li><p>
243         add BIGSERVER to your lmhosts file on the PC.
244 </p></li></ol></div><p>
245 If you get a <span class="errorname">invalid network name</span> or <span class="errorname">bad password error</span> then the
246 same fixes apply as they did for the <b class="userinput"><tt>smbclient -L</tt></b> test above. In
247 particular, make sure your <b class="command">hosts allow</b> line is correct (see the man
248 pages)
249 </p><p>
250 Also, do not overlook that fact that when the workstation requests the
251 connection to the samba server it will attempt to connect using the 
252 name with which you logged onto your Windows machine. You need to make
253 sure that an account exists on your Samba server with that exact same
254 name and password.
255 </p><p>
256 If you get <span class="errorname">specified computer is not receiving requests</span> or similar
257 it probably means that the host is not contactable via tcp services.
258 Check to see if the host is running tcp wrappers, and if so add an entry in
259 the <tt class="filename">hosts.allow</tt> file for your client (or subnet, etc.)
260 </p></li><li><p>
261 Run the command <b class="userinput"><tt>net use x: \\BIGSERVER\TMP</tt></b>. You should 
262 be prompted for a password then you should get a <tt class="computeroutput">command completed 
263 successfully</tt> message. If not then your PC software is incorrectly 
264 installed or your smb.conf is incorrect. make sure your <b class="command">hosts allow</b>
265 and other config lines in <tt class="filename">smb.conf</tt> are correct.
266 </p><p>
267 It's also possible that the server can't work out what user name to
268 connect you as. To see if this is the problem add the line <i class="parameter"><tt>user =
269 <i class="replaceable"><tt>username</tt></i></tt></i> to the <i class="parameter"><tt>[tmp]</tt></i> section of 
270 <tt class="filename">smb.conf</tt> where <i class="replaceable"><tt>username</tt></i> is the
271 username corresponding to the password you typed. If you find this
272 fixes things you may need the username mapping option. 
273 </p><p>
274 It might also be the case that your client only sends encrypted passwords 
275 and you have <i class="parameter"><tt>encrypt passwords = no</tt></i> in <tt class="filename">smb.conf</tt>
276 Turn it back on to fix.
277 </p></li><li><p>
278 Run the command <b class="userinput"><tt>nmblookup -M <i class="replaceable"><tt>testgroup</tt></i></tt></b> where 
279 <i class="replaceable"><tt>testgroup</tt></i> is the name of the workgroup that your Samba server and 
280 Windows PCs belong to. You should get back the IP address of the 
281 master browser for that workgroup.
282 </p><p>
283 If you don't then the election process has failed. Wait a minute to
284 see if it is just being slow then try again. If it still fails after
285 that then look at the browsing options you have set in <tt class="filename">smb.conf</tt>. Make
286 sure you have <i class="parameter"><tt>preferred master = yes</tt></i> to ensure that 
287 an election is held at startup.
288 </p></li><li><p>
289 &gt;From file manager try to browse the server. Your samba server should
290 appear in the browse list of your local workgroup (or the one you
291 specified in smb.conf). You should be able to double click on the name
292 of the server and get a list of shares. If you get a &quot;invalid
293 password&quot; error when you do then you are probably running WinNT and it
294 is refusing to browse a server that has no encrypted password
295 capability and is in user level security mode. In this case either set
296 <i class="parameter"><tt>security = server</tt></i> AND 
297 <i class="parameter"><tt>password server = Windows_NT_Machine</tt></i> in your
298 <tt class="filename">smb.conf</tt> file, or make sure <i class="parameter"><tt>encrypted passwords</tt></i> is
299 set to &quot;yes&quot;.
300 </p></li></ol></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id3009283"></a>Still having troubles?</h2></div></div><div></div></div><p>Read the chapter on 
301 <a href="problems.html" title="Chapter 34. Analysing and solving samba problems">Analysing and Solving Problems</a>.
302 </p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="troubleshooting.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="troubleshooting.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="problems.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Part V. Troubleshooting </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 34. Analysing and solving samba problems</td></tr></table></div></body></html>