[Samba] smbclient ends in NT_STATUS_CONNECTION_REFUSED error

Rowland Penny
2017-06-14T09:48:59Z

On Wed, 14 Jun 2017 11:14:29 +0200
"L.P.H. van Belle via samba" <samba at lists.samba.org> wrote:

> Hai,
>
> Base on :
> >I have applied the changes as suggested.
> >After restarting the server, smbclient-command worked! But after I
> >restarted the Samba Client with
> > ?/etc/init.d/samba restart? I was once again confronted with the
> > same problem!
> >Again, only another server restart did the trick.
>
> Can you retry the restart samba with systemd and see if thats working
> better.
>
> Type :
> systemctl restart smbd
> systemctl restart nmbd
> systemctl restart winbind
>
>

That might help, but when I look very closely at what the OP posted, I
found this:

root at hsad-srv-03:~# cat /etc/samba/smb.conf

Followed by:

                netbios name = PDC
                server role = active directory domain controller

So, I take it that 'PDC' is a replacement for 'HSAD-SRV-03'

Now if we go further down in the post, there is this:

root at server:~# smbclient -L localhost -U%

This would seem to suggest that the OP is running the command on
another machine i.e. 'server' but connecting to the local machine.

He then restarts Samba and the command no longer works, but he then
runs:

root at server:~# smbclient -d10 -L localhost -U%

We can then extract the [global] part of the smb.conf from the output:

[global]
    workgroup = EXAMPLE
    realm = example.com
    netbios name = PDC
    server role = active directory domain controller
    idmap_ldb:use rfc2307 = yes
    dns forwarder = 192.168.15.1

Which seems to suggest that 'hsad-srv-03' and 'server' are the
same
machine, in which case, the command to restart Samba, should be:

systemctl restart samba-ad-dc

Rowland