[Samba] Connection Refuse

Ray Simard ray.simard at sylvan-glade.com
Thu Dec 19 08:17:01 GMT 2002

On Monday 09 August 2004 08:45, Prianggada I Tanaya wrote:

There are several things that might cause problems here.
> ...
> $ smbclient -U% -L
> added interface ip= bcast= nmask=
> error connecting to (Connection refused)
> Error connecting to (Connection refused)
> Connection to fk0000-msi-srv failed

This means that is not listening for SMB connections on port 139, 
which means that Samba server daemon smbd is either not running or has been 
started with some bogus arguments - more likely the former. There should be 
startup script somewhere that properly launches the Samba daemons. In mine 
(SuSE Linux) it's /etc/init.d/smb, which you'd run with "start" as argument.

You can check the running processes on to see if smbd and nmbd are 
running. You can also verify that they're listening properly with netstat:

$ netstat -nlA inet

You should see (at least) a line under local TCP addresses reading 
or, and lines under UDP for ....:137 and ...:138   If you 
don't see those, of if the ones you do see are not on either or the 
machine's public address, you won't be able to connect to it.

Some bad parameters in smb.conf can cause startup failures (e.g., a value for 
"interfaces =" that is impossible for the the machine). testparm may not 
catch that. Check the Samba logs if you suspect that (or just for good 
measure in any case!).

It's interesting that the failure message lists the NetBIOS name 
fk0000-msi-srv. If I read it right (someone correct me if not) there's either 
a WINS server on the network or an entry in hosts or lmhosts that gives the 
NetBIOS name-IP address mapping for that machine. If it is a WINS server, the 
daemons must have been running at one time for the WINS server to have 
learned of fk0000-msi-srv, and then were shut down later somehow. (I suppose 
it could be a running nmbd on the system, though it seems strange that you 
would have nmbd and not smbd running at a particular time - or does it?)

> using nmblookup, send anything ..., found this error.
> $ nmblookup -B '*'
> querying * on
> name_query failed to find name *

Here you're specifying as the broadcast address for name service 
(which, BTW, is an impossible broadcast address). The proper broadcast 
address for your network ( /16, a.k.a., class B) is (note the 
messages from smbclient you quoted at the top). You probably meant -U 
(unicast address) instead of -B (broadcast address).

Note that the nmblookup, when properly run, will show you the running SMB 
servers on the network even if the Samba daemons are not running on the 
machine you're using to run nmblookup. However, that machine will not appear 
in your nmblookups until you start the servers. Until then, as far as Samba 
and other SMB servers on the network (Samba and Windoze boxen) are concened, 
it doesn't exist.


Note: If you really get stumped, you can bump up the debug level and get more 
details about your command (enormously, if you wish!), with something like

$ smbclient -d 3 (rest of your command)

Try -d 10 just for fun... :-)

More information about the samba mailing list