Samba + LDAP: smbclient -L localhost fails (NT_STATUS_CONNECTION_REFUSED)

10,391

Judging by all of the ubuntu in your linked tutorials, I'm going out on a limb and guessing you're on Ubuntu.

Based on your netstat output, Samba is only binding on IPv6 and not on IPv4. This can be verified with this command:

smbclient -L ::1

To force Samba to bind to your v4 localhost, use interfaces to specify the IPs to bind.

Share:
10,391

Related videos on Youtube

user29600
Author by

user29600

Updated on September 18, 2022

Comments

  • user29600
    user29600 over 1 year

    I'm following Tuxnetworks tutorial, at the last line of the first part and I'm getting this error:

    sysadmin@samba:~$ sudo smbclient -L localhost
    Enter root's password:
    Connection to localhost failed (Error NT_STATUS_CONNECTION_REFUSED)
    

    I've read a few other threads where people seem to have the same issue but it either doesn't get resolved or their error isn't something I'm having troubles with.

    http://ubuntuforums.org/showthread.php?t=1510536 http://lists.samba.org/archive/samba/2009-March/147401.html

    testparm -s output:

    Processing section ...
    Global parameter logon script found in service section!
    ...
    Loaded services file OK.
    

    Despite the Global parameter... error it still loads the config fine.

    smb.conf file I'm using is the one available in their tutorial with the following changes:

    workgroup = MYDOMAIN.COM
    netbios name = SAMBA
    wins support = Yes
    

    sudo netstat -llptun output:

    ...
    tcp    0    0 0.0.0.0:389    0.0.0.0:*    LISTEN    1317/slapd
    tcp6   0    0 :::445         :::*         LISTEN    1414/smbd
    tcp6   0    0 :::389         :::*         LISTEN    1317/slapd
    tcp6   0    0 :::139         :::*         LISTEN    1414/smbd
    ...
    

    Anyone have any idea of why I would be getting NT_STATUS_CONNECTION_REFUSED when executing smbclient -L localhost?

  • user29600
    user29600 almost 13 years
    when I execute smbclient -L ::1 I'm now getting NT_STATUS_LOGON_FAILURE at least it's a different error now. What IPs do I need to use in the interfaces section?
  • Deb
    Deb almost 13 years
    @user29600 127.0.0.1/8 is good for testing IPv4 localhost, plus add whatever IPs you want to serve SMB on.
  • user29600
    user29600 almost 13 years
    I must have missed something in the tutorial. I've now gotten rid of the NT_STATUS_CONNECTION_REFUSED all together without the interfaces options. Now working on NT_STATUS_LOGON_FAILURE will post back later.