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