Added check for something already binding to port 139 to TEST 3
[kai/samba.git] / docs / textdocs / DIAGNOSIS.txt
1 DIAGNOSING YOUR SAMBA SERVER
2 ============================
3
4 This file contains a list of tests you can perform to validate your
5 Samba server. It also tells you what the likely cause of the problem
6 is if it fails any one of these steps. If it passes all these tests
7 then it is probably working fine.
8
9 You should do ALL the tests, in the order shown. I have tried to
10 carefully choose them so later tests only use capabilities verified in
11 the earlier tests.
12
13 I would welcome additions to this set of tests. Please mail them to
14 samba-bugs@anu.edu.au
15
16 If you send me an email saying "it doesn't work" and you have not
17 followed this test procedure then you should not be surprised if I
18 ignore your email.
19
20
21 ASSUMPTIONS
22 -----------
23
24 In all of the tests I assume you have a Samba server called BIGSERVER
25 and a PC called ACLIENT. I also assume the PC is running windows for
26 workgroups with a recent copy of the microsoft tcp/ip stack. The
27 procedure is similar for other types of clients.
28
29 I also assume you know the name of a available share in your
30 smb.conf. I will assume this share is called "tmp". You can add a
31 "tmp" share like by adding the following to smb.conf:
32
33 [tmp]
34  comment = temporary files 
35  path = /tmp
36  read only = yes
37
38
39 THESE TESTS ASSUME VERSION 1.9.15 OR LATER OF THE SAMBA SUITE. SOME
40 COMMANDS SHOWN DID NOT EXIST IN EARLIER VERSIONS
41
42
43 TEST 1:
44 -------
45
46 run the command "testparm". If it reports any errors then your
47 smb.conf configuration file is faulty.
48
49
50 TEST 2:
51 -------
52
53 run the command "ping BIGSERVER" from the PC and "ping ACLIENT" from
54 the unix box. If you don't get a valid response then your TCP/IP
55 software is not correctly installed. 
56
57 Note that you will need to start a "dos prompt" window on the PC to
58 run ping.
59
60 If you get a message saying "host not found" or similar then your DNS
61 software or /etc/hosts file is not correctly setup. It is possible to
62 run samba without DNS entries for the server and client, but I assume
63 you do have correct entries for the remainder of these tests.
64
65
66 TEST 3:
67 -------
68
69 run the command "smbclient -L BIGSERVER -U%" on the unix box. You
70 should get a list of available shares back. 
71
72 If you get a error message containing the string "Bad password" then
73 you probably have either an incorrect "hosts allow", "hosts deny" or
74 "valid users" line in your smb.conf, or your guest account is not
75 valid. Check what your guest account is using "testparm" and
76 temporarily remove any "hosts allow", "hosts deny", "valid users" or
77 "invalid users" lines.
78
79 If you get a "connection refused" response then the smbd server could
80 not be run. If you installed it in inetd.conf then you probably edited
81 that file incorrectly. If you installed it as a daemon then check that
82 it is running, and check that the netbios-ssn port is in a LISTEN
83 state using "netstat -a".
84
85 If you get a "session request failed" then the server refused the
86 connection. If it says "your server software is being unfriendly" then
87 its probably because you have invalid command line parameters to smbd,
88 or a similar fatal problem with the initial startup of smbd. Also
89 check your config file for syntax errors with "testparm". 
90
91 Another common cause of these two errors is having something already running 
92 on port 139, such as Samba (ie smbd is running from inetd already) or something
93 like Digital's Pathworks. Check your inetd.conf file before trying to start
94 smbd as a daemon, it can avoid a lot of frustration!
95
96
97 TEST 4:
98 -------
99
100 run the command "nmblookup -B BIGSERVER __SAMBA__". You should get the
101 IP address of your Samba server back.
102
103 If you don't then nmbd is incorrectly installed. Check your inetd.conf
104 if yu run it from there, or that the daemon is running and listening
105 to udp port 137.
106
107 One common problem is that many inetd implementations can't take many
108 parameters on the command line. If this is the case then create a
109 one-line script that contains the right parameters and run that from
110 inetd.
111
112 TEST 5:
113 -------
114
115 run the command "nmblookup -B ACLIENT '*'"
116
117 You should get the PCs IP address back. If you don't then the client
118 software on the PC isn't installed correctly, or isn't started, or you
119 got the name of the PC wrong. Note that you probably won't get a "node
120 status response" from the PC due to a bug in the microsoft netbios
121 nameserver implementation (it responds to the wrong port number).
122
123 TEST 6:
124 -------
125
126 run the command "nmblookup -d 2 '*'"
127
128 This time we are trying the same as the previous test but are trying
129 it via a broadcast to the default broadcast address. A number of
130 Netbios/TCPIP hosts on the network should respond, although Samba may
131 not catch all of the responses in the short time it listens. You
132 should see "got a positive name query response" messages from several
133 hosts. 
134
135 If this doesn't give a similar result to the previous test then
136 nmblookup isn't correctly getting your broadcast address through its
137 automatic mechanism. In this case you should experiment with the -B
138 option which allows you to manually specify the broadcast address,
139 overriding the automatic detection. You should try different broadcast
140 addresses until your find the one that works. It will most likely be
141 something like a.b.c.255 as microsoft tcpip stacks only listen on 1's
142 based broadcast addresses. If you get stuck then ask your local
143 networking guru for help (and show them this paragraph).
144
145 If you find you do need the -B option (ie. the automatic detection
146 doesn't work) then you should add the -B option with the right
147 broadcast address for your network to the command line of nmbd in
148 inetd.conf or in the script you use to start nmbd as a daemon. Once
149 you do this go back to the "nmblookup __SAMBA__ -B BIGSERVER" test to
150 make sure you have it running properly.
151
152 If your PC and server aren't on the same subnet then you will need to
153 use the -B option to set the broadcast address to the that of the PCs
154 subnet.
155
156 TEST 7:
157 -------
158
159 run the command "smbclient '\\BIGSERVER\TMP'". You should then be
160 prompted for a password. You should use the password of the account
161 you are logged into the unix box with. If you want to test with
162 another account then add the -U <accountname> option to the command
163 line. 
164
165 Once you enter the password you should get the "smb>" prompt. If you
166 don't then look at the error message. If it says "invalid network
167 name" then the service "tmp" is not correctly setup in your smb.conf.
168
169 If it says "bad password" then the likely causes are:
170
171 - you have shadow passords (or some other password system) but didn't
172 compile in support for them in smbd
173 - your "valid users" configuration is incorrect
174 - you have a mixed case password and you haven't enabled the "password
175 level" option at a high enough level
176 - the "path =" line in smb.conf is incorrect. Check it with testparm
177
178 Once connected you should be able to use the commands "dir" "get"
179 "put" etc. Type "help <command>" for instructions. You should
180 especially check that the amount of free disk space shown is correct
181 when you type "dir".
182
183
184 TEST 8:
185 -------
186
187 On the PC type the command "net view \\BIGSERVER". You will need to do
188 this from within a "dos prompt" window. You should get back a list of
189 available shares on the server.
190
191 If you get a "network name not found" or similar error then netbios
192 name resolution is not working. This is usually caused by a problem in
193 nmbd. To overcome it you could do one of the following (you only need
194 to choose one of them):
195
196 - fixup the nmbd installation
197 - add the IP address of BIGSERVER to the "wins server" box in the
198 advanced tcp/ip setup on the PC.
199 - enable windows name resolution via DNS in the advanced section of
200 the tcp/ip setup
201 - add BIGSERVER to your lmhosts file on the PC.
202
203 If you get a "invalid network name" or "bad password error" then the
204 same fixes apply as they did for the "smbclient -L" test above. In
205 particular, make sure your "hosts allow" line is correct (see the man
206 pages)
207
208
209 TEST 9:
210 --------
211
212 run the command "net use x: \\BIGSERVER\TMP". You should be prompted
213 for a password then you should get a "command completed successfully"
214 message. If not then your PC software is incorrectly installed or your
215 smb.conf is incorrect. make sure your "hosts allow" and other config
216 lines in smb.conf are correct.
217
218 It's also possible that the server can't work out what user name to
219 connect you as. To see if this is the problem add the line "user =
220 USERNAME" to the [tmp] section of smb.conf where "USERNAME" is the
221 username corresponding to the password you typed. If you find this
222 fixes things you may need the username mapping option.
223
224
225 TEST 10:
226 --------
227
228 From file manager try to browse the server. Your samba server should
229 appear in the browse list of your local workgroup (or the one you
230 specified in the Makefile). You should be able to double click on the
231 name of the server and get a list of shares. If you get a "invalid
232 password" error when you do then you are probably running WinNT and it
233 is refusing to browse a server that has no encrypted password
234 capability and is in user level security mode.
235
236
237 Still having troubles?
238 ----------------------
239
240 Try the mailing list or newsgroup, or use the tcpdump-smb utility to
241 sniff the problem.
242
243