Regenerate
[samba.git] / docs / htmldocs / diagnosis.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <HTML
3 ><HEAD
4 ><TITLE
5 >Diagnosing your samba server</TITLE
6 ><META
7 NAME="GENERATOR"
8 CONTENT="Modular DocBook HTML Stylesheet Version 1.77+"><LINK
9 REL="HOME"
10 TITLE="SAMBA Project Documentation"
11 HREF="samba-howto-collection.html"><LINK
12 REL="UP"
13 TITLE="Appendixes"
14 HREF="appendixes.html"><LINK
15 REL="PREVIOUS"
16 TITLE="Reporting Bugs"
17 HREF="bugreport.html"></HEAD
18 ><BODY
19 CLASS="CHAPTER"
20 BGCOLOR="#FFFFFF"
21 TEXT="#000000"
22 LINK="#0000FF"
23 VLINK="#840084"
24 ALINK="#0000FF"
25 ><DIV
26 CLASS="NAVHEADER"
27 ><TABLE
28 SUMMARY="Header navigation table"
29 WIDTH="100%"
30 BORDER="0"
31 CELLPADDING="0"
32 CELLSPACING="0"
33 ><TR
34 ><TH
35 COLSPAN="3"
36 ALIGN="center"
37 >SAMBA Project Documentation</TH
38 ></TR
39 ><TR
40 ><TD
41 WIDTH="10%"
42 ALIGN="left"
43 VALIGN="bottom"
44 ><A
45 HREF="bugreport.html"
46 ACCESSKEY="P"
47 >Prev</A
48 ></TD
49 ><TD
50 WIDTH="80%"
51 ALIGN="center"
52 VALIGN="bottom"
53 ></TD
54 ><TD
55 WIDTH="10%"
56 ALIGN="right"
57 VALIGN="bottom"
58 >&nbsp;</TD
59 ></TR
60 ></TABLE
61 ><HR
62 ALIGN="LEFT"
63 WIDTH="100%"></DIV
64 ><DIV
65 CLASS="CHAPTER"
66 ><H1
67 ><A
68 NAME="DIAGNOSIS"
69 ></A
70 >Chapter 24. Diagnosing your samba server</H1
71 ><DIV
72 CLASS="SECT1"
73 ><H1
74 CLASS="SECT1"
75 ><A
76 NAME="AEN3490"
77 ></A
78 >24.1. Introduction</H1
79 ><P
80 >This file contains a list of tests you can perform to validate your
81 Samba server. It also tells you what the likely cause of the problem
82 is if it fails any one of these steps. If it passes all these tests
83 then it is probably working fine.</P
84 ><P
85 >You should do ALL the tests, in the order shown. We have tried to
86 carefully choose them so later tests only use capabilities verified in
87 the earlier tests.</P
88 ><P
89 >If you send one of the samba mailing lists  an email saying "it doesn't work"
90 and you have not followed this test procedure then you should not be surprised
91 your email is ignored.</P
92 ></DIV
93 ><DIV
94 CLASS="SECT1"
95 ><H1
96 CLASS="SECT1"
97 ><A
98 NAME="AEN3495"
99 ></A
100 >24.2. Assumptions</H1
101 ><P
102 >In all of the tests it is assumed you have a Samba server called 
103 BIGSERVER and a PC called ACLIENT both in workgroup TESTGROUP.</P
104 ><P
105 >The procedure is similar for other types of clients.</P
106 ><P
107 >It is also assumed you know the name of an available share in your
108 smb.conf. I will assume this share is called "tmp". You can add a
109 "tmp" share like by adding the following to smb.conf:</P
110 ><P
111 ><PRE
112 CLASS="PROGRAMLISTING"
113 >&#13;[tmp]
114  comment = temporary files 
115  path = /tmp
116  read only = yes&#13;</PRE
117 ></P
118 ><P
119 >THESE TESTS ASSUME VERSION 3.0.0 OR LATER OF THE SAMBA SUITE. SOME
120 COMMANDS SHOWN DID NOT EXIST IN EARLIER VERSIONS</P
121 ><P
122 >Please pay attention to the error messages you receive. If any error message
123 reports that your server is being unfriendly you should first check that you
124 IP name resolution is correctly set up. eg: Make sure your /etc/resolv.conf
125 file points to name servers that really do exist.</P
126 ><P
127 >Also, if you do not have DNS server access for name resolution please check
128 that the settings for your smb.conf file results in "dns proxy = no". The
129 best way to check this is with "testparm smb.conf"</P
130 ></DIV
131 ><DIV
132 CLASS="SECT1"
133 ><H1
134 CLASS="SECT1"
135 ><A
136 NAME="AEN3505"
137 ></A
138 >24.3. Tests</H1
139 ><DIV
140 CLASS="SECT2"
141 ><H2
142 CLASS="SECT2"
143 ><A
144 NAME="AEN3507"
145 ></A
146 >24.3.1. Test 1</H2
147 ><P
148 >In the directory in which you store your smb.conf file, run the command
149 "testparm smb.conf". If it reports any errors then your smb.conf
150 configuration file is faulty.</P
151 ><P
152 >Note:  Your smb.conf file may be located in: <TT
153 CLASS="FILENAME"
154 >/etc/samba</TT
155 >
156         Or in:   <TT
157 CLASS="FILENAME"
158 >/usr/local/samba/lib</TT
159 ></P
160 ></DIV
161 ><DIV
162 CLASS="SECT2"
163 ><H2
164 CLASS="SECT2"
165 ><A
166 NAME="AEN3513"
167 ></A
168 >24.3.2. Test 2</H2
169 ><P
170 >Run the command "ping BIGSERVER" from the PC and "ping ACLIENT" from
171 the unix box. If you don't get a valid response then your TCP/IP
172 software is not correctly installed. </P
173 ><P
174 >Note that you will need to start a "dos prompt" window on the PC to
175 run ping.</P
176 ><P
177 >If you get a message saying "host not found" or similar then your DNS
178 software or /etc/hosts file is not correctly setup. It is possible to
179 run samba without DNS entries for the server and client, but I assume
180 you do have correct entries for the remainder of these tests. </P
181 ><P
182 >Another reason why ping might fail is if your host is running firewall 
183 software. You will need to relax the rules to let in the workstation
184 in question, perhaps by allowing access from another subnet (on Linux
185 this is done via the ipfwadm program.)</P
186 ></DIV
187 ><DIV
188 CLASS="SECT2"
189 ><H2
190 CLASS="SECT2"
191 ><A
192 NAME="AEN3519"
193 ></A
194 >24.3.3. Test 3</H2
195 ><P
196 >Run the command "smbclient -L BIGSERVER" on the unix box. You
197 should get a list of available shares back. </P
198 ><P
199 >If you get a error message containing the string "Bad password" then
200 you probably have either an incorrect "hosts allow", "hosts deny" or
201 "valid users" line in your smb.conf, or your guest account is not
202 valid. Check what your guest account is using "testparm" and
203 temporarily remove any "hosts allow", "hosts deny", "valid users" or
204 "invalid users" lines.</P
205 ><P
206 >If you get a "connection refused" response then the smbd server may
207 not be running. If you installed it in inetd.conf then you probably edited
208 that file incorrectly. If you installed it as a daemon then check that
209 it is running, and check that the netbios-ssn port is in a LISTEN
210 state using "netstat -a".</P
211 ><P
212 >If you get a "session request failed" then the server refused the
213 connection. If it says "Your server software is being unfriendly" then
214 its probably because you have invalid command line parameters to smbd,
215 or a similar fatal problem with the initial startup of smbd. Also
216 check your config file (smb.conf) for syntax errors with "testparm"
217 and that the various directories where samba keeps its log and lock
218 files exist.</P
219 ><P
220 >There are a number of reasons for which smbd may refuse or decline
221 a session request. The most common of these involve one or more of
222 the following smb.conf file entries:</P
223 ><P
224 ><PRE
225 CLASS="PROGRAMLISTING"
226 >       hosts deny = ALL
227         hosts allow = xxx.xxx.xxx.xxx/yy
228         bind interfaces only = Yes</PRE
229 ></P
230 ><P
231 >In the above, no allowance has been made for any session requests that
232 will automatically translate to the loopback adaptor address 127.0.0.1.
233 To solve this problem change these lines to:</P
234 ><P
235 ><PRE
236 CLASS="PROGRAMLISTING"
237 >       hosts deny = ALL
238         hosts allow = xxx.xxx.xxx.xxx/yy 127.</PRE
239 ></P
240 ><P
241 >Do NOT use the "bind interfaces only" parameter where you may wish to
242 use the samba password change facility, or where smbclient may need to
243 access local service for name resolution or for local resource
244 connections. (Note: the "bind interfaces only" parameter deficiency
245 where it will not allow connections to the loopback address will be
246 fixed soon).</P
247 ><P
248 >Another common cause of these two errors is having something already running 
249 on port 139, such as Samba (ie: smbd is running from inetd already) or
250 something like Digital's Pathworks. Check your inetd.conf file before trying
251 to start smbd as a daemon, it can avoid a lot of frustration!</P
252 ><P
253 >And yet another possible cause for failure of TEST 3 is when the subnet mask
254 and / or broadcast address settings are incorrect. Please check that the
255 network interface IP Address / Broadcast Address / Subnet Mask settings are
256 correct and that Samba has correctly noted these in the log.nmb file.</P
257 ></DIV
258 ><DIV
259 CLASS="SECT2"
260 ><H2
261 CLASS="SECT2"
262 ><A
263 NAME="AEN3534"
264 ></A
265 >24.3.4. Test 4</H2
266 ><P
267 >Run the command "nmblookup -B BIGSERVER __SAMBA__". You should get the
268 IP address of your Samba server back.</P
269 ><P
270 >If you don't then nmbd is incorrectly installed. Check your inetd.conf
271 if you run it from there, or that the daemon is running and listening
272 to udp port 137.</P
273 ><P
274 >One common problem is that many inetd implementations can't take many
275 parameters on the command line. If this is the case then create a
276 one-line script that contains the right parameters and run that from
277 inetd.</P
278 ></DIV
279 ><DIV
280 CLASS="SECT2"
281 ><H2
282 CLASS="SECT2"
283 ><A
284 NAME="AEN3539"
285 ></A
286 >24.3.5. Test 5</H2
287 ><P
288 >run the command <B
289 CLASS="COMMAND"
290 >nmblookup -B ACLIENT '*'</B
291 ></P
292 ><P
293 >You should get the PCs IP address back. If you don't then the client
294 software on the PC isn't installed correctly, or isn't started, or you
295 got the name of the PC wrong. </P
296 ><P
297 >If ACLIENT doesn't resolve via DNS then use the IP address of the
298 client in the above test.</P
299 ></DIV
300 ><DIV
301 CLASS="SECT2"
302 ><H2
303 CLASS="SECT2"
304 ><A
305 NAME="AEN3545"
306 ></A
307 >24.3.6. Test 6</H2
308 ><P
309 >Run the command <B
310 CLASS="COMMAND"
311 >nmblookup -d 2 '*'</B
312 ></P
313 ><P
314 >This time we are trying the same as the previous test but are trying
315 it via a broadcast to the default broadcast address. A number of
316 Netbios/TCPIP hosts on the network should respond, although Samba may
317 not catch all of the responses in the short time it listens. You
318 should see "got a positive name query response" messages from several
319 hosts.</P
320 ><P
321 >If this doesn't give a similar result to the previous test then
322 nmblookup isn't correctly getting your broadcast address through its
323 automatic mechanism. In this case you should experiment use the
324 "interfaces" option in smb.conf to manually configure your IP
325 address, broadcast and netmask. </P
326 ><P
327 >If your PC and server aren't on the same subnet then you will need to
328 use the -B option to set the broadcast address to the that of the PCs
329 subnet.</P
330 ><P
331 >This test will probably fail if your subnet mask and broadcast address are
332 not correct. (Refer to TEST 3 notes above).</P
333 ></DIV
334 ><DIV
335 CLASS="SECT2"
336 ><H2
337 CLASS="SECT2"
338 ><A
339 NAME="AEN3553"
340 ></A
341 >24.3.7. Test 7</H2
342 ><P
343 >Run the command <B
344 CLASS="COMMAND"
345 >smbclient //BIGSERVER/TMP</B
346 >. You should 
347 then be prompted for a password. You should use the password of the account
348 you are logged into the unix box with. If you want to test with
349 another account then add the -U &gt;accountname&lt; option to the end of
350 the command line.  eg: 
351 <B
352 CLASS="COMMAND"
353 >smbclient //bigserver/tmp -Ujohndoe</B
354 ></P
355 ><P
356 >Note: It is possible to specify the password along with the username
357 as follows:
358 <B
359 CLASS="COMMAND"
360 >smbclient //bigserver/tmp -Ujohndoe%secret</B
361 ></P
362 ><P
363 >Once you enter the password you should get the "smb&#62;" prompt. If you
364 don't then look at the error message. If it says "invalid network
365 name" then the service "tmp" is not correctly setup in your smb.conf.</P
366 ><P
367 >If it says "bad password" then the likely causes are:</P
368 ><P
369 ></P
370 ><OL
371 TYPE="1"
372 ><LI
373 ><P
374 >       you have shadow passords (or some other password system) but didn't
375         compile in support for them in smbd
376         </P
377 ></LI
378 ><LI
379 ><P
380 >       your "valid users" configuration is incorrect
381         </P
382 ></LI
383 ><LI
384 ><P
385 >       you have a mixed case password and you haven't enabled the "password
386         level" option at a high enough level
387         </P
388 ></LI
389 ><LI
390 ><P
391 >       the "path =" line in smb.conf is incorrect. Check it with testparm
392         </P
393 ></LI
394 ><LI
395 ><P
396 >       you enabled password encryption but didn't create the SMB encrypted
397         password file
398         </P
399 ></LI
400 ></OL
401 ><P
402 >Once connected you should be able to use the commands 
403 <B
404 CLASS="COMMAND"
405 >dir</B
406 > <B
407 CLASS="COMMAND"
408 >get</B
409 > <B
410 CLASS="COMMAND"
411 >put</B
412 > etc. 
413 Type <B
414 CLASS="COMMAND"
415 >help &gt;command&lt;</B
416 > for instructions. You should
417 especially check that the amount of free disk space shown is correct
418 when you type <B
419 CLASS="COMMAND"
420 >dir</B
421 >.</P
422 ></DIV
423 ><DIV
424 CLASS="SECT2"
425 ><H2
426 CLASS="SECT2"
427 ><A
428 NAME="AEN3579"
429 ></A
430 >24.3.8. Test 8</H2
431 ><P
432 >On the PC type the command <B
433 CLASS="COMMAND"
434 >net view \\BIGSERVER</B
435 >. You will 
436 need to do this from within a "dos prompt" window. You should get back a 
437 list of available shares on the server.</P
438 ><P
439 >If you get a "network name not found" or similar error then netbios
440 name resolution is not working. This is usually caused by a problem in
441 nmbd. To overcome it you could do one of the following (you only need
442 to choose one of them):</P
443 ><P
444 ></P
445 ><OL
446 TYPE="1"
447 ><LI
448 ><P
449 >       fixup the nmbd installation</P
450 ></LI
451 ><LI
452 ><P
453 >       add the IP address of BIGSERVER to the "wins server" box in the
454         advanced tcp/ip setup on the PC.</P
455 ></LI
456 ><LI
457 ><P
458 >       enable windows name resolution via DNS in the advanced section of
459         the tcp/ip setup</P
460 ></LI
461 ><LI
462 ><P
463 >       add BIGSERVER to your lmhosts file on the PC.</P
464 ></LI
465 ></OL
466 ><P
467 >If you get a "invalid network name" or "bad password error" then the
468 same fixes apply as they did for the "smbclient -L" test above. In
469 particular, make sure your "hosts allow" line is correct (see the man
470 pages)</P
471 ><P
472 >Also, do not overlook that fact that when the workstation requests the
473 connection to the samba server it will attempt to connect using the 
474 name with which you logged onto your Windows machine. You need to make
475 sure that an account exists on your Samba server with that exact same
476 name and password.</P
477 ><P
478 >If you get "specified computer is not receiving requests" or similar
479 it probably means that the host is not contactable via tcp services.
480 Check to see if the host is running tcp wrappers, and if so add an entry in
481 the hosts.allow file for your client (or subnet, etc.)</P
482 ></DIV
483 ><DIV
484 CLASS="SECT2"
485 ><H2
486 CLASS="SECT2"
487 ><A
488 NAME="AEN3596"
489 ></A
490 >24.3.9. Test 9</H2
491 ><P
492 >Run the command <B
493 CLASS="COMMAND"
494 >net use x: \\BIGSERVER\TMP</B
495 >. You should 
496 be prompted for a password then you should get a "command completed 
497 successfully" message. If not then your PC software is incorrectly 
498 installed or your smb.conf is incorrect. make sure your "hosts allow" 
499 and other config lines in smb.conf are correct.</P
500 ><P
501 >It's also possible that the server can't work out what user name to
502 connect you as. To see if this is the problem add the line "user =
503 USERNAME" to the [tmp] section of smb.conf where "USERNAME" is the
504 username corresponding to the password you typed. If you find this
505 fixes things you may need the username mapping option. </P
506 ><P
507 >It might also be the case that your client only sends encrypted passwords 
508 and you have <B
509 CLASS="COMMAND"
510 >encrypt passwords = no</B
511 > in <TT
512 CLASS="FILENAME"
513 >smb.conf</TT
514 >.
515 Turn it back on to fix.</P
516 ></DIV
517 ><DIV
518 CLASS="SECT2"
519 ><H2
520 CLASS="SECT2"
521 ><A
522 NAME="AEN3604"
523 ></A
524 >24.3.10. Test 10</H2
525 ><P
526 >Run the command <B
527 CLASS="COMMAND"
528 >nmblookup -M TESTGROUP</B
529 > where 
530 TESTGROUP is the name of the workgroup that your Samba server and 
531 Windows PCs belong to. You should get back the IP address of the 
532 master browser for that workgroup.</P
533 ><P
534 >If you don't then the election process has failed. Wait a minute to
535 see if it is just being slow then try again. If it still fails after
536 that then look at the browsing options you have set in smb.conf. Make
537 sure you have <B
538 CLASS="COMMAND"
539 >preferred master = yes</B
540 > to ensure that 
541 an election is held at startup.</P
542 ></DIV
543 ><DIV
544 CLASS="SECT2"
545 ><H2
546 CLASS="SECT2"
547 ><A
548 NAME="AEN3610"
549 ></A
550 >24.3.11. Test 11</H2
551 ><P
552 >From file manager try to browse the server. Your samba server should
553 appear in the browse list of your local workgroup (or the one you
554 specified in smb.conf). You should be able to double click on the name
555 of the server and get a list of shares. If you get a "invalid
556 password" error when you do then you are probably running WinNT and it
557 is refusing to browse a server that has no encrypted password
558 capability and is in user level security mode. In this case either set
559 <B
560 CLASS="COMMAND"
561 >security = server</B
562 > AND 
563 <B
564 CLASS="COMMAND"
565 >password server = Windows_NT_Machine</B
566 > in your
567 smb.conf file, or enable encrypted passwords AFTER compiling in support
568 for encrypted passwords (refer to the Makefile).</P
569 ></DIV
570 ></DIV
571 ><DIV
572 CLASS="SECT1"
573 ><H1
574 CLASS="SECT1"
575 ><A
576 NAME="AEN3615"
577 ></A
578 >24.4. Still having troubles?</H1
579 ><P
580 >Try the mailing list or newsgroup, or use the ethereal utility to
581 sniff the problem. The official samba mailing list can be reached at
582 <A
583 HREF="mailto:samba@samba.org"
584 TARGET="_top"
585 >samba@samba.org</A
586 >. To find 
587 out more about samba and how to subscribe to the mailing list check 
588 out the samba web page at 
589 <A
590 HREF="http://samba.org/samba"
591 TARGET="_top"
592 >http://samba.org/samba</A
593 ></P
594 ><P
595 >Also look at the other docs in the Samba package!</P
596 ></DIV
597 ></DIV
598 ><DIV
599 CLASS="NAVFOOTER"
600 ><HR
601 ALIGN="LEFT"
602 WIDTH="100%"><TABLE
603 SUMMARY="Footer navigation table"
604 WIDTH="100%"
605 BORDER="0"
606 CELLPADDING="0"
607 CELLSPACING="0"
608 ><TR
609 ><TD
610 WIDTH="33%"
611 ALIGN="left"
612 VALIGN="top"
613 ><A
614 HREF="bugreport.html"
615 ACCESSKEY="P"
616 >Prev</A
617 ></TD
618 ><TD
619 WIDTH="34%"
620 ALIGN="center"
621 VALIGN="top"
622 ><A
623 HREF="samba-howto-collection.html"
624 ACCESSKEY="H"
625 >Home</A
626 ></TD
627 ><TD
628 WIDTH="33%"
629 ALIGN="right"
630 VALIGN="top"
631 >&nbsp;</TD
632 ></TR
633 ><TR
634 ><TD
635 WIDTH="33%"
636 ALIGN="left"
637 VALIGN="top"
638 >Reporting Bugs</TD
639 ><TD
640 WIDTH="34%"
641 ALIGN="center"
642 VALIGN="top"
643 ><A
644 HREF="appendixes.html"
645 ACCESSKEY="U"
646 >Up</A
647 ></TD
648 ><TD
649 WIDTH="33%"
650 ALIGN="right"
651 VALIGN="top"
652 >&nbsp;</TD
653 ></TR
654 ></TABLE
655 ></DIV
656 ></BODY
657 ></HTML
658 >