1 <chapter id="diagnosis">
4 <firstname>Andrew</firstname><surname>Tridgell</surname>
6 <orgname>Samba Team</orgname>
7 <address><email>tridge@samba.org</email></address>
11 <firstname>Jelmer</firstname><surname>Vernooij</surname>
13 <orgname>Samba Team</orgname>
14 <address><email>jelmer@samba.org</email></address>
17 <pubdate>Wed Jan 15</pubdate>
20 <title>Diagnosing your samba server</title>
23 <title>Introduction</title>
26 This file contains a list of tests you can perform to validate your
27 Samba server. It also tells you what the likely cause of the problem
28 is if it fails any one of these steps. If it passes all these tests
29 then it is probably working fine.
33 You should do ALL the tests, in the order shown. We have tried to
34 carefully choose them so later tests only use capabilities verified in
39 If you send one of the samba mailing lists an email saying "it doesn't work"
40 and you have not followed this test procedure then you should not be surprised
41 your email is ignored.
47 <title>Assumptions</title>
50 In all of the tests it is assumed you have a Samba server called
51 BIGSERVER and a PC called ACLIENT both in workgroup TESTGROUP.
55 The procedure is similar for other types of clients.
59 It is also assumed you know the name of an available share in your
60 smb.conf. I will assume this share is called "tmp". You can add a
61 "tmp" share like by adding the following to smb.conf:
64 <para><programlisting>
67 comment = temporary files
75 THESE TESTS ASSUME VERSION 3.0.0 OR LATER OF THE SAMBA SUITE. SOME
76 COMMANDS SHOWN DID NOT EXIST IN EARLIER VERSIONS
80 Please pay attention to the error messages you receive. If any error message
81 reports that your server is being unfriendly you should first check that you
82 IP name resolution is correctly set up. eg: Make sure your /etc/resolv.conf
83 file points to name servers that really do exist.
87 Also, if you do not have DNS server access for name resolution please check
88 that the settings for your smb.conf file results in "dns proxy = no". The
89 best way to check this is with "testparm smb.conf"
100 In the directory in which you store your smb.conf file, run the command
101 "testparm smb.conf". If it reports any errors then your smb.conf
102 configuration file is faulty.
106 Note: Your smb.conf file may be located in: <filename>/etc/samba</filename>
107 Or in: <filename>/usr/local/samba/lib</filename>
112 <title>Test 2</title>
115 Run the command "ping BIGSERVER" from the PC and "ping ACLIENT" from
116 the unix box. If you don't get a valid response then your TCP/IP
117 software is not correctly installed.
121 Note that you will need to start a "dos prompt" window on the PC to
126 If you get a message saying "host not found" or similar then your DNS
127 software or /etc/hosts file is not correctly setup. It is possible to
128 run samba without DNS entries for the server and client, but I assume
129 you do have correct entries for the remainder of these tests.
133 Another reason why ping might fail is if your host is running firewall
134 software. You will need to relax the rules to let in the workstation
135 in question, perhaps by allowing access from another subnet (on Linux
136 this is done via the ipfwadm program.)
141 <title>Test 3</title>
144 Run the command "smbclient -L BIGSERVER" on the unix box. You
145 should get a list of available shares back.
149 If you get a error message containing the string "Bad password" then
150 you probably have either an incorrect "hosts allow", "hosts deny" or
151 "valid users" line in your smb.conf, or your guest account is not
152 valid. Check what your guest account is using "testparm" and
153 temporarily remove any "hosts allow", "hosts deny", "valid users" or
154 "invalid users" lines.
158 If you get a "connection refused" response then the smbd server may
159 not be running. If you installed it in inetd.conf then you probably edited
160 that file incorrectly. If you installed it as a daemon then check that
161 it is running, and check that the netbios-ssn port is in a LISTEN
162 state using "netstat -a".
166 If you get a "session request failed" then the server refused the
167 connection. If it says "Your server software is being unfriendly" then
168 its probably because you have invalid command line parameters to smbd,
169 or a similar fatal problem with the initial startup of smbd. Also
170 check your config file (smb.conf) for syntax errors with "testparm"
171 and that the various directories where samba keeps its log and lock
176 There are a number of reasons for which smbd may refuse or decline
177 a session request. The most common of these involve one or more of
178 the following smb.conf file entries:
181 <para><programlisting>
183 hosts allow = xxx.xxx.xxx.xxx/yy
184 bind interfaces only = Yes
185 </programlisting></para>
188 In the above, no allowance has been made for any session requests that
189 will automatically translate to the loopback adaptor address 127.0.0.1.
190 To solve this problem change these lines to:
193 <para><programlisting>
195 hosts allow = xxx.xxx.xxx.xxx/yy 127.
196 </programlisting></para>
199 Do NOT use the "bind interfaces only" parameter where you may wish to
200 use the samba password change facility, or where smbclient may need to
201 access local service for name resolution or for local resource
202 connections. (Note: the "bind interfaces only" parameter deficiency
203 where it will not allow connections to the loopback address will be
208 Another common cause of these two errors is having something already running
209 on port 139, such as Samba (ie: smbd is running from inetd already) or
210 something like Digital's Pathworks. Check your inetd.conf file before trying
211 to start smbd as a daemon, it can avoid a lot of frustration!
215 And yet another possible cause for failure of TEST 3 is when the subnet mask
216 and / or broadcast address settings are incorrect. Please check that the
217 network interface IP Address / Broadcast Address / Subnet Mask settings are
218 correct and that Samba has correctly noted these in the log.nmb file.
224 <title>Test 4</title>
227 Run the command "nmblookup -B BIGSERVER __SAMBA__". You should get the
228 IP address of your Samba server back.
232 If you don't then nmbd is incorrectly installed. Check your inetd.conf
233 if you run it from there, or that the daemon is running and listening
238 One common problem is that many inetd implementations can't take many
239 parameters on the command line. If this is the case then create a
240 one-line script that contains the right parameters and run that from
247 <title>Test 5</title>
249 <para>run the command <command>nmblookup -B ACLIENT '*'</command></para>
252 You should get the PCs IP address back. If you don't then the client
253 software on the PC isn't installed correctly, or isn't started, or you
254 got the name of the PC wrong.
258 If ACLIENT doesn't resolve via DNS then use the IP address of the
259 client in the above test.
265 <title>Test 6</title>
268 Run the command <command>nmblookup -d 2 '*'</command>
272 This time we are trying the same as the previous test but are trying
273 it via a broadcast to the default broadcast address. A number of
274 Netbios/TCPIP hosts on the network should respond, although Samba may
275 not catch all of the responses in the short time it listens. You
276 should see "got a positive name query response" messages from several
281 If this doesn't give a similar result to the previous test then
282 nmblookup isn't correctly getting your broadcast address through its
283 automatic mechanism. In this case you should experiment use the
284 "interfaces" option in smb.conf to manually configure your IP
285 address, broadcast and netmask.
289 If your PC and server aren't on the same subnet then you will need to
290 use the -B option to set the broadcast address to the that of the PCs
295 This test will probably fail if your subnet mask and broadcast address are
296 not correct. (Refer to TEST 3 notes above).
302 <title>Test 7</title>
305 Run the command <command>smbclient //BIGSERVER/TMP</command>. You should
306 then be prompted for a password. You should use the password of the account
307 you are logged into the unix box with. If you want to test with
308 another account then add the -U >accountname< option to the end of
309 the command line. eg:
310 <command>smbclient //bigserver/tmp -Ujohndoe</command>
314 Note: It is possible to specify the password along with the username
316 <command>smbclient //bigserver/tmp -Ujohndoe%secret</command>
320 Once you enter the password you should get the "smb>" prompt. If you
321 don't then look at the error message. If it says "invalid network
322 name" then the service "tmp" is not correctly setup in your smb.conf.
326 If it says "bad password" then the likely causes are:
332 you have shadow passords (or some other password system) but didn't
333 compile in support for them in smbd
339 your "valid users" configuration is incorrect
345 you have a mixed case password and you haven't enabled the "password
346 level" option at a high enough level
352 the "path =" line in smb.conf is incorrect. Check it with testparm
358 you enabled password encryption but didn't create the SMB encrypted
365 Once connected you should be able to use the commands
366 <command>dir</command> <command>get</command> <command>put</command> etc.
367 Type <command>help >command<</command> for instructions. You should
368 especially check that the amount of free disk space shown is correct
369 when you type <command>dir</command>.
375 <title>Test 8</title>
378 On the PC type the command <command>net view \\BIGSERVER</command>. You will
379 need to do this from within a "dos prompt" window. You should get back a
380 list of available shares on the server.
384 If you get a "network name not found" or similar error then netbios
385 name resolution is not working. This is usually caused by a problem in
386 nmbd. To overcome it you could do one of the following (you only need
387 to choose one of them):
392 fixup the nmbd installation
396 add the IP address of BIGSERVER to the "wins server" box in the
397 advanced tcp/ip setup on the PC.
401 enable windows name resolution via DNS in the advanced section of
406 add BIGSERVER to your lmhosts file on the PC.
411 If you get a "invalid network name" or "bad password error" then the
412 same fixes apply as they did for the "smbclient -L" test above. In
413 particular, make sure your "hosts allow" line is correct (see the man
418 Also, do not overlook that fact that when the workstation requests the
419 connection to the samba server it will attempt to connect using the
420 name with which you logged onto your Windows machine. You need to make
421 sure that an account exists on your Samba server with that exact same
426 If you get "specified computer is not receiving requests" or similar
427 it probably means that the host is not contactable via tcp services.
428 Check to see if the host is running tcp wrappers, and if so add an entry in
429 the hosts.allow file for your client (or subnet, etc.)
435 <title>Test 9</title>
438 Run the command <command>net use x: \\BIGSERVER\TMP</command>. You should
439 be prompted for a password then you should get a "command completed
440 successfully" message. If not then your PC software is incorrectly
441 installed or your smb.conf is incorrect. make sure your "hosts allow"
442 and other config lines in smb.conf are correct.
446 It's also possible that the server can't work out what user name to
447 connect you as. To see if this is the problem add the line "user =
448 USERNAME" to the [tmp] section of smb.conf where "USERNAME" is the
449 username corresponding to the password you typed. If you find this
450 fixes things you may need the username mapping option.
454 It might also be the case that your client only sends encrypted passwords
455 and you have <command>encrypt passwords = no</command> in <filename>smb.conf</filename>.
456 Turn it back on to fix.
462 <title>Test 10</title>
465 Run the command <command>nmblookup -M TESTGROUP</command> where
466 TESTGROUP is the name of the workgroup that your Samba server and
467 Windows PCs belong to. You should get back the IP address of the
468 master browser for that workgroup.
472 If you don't then the election process has failed. Wait a minute to
473 see if it is just being slow then try again. If it still fails after
474 that then look at the browsing options you have set in smb.conf. Make
475 sure you have <command>preferred master = yes</command> to ensure that
476 an election is held at startup.
482 <title>Test 11</title>
485 From file manager try to browse the server. Your samba server should
486 appear in the browse list of your local workgroup (or the one you
487 specified in smb.conf). You should be able to double click on the name
488 of the server and get a list of shares. If you get a "invalid
489 password" error when you do then you are probably running WinNT and it
490 is refusing to browse a server that has no encrypted password
491 capability and is in user level security mode. In this case either set
492 <command>security = server</command> AND
493 <command>password server = Windows_NT_Machine</command> in your
494 smb.conf file, or enable encrypted passwords AFTER compiling in support
495 for encrypted passwords (refer to the Makefile).
502 <title>Still having troubles?</title>
505 Try the mailing list or newsgroup, or use the ethereal utility to
506 sniff the problem. The official samba mailing list can be reached at
507 <ulink url="mailto:samba@samba.org">samba@samba.org</ulink>. To find
508 out more about samba and how to subscribe to the mailing list check
509 out the samba web page at
510 <ulink url="http://samba.org/samba">http://samba.org/samba</ulink>
514 Also look at the other docs in the Samba package!