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