Chapter 26. Diagnosing your samba server

26.1. Introduction

This file contains a list of tests you can perform to validate your Samba server. It also tells you what the likely cause of the problem is if it fails any one of these steps. If it passes all these tests then it is probably working fine.

You should do ALL the tests, in the order shown. We have tried to carefully choose them so later tests only use capabilities verified in the earlier tests.

If you send one of the samba mailing lists an email saying "it doesn't work" and you have not followed this test procedure then you should not be surprised your email is ignored.

26.2. Assumptions

In all of the tests it is assumed you have a Samba server called BIGSERVER and a PC called ACLIENT both in workgroup TESTGROUP.

The procedure is similar for other types of clients.

It is also assumed you know the name of an available share in your smb.conf. I will assume this share is called "tmp". You can add a "tmp" share like by adding the following to smb.conf:


[tmp]
 comment = temporary files 
 path = /tmp
 read only = yes

THESE TESTS ASSUME VERSION 3.0.0 OR LATER OF THE SAMBA SUITE. SOME COMMANDS SHOWN DID NOT EXIST IN EARLIER VERSIONS

Please pay attention to the error messages you receive. If any error message reports that your server is being unfriendly you should first check that you IP name resolution is correctly set up. eg: Make sure your /etc/resolv.conf file points to name servers that really do exist.

Also, if you do not have DNS server access for name resolution please check that the settings for your smb.conf file results in "dns proxy = no". The best way to check this is with "testparm smb.conf"

26.3. Tests

26.3.3. Test 3

Run the command "smbclient -L BIGSERVER" on the unix box. You should get a list of available shares back.

If you get a error message containing the string "Bad password" then you probably have either an incorrect "hosts allow", "hosts deny" or "valid users" line in your smb.conf, or your guest account is not valid. Check what your guest account is using "testparm" and temporarily remove any "hosts allow", "hosts deny", "valid users" or "invalid users" lines.

If you get a "connection refused" response then the smbd server may not be running. If you installed it in inetd.conf then you probably edited that file incorrectly. If you installed it as a daemon then check that it is running, and check that the netbios-ssn port is in a LISTEN state using "netstat -a".

If you get a "session request failed" then the server refused the connection. If it says "Your server software is being unfriendly" then its probably because you have invalid command line parameters to smbd, or a similar fatal problem with the initial startup of smbd. Also check your config file (smb.conf) for syntax errors with "testparm" and that the various directories where samba keeps its log and lock files exist.

There are a number of reasons for which smbd may refuse or decline a session request. The most common of these involve one or more of the following smb.conf file entries:

	hosts deny = ALL
	hosts allow = xxx.xxx.xxx.xxx/yy
	bind interfaces only = Yes

In the above, no allowance has been made for any session requests that will automatically translate to the loopback adaptor address 127.0.0.1. To solve this problem change these lines to:

	hosts deny = ALL
	hosts allow = xxx.xxx.xxx.xxx/yy 127.

Do NOT use the "bind interfaces only" parameter where you may wish to use the samba password change facility, or where smbclient may need to access local service for name resolution or for local resource connections. (Note: the "bind interfaces only" parameter deficiency where it will not allow connections to the loopback address will be fixed soon).

Another common cause of these two errors is having something already running on port 139, such as Samba (ie: smbd is running from inetd already) or something like Digital's Pathworks. Check your inetd.conf file before trying to start smbd as a daemon, it can avoid a lot of frustration!

And yet another possible cause for failure of TEST 3 is when the subnet mask and / or broadcast address settings are incorrect. Please check that the network interface IP Address / Broadcast Address / Subnet Mask settings are correct and that Samba has correctly noted these in the log.nmb file.

26.4. Still having troubles?

Try the mailing list or newsgroup, or use the ethereal utility to sniff the problem. The official samba mailing list can be reached at samba@samba.org. To find out more about samba and how to subscribe to the mailing list check out the samba web page at http://samba.org/samba

Also look at the other docs in the Samba package!