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