6681bdc4bcb69acfe26faf98fa788d10e0fc1b6c
[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 TEST 4:
92 -------
93
94 run the command "nmblookup -B BIGSERVER __SAMBA__". You should get the
95 IP address of your Samba server back.
96
97 If you don't then nmbd is incorrectly installed. Check your inetd.conf
98 if yu run it from there, or that the daemon is running and listening
99 to udp port 137.
100
101 One common problem is that many inetd implementations can't take many
102 parameters on the command line. If this is the case then create a
103 one-line script that contains the right parameters and run that from
104 inetd.
105
106 TEST 5:
107 -------
108
109 run the command "nmblookup -B ACLIENT '*'"
110
111 You should get the PCs IP address back. If you don't then the client
112 software on the PC isn't installed correctly, or isn't started, or you
113 got the name of the PC wrong. Note that you probably won't get a "node
114 status response" from the PC due to a bug in the microsoft netbios
115 nameserver implementation (it responds to the wrong port number).
116
117 TEST 6:
118 -------
119
120 run the command "nmblookup -d 2 '*'"
121
122 This time we are trying the same as the previous test but are trying
123 it via a broadcast to the default broadcast address. A number of
124 Netbios/TCPIP hosts on the network should respond, although Samba may
125 not catch all of the responses in the short time it listens. You
126 should see "got a positive name query response" messages from several
127 hosts. 
128
129 If this doesn't give a similar result to the previous test then
130 nmblookup isn't correctly getting your broadcast address through its
131 automatic mechanism. In this case you should experiment with the -B
132 option which allows you to manually specify the broadcast address,
133 overriding the automatic detection. You should try different broadcast
134 addresses until your find the one that works. It will most likely be
135 something like a.b.c.255 as microsoft tcpip stacks only listen on 1's
136 based broadcast addresses. If you get stuck then ask your local
137 networking guru for help (and show them this paragraph).
138
139 If you find you do need the -B option (ie. the automatic detection
140 doesn't work) then you should add the -B option with the right
141 broadcast address for your network to the command line of nmbd in
142 inetd.conf or in the script you use to start nmbd as a daemon. Once
143 you do this go back to the "nmblookup __SAMBA__ -B BIGSERVER" test to
144 make sure you have it running properly.
145
146 If your PC and server aren't on the same subnet then you will need to
147 use the -B option to set the broadcast address to the that of the PCs
148 subnet.
149
150 TEST 7:
151 -------
152
153 run the command "smbclient '\\BIGSERVER\TMP'". You should then be
154 prompted for a password. You should use the password of the account
155 you are logged into the unix box with. If you want to test with
156 another account then add the -U <accountname> option to the command
157 line. 
158
159 Once you enter the password you should get the "smb>" prompt. If you
160 don't then look at the error message. If it says "invalid network
161 name" then the service "tmp" is not correctly setup in your smb.conf.
162
163 If it says "bad password" then the likely causes are:
164
165 - you have shadow passords (or some other password system) but didn't
166 compile in support for them in smbd
167 - your "valid users" configuration is incorrect
168 - you have a mixed case password and you haven't enabled the "password
169 level" option at a high enough level
170 - the "path =" line in smb.conf is incorrect. Check it with testparm
171
172 Once connected you should be able to use the commands "dir" "get"
173 "put" etc. Type "help <command>" for instructions. You should
174 especially check that the amount of free disk space shown is correct
175 when you type "dir".
176
177
178 TEST 8:
179 -------
180
181 On the PC type the command "net view \\BIGSERVER". You will need to do
182 this from within a "dos prompt" window. You should get back a list of
183 available shares on the server.
184
185 If you get a "network name not found" or similar error then netbios
186 name resolution is not working. This is usually caused by a problem in
187 nmbd. To overcome it you could do one of the following (you only need
188 to choose one of them):
189
190 - fixup the nmbd installation
191 - add the IP address of BIGSERVER to the "wins server" box in the
192 advanced tcp/ip setup on the PC.
193 - enable windows name resolution via DNS in the advanced section of
194 the tcp/ip setup
195 - add BIGSERVER to your lmhosts file on the PC.
196
197 If you get a "invalid network name" or "bad password error" then the
198 same fixes apply as they did for the "smbclient -L" test above. In
199 particular, make sure your "hosts allow" line is correct (see the man
200 pages)
201
202
203 TEST 9:
204 --------
205
206 run the command "net use x: \\BIGSERVER\TMP". You should be prompted
207 for a password then you should get a "command completed successfully"
208 message. If not then your PC software is incorrectly installed or your
209 smb.conf is incorrect. make sure your "hosts allow" and other config
210 lines in smb.conf are correct.
211
212 It's also possible that the server can't work out what user name to
213 connect you as. To see if this is the problem add the line "user =
214 USERNAME" to the [tmp] section of smb.conf where "USERNAME" is the
215 username corresponding to the password you typed. If you find this
216 fixes things you may need the username mapping option.
217
218
219 TEST 10:
220 --------
221
222 From file manager try to browse the server. Your samba server should
223 appear in the browse list of your local workgroup (or the one you
224 specified in the Makefile). You should be able to double click on the
225 name of the server and get a list of shares. If you get a "invalid
226 password" error when you do then you are probably running WinNT and it
227 is refusing to browse a server that has no encrypted password
228 capability and is in user level security mode.
229
230
231 Still having troubles?
232 ----------------------
233
234 Try the mailing list or newsgroup, or use the tcpdump-smb utility to
235 sniff the problem.
236
237