1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
5 >Diagnosing your samba server</TITLE
8 CONTENT="Modular DocBook HTML Stylesheet Version 1.77+"><LINK
10 TITLE="SAMBA Project Documentation"
11 HREF="samba-howto-collection.html"><LINK
14 HREF="appendixes.html"><LINK
16 TITLE="Reporting Bugs"
17 HREF="bugreport.html"></HEAD
28 SUMMARY="Header navigation table"
37 >SAMBA Project Documentation</TH
70 >Chapter 24. Diagnosing your samba server</H1
78 >24.1. Introduction</H1
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
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
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
100 >24.2. Assumptions</H1
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
105 >The procedure is similar for other types of clients.</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
112 CLASS="PROGRAMLISTING"
114 comment = temporary files
116 read only = yes </PRE
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
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
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
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
152 >Note: Your smb.conf file may be located in: <TT
158 >/usr/local/samba/lib</TT
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
174 >Note that you will need to start a "dos prompt" window on the PC to
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
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
196 >Run the command "smbclient -L BIGSERVER" on the unix box. You
197 should get a list of available shares back. </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
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
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
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
225 CLASS="PROGRAMLISTING"
227 hosts allow = xxx.xxx.xxx.xxx/yy
228 bind interfaces only = Yes</PRE
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
236 CLASS="PROGRAMLISTING"
238 hosts allow = xxx.xxx.xxx.xxx/yy 127.</PRE
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
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
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
267 >Run the command "nmblookup -B BIGSERVER __SAMBA__". You should get the
268 IP address of your Samba server back.</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
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
290 >nmblookup -B ACLIENT '*'</B
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
297 >If ACLIENT doesn't resolve via DNS then use the IP address of the
298 client in the above test.</P
311 >nmblookup -d 2 '*'</B
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
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
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
331 >This test will probably fail if your subnet mask and broadcast address are
332 not correct. (Refer to TEST 3 notes above).</P
345 >smbclient //BIGSERVER/TMP</B
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 >accountname< option to the end of
350 the command line. eg:
353 >smbclient //bigserver/tmp -Ujohndoe</B
356 >Note: It is possible to specify the password along with the username
360 >smbclient //bigserver/tmp -Ujohndoe%secret</B
363 >Once you enter the password you should get the "smb>" 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
367 >If it says "bad password" then the likely causes are:</P
374 > you have shadow passords (or some other password system) but didn't
375 compile in support for them in smbd
380 > your "valid users" configuration is incorrect
385 > you have a mixed case password and you haven't enabled the "password
386 level" option at a high enough level
391 > the "path =" line in smb.conf is incorrect. Check it with testparm
396 > you enabled password encryption but didn't create the SMB encrypted
402 >Once connected you should be able to use the commands
415 >help >command<</B
416 > for instructions. You should
417 especially check that the amount of free disk space shown is correct
432 >On the PC type the command <B
434 >net view \\BIGSERVER</B
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
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
449 > fixup the nmbd installation</P
453 > add the IP address of BIGSERVER to the "wins server" box in the
454 advanced tcp/ip setup on the PC.</P
458 > enable windows name resolution via DNS in the advanced section of
463 > add BIGSERVER to your lmhosts file on the PC.</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
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
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
494 >net use x: \\BIGSERVER\TMP</B
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
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
507 >It might also be the case that your client only sends encrypted passwords
510 >encrypt passwords = no</B
515 Turn it back on to fix.</P
524 >24.3.10. Test 10</H2
528 >nmblookup -M TESTGROUP</B
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
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
539 >preferred master = yes</B
541 an election is held at startup.</P
550 >24.3.11. Test 11</H2
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
561 >security = server</B
565 >password server = Windows_NT_Machine</B
567 smb.conf file, or enable encrypted passwords AFTER compiling in support
568 for encrypted passwords (refer to the Makefile).</P
578 >24.4. Still having troubles?</H1
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
583 HREF="mailto:samba@samba.org"
587 out more about samba and how to subscribe to the mailing list check
588 out the samba web page at
590 HREF="http://samba.org/samba"
592 >http://samba.org/samba</A
595 >Also look at the other docs in the Samba package!</P
603 SUMMARY="Footer navigation table"
614 HREF="bugreport.html"
623 HREF="samba-howto-collection.html"
644 HREF="appendixes.html"