1 <chapter id=
"diagnosis">
5 <pubdate>Wed Jan
15</pubdate>
8 <title>The samba checklist
</title>
11 <title>Introduction
</title>
14 This file contains a list of tests you can perform to validate your
15 Samba server. It also tells you what the likely cause of the problem
16 is if it fails any one of these steps. If it passes all these tests
17 then it is probably working fine.
21 You should do ALL the tests, in the order shown. We have tried to
22 carefully choose them so later tests only use capabilities verified in
27 If you send one of the samba mailing lists an email saying
"it doesn't work"
28 and you have not followed this test procedure then you should not be surprised
29 your email is ignored.
35 <title>Assumptions
</title>
38 In all of the tests it is assumed you have a Samba server called
39 BIGSERVER and a PC called ACLIENT both in workgroup TESTGROUP.
43 The procedure is similar for other types of clients.
47 It is also assumed you know the name of an available share in your
48 &smb.conf;. I will assume this share is called
<replaceable>tmp
</replaceable>.
49 You can add a
<replaceable>tmp
</replaceable> share like by adding the
50 following to &smb.conf;:
53 <para><programlisting>
56 comment = temporary files
64 These tests assume version
3.0 or later of the samba suite. Some commands shown did not exist in earlier versions.
68 Please pay attention to the error messages you receive. If any error message
69 reports that your server is being unfriendly you should first check that you
70 IP name resolution is correctly set up. eg: Make sure your
<filename>/etc/resolv.conf
</filename>
71 file points to name servers that really do exist.
75 Also, if you do not have DNS server access for name resolution please check
76 that the settings for your &smb.conf; file results in
<command>dns proxy = no
</command>. The
77 best way to check this is with
<userinput>testparm smb.conf
</userinput>.
83 <title>The tests
</title>
85 <title>Diagnosing your samba server
</title>
87 <step performance=
"required">
89 In the directory in which you store your &smb.conf; file, run the command
90 <userinput>testparm smb.conf
</userinput>. If it reports any errors then your &smb.conf;
91 configuration file is faulty.
95 Your &smb.conf; file may be located in:
<filename>/etc/samba
</filename>
96 Or in:
<filename>/usr/local/samba/lib
</filename>
100 <step performance=
"required">
102 Run the command
<userinput>ping BIGSERVER
</userinput> from the PC and
103 <userinput>ping ACLIENT
</userinput> from
104 the unix box. If you don't get a valid response then your TCP/IP
105 software is not correctly installed.
109 Note that you will need to start a
"dos prompt" window on the PC to
114 If you get a message saying
"host not found" or similar then your DNS
115 software or
<filename>/etc/hosts
</filename> file is not correctly setup.
117 run samba without DNS entries for the server and client, but I assume
118 you do have correct entries for the remainder of these tests.
122 Another reason why ping might fail is if your host is running firewall
123 software. You will need to relax the rules to let in the workstation
124 in question, perhaps by allowing access from another subnet (on Linux
125 this is done via the
<application>ipfwadm
</application> program.)
129 <step performance=
"required">
131 Run the command
<userinput>smbclient -L BIGSERVER
</userinput> on the unix box. You
132 should get a list of available shares back.
136 If you get a error message containing the string
"Bad password" then
137 you probably have either an incorrect
<command>hosts allow
</command>,
138 <command>hosts deny
</command> or
<command>valid users
</command> line in your
139 &smb.conf;, or your guest account is not
140 valid. Check what your guest account is using
&testparm; and
141 temporarily remove any
<command>hosts allow
</command>,
<command>hosts deny
</command>,
<command>valid users
</command> or
<command>invalid users
</command> lines.
145 If you get a
"connection refused" response then the smbd server may
146 not be running. If you installed it in inetd.conf then you probably edited
147 that file incorrectly. If you installed it as a daemon then check that
148 it is running, and check that the netbios-ssn port is in a LISTEN
149 state using
<userinput>netstat -a
</userinput>.
153 If you get a
"session request failed" then the server refused the
154 connection. If it says
"Your server software is being unfriendly" then
155 its probably because you have invalid command line parameters to
&smbd;,
156 or a similar fatal problem with the initial startup of
&smbd;. Also
157 check your config file (&smb.conf;) for syntax errors with
&testparm;
158 and that the various directories where samba keeps its log and lock
163 There are a number of reasons for which smbd may refuse or decline
164 a session request. The most common of these involve one or more of
165 the following &smb.conf; file entries:
168 <para><programlisting>
170 hosts allow = xxx.xxx.xxx.xxx/yy
171 bind interfaces only = Yes
172 </programlisting></para>
175 In the above, no allowance has been made for any session requests that
176 will automatically translate to the loopback adaptor address
127.0.0.1.
177 To solve this problem change these lines to:
180 <para><programlisting>
182 hosts allow = xxx.xxx.xxx.xxx/yy
127.
183 </programlisting></para>
186 Do NOT use the
<command>bind interfaces only
</command> parameter where you
188 use the samba password change facility, or where
&smbclient; may need to
189 access local service for name resolution or for local resource
190 connections. (Note: the
<command>bind interfaces only
</command> parameter deficiency
191 where it will not allow connections to the loopback address will be
196 Another common cause of these two errors is having something already running
197 on port
139, such as Samba (ie: smbd is running from
<application>inetd
</application> already) or
198 something like Digital's Pathworks. Check your
<filename>inetd.conf
</filename> file before trying
199 to start
&smbd; as a daemon, it can avoid a lot of frustration!
203 And yet another possible cause for failure of this test is when the subnet mask
204 and / or broadcast address settings are incorrect. Please check that the
205 network interface IP Address / Broadcast Address / Subnet Mask settings are
206 correct and that Samba has correctly noted these in the
<filename>log.nmb
</filename> file.
211 <step performance=
"required">
214 Run the command
<userinput>nmblookup -B BIGSERVER __SAMBA__
</userinput>. You should get the
215 IP address of your Samba server back.
219 If you don't then nmbd is incorrectly installed. Check your
<filename>inetd.conf
</filename>
220 if you run it from there, or that the daemon is running and listening
225 One common problem is that many inetd implementations can't take many
226 parameters on the command line. If this is the case then create a
227 one-line script that contains the right parameters and run that from
233 <step performance=
"required">
235 <para>run the command
<userinput>nmblookup -B ACLIENT '*'
</userinput></para>
238 You should get the PCs IP address back. If you don't then the client
239 software on the PC isn't installed correctly, or isn't started, or you
240 got the name of the PC wrong.
244 If ACLIENT doesn't resolve via DNS then use the IP address of the
245 client in the above test.
250 <step performance=
"required">
253 Run the command
<userinput>nmblookup -d
2 '*'
</userinput>
257 This time we are trying the same as the previous test but are trying
258 it via a broadcast to the default broadcast address. A number of
259 Netbios/TCPIP hosts on the network should respond, although Samba may
260 not catch all of the responses in the short time it listens. You
261 should see
"got a positive name query response" messages from several
266 If this doesn't give a similar result to the previous test then
267 nmblookup isn't correctly getting your broadcast address through its
268 automatic mechanism. In this case you should experiment use the
269 <command>interfaces
</command> option in &smb.conf; to manually configure your IP
270 address, broadcast and netmask.
274 If your PC and server aren't on the same subnet then you will need to
275 use the
<parameter>-B
</parameter> option to set the broadcast address to the that of the PCs
280 This test will probably fail if your subnet mask and broadcast address are
281 not correct. (Refer to TEST
3 notes above).
286 <step performance=
"required">
289 Run the command
<userinput>smbclient //BIGSERVER/TMP
</userinput>. You should
290 then be prompted for a password. You should use the password of the account
291 you are logged into the unix box with. If you want to test with
292 another account then add the
<parameter>-U
<replaceable>accountname
</replaceable></parameter> option to the end of
293 the command line. eg:
294 <userinput>smbclient //bigserver/tmp -Ujohndoe
</userinput>
298 It is possible to specify the password along with the username
300 <userinput>smbclient //bigserver/tmp -Ujohndoe%secret
</userinput>
304 Once you enter the password you should get the
<prompt>smb
></prompt> prompt. If you
305 don't then look at the error message. If it says
"invalid network
306 name" then the service
"tmp" is not correctly setup in your &smb.conf;.
310 If it says
"bad password" then the likely causes are:
316 you have shadow passords (or some other password system) but didn't
317 compile in support for them in
&smbd;
323 your
<command>valid users
</command> configuration is incorrect
329 you have a mixed case password and you haven't enabled the
<command>password
330 level
</command> option at a high enough level
336 the
<command>path =
</command> line in &smb.conf; is incorrect. Check it with
&testparm;
342 you enabled password encryption but didn't create the SMB encrypted
349 Once connected you should be able to use the commands
350 <command>dir
</command> <command>get
</command> <command>put
</command> etc.
351 Type
<command>help
<replaceable>command
</replaceable></command> for instructions. You should
352 especially check that the amount of free disk space shown is correct
353 when you type
<command>dir
</command>.
358 <step performance=
"required">
361 On the PC type the command
<userinput>net view \\BIGSERVER
</userinput>. You will
362 need to do this from within a
"dos prompt" window. You should get back a
363 list of available shares on the server.
367 If you get a
"network name not found" or similar error then netbios
368 name resolution is not working. This is usually caused by a problem in
369 nmbd. To overcome it you could do one of the following (you only need
370 to choose one of them):
375 fixup the
&nmbd; installation
379 add the IP address of BIGSERVER to the
<command>wins server
</command> box in the
380 advanced tcp/ip setup on the PC.
384 enable windows name resolution via DNS in the advanced section of
389 add BIGSERVER to your lmhosts file on the PC.
394 If you get a
"invalid network name" or
"bad password error" then the
395 same fixes apply as they did for the
<userinput>smbclient -L
</userinput> test above. In
396 particular, make sure your
<command>hosts allow
</command> line is correct (see the man
401 Also, do not overlook that fact that when the workstation requests the
402 connection to the samba server it will attempt to connect using the
403 name with which you logged onto your Windows machine. You need to make
404 sure that an account exists on your Samba server with that exact same
409 If you get
"specified computer is not receiving requests" or similar
410 it probably means that the host is not contactable via tcp services.
411 Check to see if the host is running tcp wrappers, and if so add an entry in
412 the
<filename>hosts.allow
</filename> file for your client (or subnet, etc.)
417 <step performance=
"required">
420 Run the command
<userinput>net use x: \\BIGSERVER\TMP
</userinput>. You should
421 be prompted for a password then you should get a
"command completed
422 successfully" message. If not then your PC software is incorrectly
423 installed or your smb.conf is incorrect. make sure your
<command>hosts allow
</command>
424 and other config lines in &smb.conf; are correct.
428 It's also possible that the server can't work out what user name to
429 connect you as. To see if this is the problem add the line
<command>user =
430 <replaceable>username
</replaceable></command> to the
<command>[tmp]
</command> section of
431 &smb.conf; where
<replaceable>username
</replaceable> is the
432 username corresponding to the password you typed. If you find this
433 fixes things you may need the username mapping option.
437 It might also be the case that your client only sends encrypted passwords
438 and you have
<command>encrypt passwords = no
</command> in &smb.conf;
439 Turn it back on to fix.
444 <step performance=
"required">
447 Run the command
<userinput>nmblookup -M
<replaceable>testgroup
</replaceable></userinput> where
448 <replaceable>testgroup
</replaceable> is the name of the workgroup that your Samba server and
449 Windows PCs belong to. You should get back the IP address of the
450 master browser for that workgroup.
454 If you don't then the election process has failed. Wait a minute to
455 see if it is just being slow then try again. If it still fails after
456 that then look at the browsing options you have set in &smb.conf;. Make
457 sure you have
<command>preferred master = yes
</command> to ensure that
458 an election is held at startup.
463 <step performance=
"required">
466 From file manager try to browse the server. Your samba server should
467 appear in the browse list of your local workgroup (or the one you
468 specified in smb.conf). You should be able to double click on the name
469 of the server and get a list of shares. If you get a
"invalid
470 password" error when you do then you are probably running WinNT and it
471 is refusing to browse a server that has no encrypted password
472 capability and is in user level security mode. In this case either set
473 <command>security = server
</command> AND
474 <command>password server = Windows_NT_Machine
</command> in your
475 &smb.conf; file, or make sure
<command>encrypted passwords
</command> is
484 <title>Still having troubles?
</title>
486 <para>Read the chapter on
487 <link linkend=
"problems">Analysing and Solving Problems
</link>.