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