first pass at updating head branch to be to be the same as the SAMBA_2_0 branch
[kai/samba.git] / docs / textdocs / DIAGNOSIS.txt
1 !==
2 !== DIAGNOSIS.txt for Samba release 2.0.4 18 May 1999
3 !==
4 Contributor:    Andrew Tridgell
5 Updated:        November 1, 1999
6
7 Subject:        DIAGNOSING YOUR SAMBA SERVER
8 ===========================================================================
9
10 This file contains a list of tests you can perform to validate your
11 Samba server. It also tells you what the likely cause of the problem
12 is if it fails any one of these steps. If it passes all these tests
13 then it is probably working fine.
14
15 You should do ALL the tests, in the order shown. I have tried to
16 carefully choose them so later tests only use capabilities verified in
17 the earlier tests.
18
19 If you send me an email saying "it doesn't work" and you have not
20 followed this test procedure then you should not be surprised if I
21 ignore your email.
22
23
24 ASSUMPTIONS
25 -----------
26
27 In all of the tests I assume you have a Samba server called BIGSERVER
28 and a PC called ACLIENT both in workgroup TESTGROUP. I also assume the
29 PC is running windows for workgroups with a recent copy of the
30 microsoft tcp/ip stack. Alternatively, your PC may be running Windows
31 95 or Windows NT (Workstation or Server).
32
33 The procedure is similar for other types of clients.
34
35 I also assume you know the name of an available share in your
36 smb.conf. I will assume this share is called "tmp". You can add a
37 "tmp" share like by adding the following to smb.conf:
38
39 [tmp]
40  comment = temporary files 
41  path = /tmp
42  read only = yes
43
44
45 THESE TESTS ASSUME VERSION 2.0.6 OR LATER OF THE SAMBA SUITE. SOME
46 COMMANDS SHOWN DID NOT EXIST IN EARLIER VERSIONS
47
48 Please pay attention to the error messages you receive. If any error message
49 reports that your server is being unfriendly you should first check that you
50 IP name resolution is correctly set up. eg: Make sure your /etc/resolv.conf
51 file points to name servers that really do exist.
52
53 Also, if you do not have DNS server access for name resolution please check
54 that the settings for your smb.conf file results in "dns proxy = no". The
55 best way to check this is with "testparm smb.conf"
56
57
58 TEST 1:
59 -------
60
61 In the directory in which you store your smb.conf file, run the command
62 "testparm smb.conf". If it reports any errors then your smb.conf
63 configuration file is faulty.
64
65 Note:   Your smb.conf file may be located in: /etc
66         Or in:   /usr/local/samba/lib
67
68
69 TEST 2:
70 -------
71
72 run the command "ping BIGSERVER" from the PC and "ping ACLIENT" from
73 the unix box. If you don't get a valid response then your TCP/IP
74 software is not correctly installed. 
75
76 Note that you will need to start a "dos prompt" window on the PC to
77 run ping.
78
79 If you get a message saying "host not found" or similar then your DNS
80 software or /etc/hosts file is not correctly setup. It is possible to
81 run samba without DNS entries for the server and client, but I assume
82 you do have correct entries for the remainder of these tests. 
83
84 Another reason why ping might fail is if your host is running firewall 
85 software. You will need to relax the rules to let in the workstation
86 in question, perhaps by allowing access from another subnet (on Linux
87 this is done via the ipfwadm program.)
88
89
90 TEST 3:
91 -------
92
93 Run the command "smbclient -L BIGSERVER" on the unix box. You
94 should get a list of available shares back. 
95
96 If you get a error message containing the string "Bad password" then
97 you probably have either an incorrect "hosts allow", "hosts deny" or
98 "valid users" line in your smb.conf, or your guest account is not
99 valid. Check what your guest account is using "testparm" and
100 temporarily remove any "hosts allow", "hosts deny", "valid users" or
101 "invalid users" lines.
102
103 If you get a "connection refused" response then the smbd server may
104 not be running. If you installed it in inetd.conf then you probably edited
105 that file incorrectly. If you installed it as a daemon then check that
106 it is running, and check that the netbios-ssn port is in a LISTEN
107 state using "netstat -a".
108
109 If you get a "session request failed" then the server refused the
110 connection. If it says "Your server software is being unfriendly" then
111 its probably because you have invalid command line parameters to smbd,
112 or a similar fatal problem with the initial startup of smbd. Also
113 check your config file (smb.conf) for syntax errors with "testparm"
114 and that the various directories where samba keeps its log and lock
115 files exist.
116
117 There are a number of reasons for which smbd may refuse or decline
118 a session request. The most common of these involve one or more of
119 the following smb.conf file entries:
120         hosts deny = ALL
121         hosts allow = xxx.xxx.xxx.xxx/yy
122         bind interfaces only = Yes
123
124 In the above, no allowance has been made for any session requests that
125 will automatically translate to the loopback adaptor address 127.0.0.1.
126 To solve this problem change these lines to:
127         hosts deny = ALL
128         hosts allow = xxx.xxx.xxx.xxx/yy 127.
129 Do NOT use the "bind interfaces only" parameter where you may wish to
130 use the samba password change facility, or where smbclient may need to
131 access local service for name resolution or for local resource
132 connections. (Note: the "bind interfaces only" parameter deficiency
133 where it will not allow connections to the loopback address will be
134 fixed soon).
135
136 Another common cause of these two errors is having something already running 
137 on port 139, such as Samba (ie: smbd is running from inetd already) or
138 something like Digital's Pathworks. Check your inetd.conf file before trying
139 to start smbd as a daemon, it can avoid a lot of frustration!
140
141 And yet another possible cause for failure of TEST 3 is when the subnet mask
142 and / or broadcast address settings are incorrect. Please check that the
143 network interface IP Address / Broadcast Address / Subnet Mask settings are
144 correct and that Samba has correctly noted these in the log.nmb file.
145
146 TEST 4:
147 -------
148
149 Run the command "nmblookup -B BIGSERVER __SAMBA__". You should get the
150 IP address of your Samba server back.
151
152 If you don't then nmbd is incorrectly installed. Check your inetd.conf
153 if you run it from there, or that the daemon is running and listening
154 to udp port 137.
155
156 One common problem is that many inetd implementations can't take many
157 parameters on the command line. If this is the case then create a
158 one-line script that contains the right parameters and run that from
159 inetd.
160
161
162 TEST 5:
163 -------
164
165 run the command "nmblookup -B ACLIENT '*'"
166
167 You should get the PCs IP address back. If you don't then the client
168 software on the PC isn't installed correctly, or isn't started, or you
169 got the name of the PC wrong. 
170
171 If ACLIENT doesn't resolve via DNS then use the IP address of the
172 client in the above test.
173
174
175 TEST 6:
176 -------
177
178 Run the command "nmblookup -d 2 '*'"
179
180 This time we are trying the same as the previous test but are trying
181 it via a broadcast to the default broadcast address. A number of
182 Netbios/TCPIP hosts on the network should respond, although Samba may
183 not catch all of the responses in the short time it listens. You
184 should see "got a positive name query response" messages from several
185 hosts. 
186
187 If this doesn't give a similar result to the previous test then
188 nmblookup isn't correctly getting your broadcast address through its
189 automatic mechanism. In this case you should experiment use the
190 "interfaces" option in smb.conf to manually configure your IP
191 address, broadcast and netmask. 
192
193 If your PC and server aren't on the same subnet then you will need to
194 use the -B option to set the broadcast address to the that of the PCs
195 subnet.
196
197 This test will probably fail if your subnet mask and broadcast address are
198 not correct. (Refer to TEST 3 notes above).
199
200 TEST 7:
201 -------
202
203 Run the command "smbclient //BIGSERVER/TMP". You should then be
204 prompted for a password. You should use the password of the account
205 you are logged into the unix box with. If you want to test with
206 another account then add the -U <accountname> option to the end of
207 the command line.  eg: smbclient //bigserver/tmp -Ujohndoe
208
209 Note: It is possible to specify the password along with the username
210 as follows:
211         smbclient //bigserver/tmp -Ujohndoe%secret
212
213 Once you enter the password you should get the "smb>" prompt. If you
214 don't then look at the error message. If it says "invalid network
215 name" then the service "tmp" is not correctly setup in your smb.conf.
216
217 If it says "bad password" then the likely causes are:
218
219 - you have shadow passords (or some other password system) but didn't
220 compile in support for them in smbd
221 - your "valid users" configuration is incorrect
222 - you have a mixed case password and you haven't enabled the "password
223 level" option at a high enough level
224 - the "path =" line in smb.conf is incorrect. Check it with testparm
225 - you enabled password encryption but didn't create the SMB encrypted
226 password file
227
228 Once connected you should be able to use the commands "dir" "get"
229 "put" etc. Type "help <command>" for instructions. You should
230 especially check that the amount of free disk space shown is correct
231 when you type "dir".
232
233
234 TEST 8:
235 -------
236
237 On the PC type the command "net view \\BIGSERVER". You will need to do
238 this from within a "dos prompt" window. You should get back a list of
239 available shares on the server.
240
241 If you get a "network name not found" or similar error then netbios
242 name resolution is not working. This is usually caused by a problem in
243 nmbd. To overcome it you could do one of the following (you only need
244 to choose one of them):
245
246 - fixup the nmbd installation
247 - add the IP address of BIGSERVER to the "wins server" box in the
248 advanced tcp/ip setup on the PC.
249 - enable windows name resolution via DNS in the advanced section of
250 the tcp/ip setup
251 - add BIGSERVER to your lmhosts file on the PC.
252
253 If you get a "invalid network name" or "bad password error" then the
254 same fixes apply as they did for the "smbclient -L" test above. In
255 particular, make sure your "hosts allow" line is correct (see the man
256 pages)
257
258 Also, do not overlook that fact that when the workstation requests the
259 connection to the samba server it will attempt to connect using the 
260 name with which you logged onto your Windows machine. You need to make
261 sure that an account exists on your Samba server with that exact same
262 name and password.
263
264 If you get "specified computer is not receiving requests" or similar
265 it probably means that the host is not contactable via tcp services.
266 Check to see if the host is running tcp wrappers, and if so add an entry in
267 the hosts.allow file for your client (or subnet, etc.)
268
269
270 TEST 9:
271 --------
272
273 Run the command "net use x: \\BIGSERVER\TMP". You should be prompted
274 for a password then you should get a "command completed successfully"
275 message. If not then your PC software is incorrectly installed or your
276 smb.conf is incorrect. make sure your "hosts allow" and other config
277 lines in smb.conf are correct.
278
279 It's also possible that the server can't work out what user name to
280 connect you as. To see if this is the problem add the line "user =
281 USERNAME" to the [tmp] section of smb.conf where "USERNAME" is the
282 username corresponding to the password you typed. If you find this
283 fixes things you may need the username mapping option.
284
285 TEST 10:
286 --------
287
288 Run the command "nmblookup -M TESTGROUP" where TESTGROUP is the name
289 of the workgroup that your Samba server and Windows PCs belong to. You
290 should get back the IP address of the master browser for that
291 workgroup.
292
293 If you don't then the election process has failed. Wait a minute to
294 see if it is just being slow then try again. If it still fails after
295 that then look at the browsing options you have set in smb.conf. Make
296 sure you have "preferred master = yes" to ensure that an election is
297 held at startup.
298
299 TEST 11:
300 --------
301
302 From file manager try to browse the server. Your samba server should
303 appear in the browse list of your local workgroup (or the one you
304 specified in smb.conf). You should be able to double click on the name
305 of the server and get a list of shares. If you get a "invalid
306 password" error when you do then you are probably running WinNT and it
307 is refusing to browse a server that has no encrypted password
308 capability and is in user level security mode. In this case either set
309 "security = server" AND "password server = Windows_NT_Machine" in your
310 smb.conf file, or enable encrypted passwords AFTER compiling in support
311 for encrypted passwords (refer to the Makefile).
312
313
314 Still having troubles?
315 ----------------------
316
317 Try the mailing list or newsgroup, or use the tcpdump-smb utility to
318 sniff the problem. The official samba mailing list can be reached at
319 samba@samba.org. To find out more about samba and how to
320 subscribe to the mailing list check out the samba web page at
321               http://samba.org/samba
322
323 Also look at the other docs in the Samba package!
324