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