Unable to connect to SAMBA. Port 139 is closed.

Discussion in 'Installation/Configuration' started by jcdole, Jul 15, 2008.

Thread Status:
Not open for further replies.
  1. jcdole

    jcdole New Member

    Hello.

    I have some problem, with a new configuration on a new PC.
    I want to setup a SAMBA PDC using an HOWTO.
    The configuration was working on 10.0 and I use the updated howto for 10.3

    Suse firewall is not active.

    Config :
    Opensuse 10.3 64 bits
    kernel 2.6.22.18-0.2 64 bits
    Samba-3.0.26a-3.7

    Problems :

    1°) Port 139 and 445 are not open.

    2°) smbd daemon is very often dead.

    Any help ?

    - - - - - - - - - - - - - - -

    LINUX-SRV:~ # smbclient -L localhost -N
    Error connecting to 127.0.0.1 (Connection refused)
    Connection to localhost failed (Error NT_STATUS_CONNECTION_REFUSED)
    LINUX-SRV:~ #


    LINUX-SRV:~ # smbclient -L LINUX-SRV -N -p 139
    Error connecting to 192.168.130.100 (Connection refused)
    Connection to LINUX-SRV failed (Error NT_STATUS_CONNECTION_REFUSED)
    LINUX-SRV:~ #


    LINUX-SRV:~ # echo "hello" | telnet localhost 139
    Trying 127.0.0.1...
    telnet: connect to address 127.0.0.1: Connection refused
    Trying ::1...
    LINUX-SRV:~ #


    LINUX-SRV:~ # echo "hello" | telnet localhost
    Trying 127.0.0.1...
    Connected to localhost.
    Escape character is '^]'.
    Connection closed by foreign host.
    LINUX-SRV:~ #


    LINUX-SRV:~ # netstat -an
    Active Internet connections (servers and established)
    Proto Recv-Q Send-Q Local Address Foreign Address State
    tcp 0 0 0.0.0.0:901 0.0.0.0:* LISTEN
    tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN
    tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN
    tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
    tcp 0 0 0.0.0.0:23 0.0.0.0:* LISTEN
    tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN
    tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
    tcp 0 0 192.168.169.100:43659 130.57.4.24:80 ESTABLISHED
    udp 0 0 0.0.0.0:32768 0.0.0.0:*
    udp 0 0 0.0.0.0:514 0.0.0.0:*
    udp 0 0 192.168.169.100:137 0.0.0.0:*
    udp 0 0 0.0.0.0:137 0.0.0.0:*
    udp 0 0 192.168.169.100:138 0.0.0.0:*
    udp 0 0 0.0.0.0:138 0.0.0.0:*
    udp 0 0 0.0.0.0:68 0.0.0.0:*
    udp 0 0 0.0.0.0:5353 0.0.0.0:*
    udp 0 0 0.0.0.0:111 0.0.0.0:*
    udp 0 0 0.0.0.0:631 0.0.0.0:*
    udp 0 0 192.168.169.100:123 0.0.0.0:*
    udp 0 0 127.0.0.1:123 0.0.0.0:*
    udp 0 0 0.0.0.0:123 0.0.0.0:*
    - - - - - - - -
    - - - - - - - -
    - - - - - - - -
    - - - - - - - -
    - - - - - - - -
    - - - - - - - -
    unix 3 [ ] STREAM CONNECTED 9520 /var/run/dbus/system_bus_socket
    unix 3 [ ] STREAM CONNECTED 9519
    unix 2 [ ] DGRAM 9358
    unix 3 [ ] STREAM CONNECTED 9261
    unix 3 [ ] STREAM CONNECTED 9260
    LINUX-SRV:~ #


    LINUX-SRV:~ # netstat -an | egrep ':(137|138|139|445)'
    udp 0 0 192.168.169.100:137 0.0.0.0:*
    udp 0 0 0.0.0.0:137 0.0.0.0:*
    udp 0 0 192.168.169.100:138 0.0.0.0:*
    udp 0 0 0.0.0.0:138 0.0.0.0:*
    LINUX-SRV:~ #


    LINUX-SRV:~ # nmap -p 1-65535 localhost
    Starting Nmap 4.20 ( Insecure.Org - Nmap Free Security Scanner, Tools & Hacking resources ) at 2008-07-14 23:19 CEST
    Interesting ports on localhost (127.0.0.1):
    Not shown: 65528 closed ports
    PORT STATE SERVICE
    22/tcp open ssh
    23/tcp open telnet
    25/tcp open smtp
    80/tcp open http
    111/tcp open rpcbind
    631/tcp open ipp
    901/tcp open samba-swat
    Nmap finished: 1 IP address (1 host up) scanned in 5.590 seconds
    LINUX-SRV:~ #


    LINUX-SRV:~ # ping 127.0.0.1
    PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.
    64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.080 ms
    64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.081 ms

    --- 127.0.0.1 ping statistics ---
    2 packets transmitted, 2 received, 0% packet loss, time 1002ms
    rtt min/avg/max/mdev = 0.080/0.080/0.081/0.009 ms
    LINUX-SRV:~ #


    LINUX-SRV:~ # ping LINUX-SRV
    PING LINUX-SRV.HATHOR.NWK (127.0.0.2) 56(84) bytes of data.
    64 bytes from LINUX-SRV.HATHOR.NWK (127.0.0.2): icmp_seq=1 ttl=64 time=0.065 ms
    64 bytes from LINUX-SRV.HATHOR.NWK (127.0.0.2): icmp_seq=2 ttl=64 time=0.070 ms
    64 bytes from LINUX-SRV.HATHOR.NWK (127.0.0.2): icmp_seq=3 ttl=64 time=0.061 ms

    --- LINUX-SRV.HATHOR.NWK ping statistics ---
    3 packets transmitted, 3 received, 0% packet loss, time 2006ms
    rtt min/avg/max/mdev = 0.061/0.065/0.070/0.007 ms
    LINUX-SRV:~ #


    LINUX-SRV:~ # ping 192.168.169.100
    PING 192.168.169.100 (192.168.169.100) 56(84) bytes of data.
    64 bytes from 192.168.169.100: icmp_seq=1 ttl=64 time=0.087 ms
    64 bytes from 192.168.169.100: icmp_seq=2 ttl=64 time=0.065 ms
    64 bytes from 192.168.169.100: icmp_seq=3 ttl=64 time=0.069 ms

    --- 192.168.169.100 ping statistics ---
    3 packets transmitted, 3 received, 0% packet loss, time 2003ms
    rtt min/avg/max/mdev = 0.065/0.073/0.087/0.013 ms
    LINUX-SRV:~ #


    LINUX-SRV: # chkconfig --list grep smb

    smb 0 : off 1 : off 2 : off 3 : on 4 : off 5 : on 6 : off
    smbfs 0 : off 1 : off 2 : off 3 : on 4 : off 5 : on 6 : off

    LINUX-SRV: # chkconfig --list grep nmb

    nmb 0 : off 1 : off 2 : off 3 : on 4 : off 5 : on 6 : off

    LINUX-SRV: #

    LINUX-SRV: # netstat -tdlupn |egrep '(137|138|139|445)'
    udp 0 0 192.168.169.100:137 0.0.0.0:* 5475/nmbd
    udp 0 0 0.0.0.0:137 0.0.0.0:* 5475/nmbd
    udp 0 0 192.168.169.100:138 0.0.0.0:* 5475/nmbd
    udp 0 0 0.0.0.0:138 0.0.0.0:* 5475/nmbd
    udp 0 0 192.168.169.100:123 0.0.0.0:* 3445/ntpd
    udp 0 0 127.0.0.1:123 0.0.0.0:* 3445/ntpd
    udp 0 0 0.0.0.0:123 0.0.0.0:* 3445/ntpd
    LINUX-SRV: #


    /ETC/SERVICES

    # Larry Peterson
    netbios-ns 137/tcp # NETBIOS Name Service
    netbios-ns 137/udp # NETBIOS Name Service
    netbios-dgm 138/tcp # NETBIOS Datagram Service
    netbios-dgm 138/udp # NETBIOS Datagram Service
    netbios-ssn 139/tcp # NETBIOS Session Service
    netbios-ssn 139/udp # NETBIOS Session Service

    # RFC 1568
    microsoft-ds 445/tcp # Microsoft-DS
    microsoft-ds 445/udp # Microsoft-DS



    LINUX-SRV:~ # testparm
    Load smb config files from /etc/samba/smb.conf
    Processing section "[netlogon]"
    Processing section "[profiles]"
    Processing section "[printers]"
    Processing section "[print$]"
    Processing section "[public]"
    Loaded services file OK.
    Server role: ROLE_DOMAIN_PDC
    Press enter to see a dump of your service definitions

    [global]
    dos charset = 850
    unix charset = ISO8859-1
    workgroup = HATHOR.NWK
    server string = Samba Server %v
    map to guest = Bad User
    passdb backend = ldapsam:ldap://127.0.0.1/
    syslog = 0
    log file = /var/log/samba/%m.log
    max log size = 100000
    time server = Yes
    deadtime = 10
    socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
    printcap name = cups
    add user script = /usr/local/sbin/smbldap-useradd -m "%u"
    delete user script = /usr/local/sbin/smbldap-userdel "%u"
    add group script = /usr/local/sbin/smbldap-groupadd -p "%g"
    add user to group script = /usr/local/sbin/smbldap-groupmod -m "%g" "%u"
    delete user from group script = /usr/local/sbin/smbldap-groupmod -x "%g" "%u"
    set primary group script = /usr/local/sbin/smbldap-usermod -g "%g" %u
    add machine script = /usr/local/sbin/smbldap-useradd -w -i %u
    logon script = logon.bat
    logon path =
    logon drive = V:
    logon home =
    domain logons = Yes
    os level = 65
    preferred master = Yes
    domain master = Yes
    wins support = Yes
    ldap admin dn = cn=Ldap_Admin,dc=ldap_hathor,dc=nwk
    ldap group suffix = ou=Groups
    ldap idmap suffix = ou=Idmap
    ldap machine suffix = ou=Computers,ou=Users
    ldap passwd sync = Yes
    ldap suffix = dc=ldap_hathor,dc=nwk
    ldap user suffix = ou=People,ou=Users
    create mask = 0640
    directory mask = 0750
    nt acl support = No
    printing = cups
    print command =
    lpq command = %p
    lprm command =
    case sensitive = No
    dont descend = /proc,/dev,/etc,/lib,/lost+found,/initrd

    [netlogon]
    path = /var/lib/samba/netlogon
    browseable = No

    [profiles]
    path = /var/lib/samba/profiles
    read only = No
    create mask = 0600
    directory mask = 0700
    guest ok = Yes
    profile acls = Yes
    browseable = No
    csc policy = disable

    [printers]
    comment = Network Printers
    path = /var/tmp/spool/samba
    guest ok = Yes
    printable = Yes
    browseable = No

    [print$]
    path = /var/lib/samba/drivers/
    valid users = "@Print Operators"
    write list = "@Print Operators"
    create mask = 0664
    directory mask = 0775

    [public]
    path = /data/publique
    read only = No
    guest ok = Yes
    LINUX-SRV:~ #
     
  2. sangamc

    sangamc New Member

    cant make a long post coz im on my blackberry. but a couple of things i do different:

    server name works if you set it up as
    localhost.localdomain = 127.0.0.1
    linux-srv.<your domain name> = 127.0.1.1 (instead of 127.0.0.2)

    i slao use smbclient -L localhost -U% to test if samba can be accessed.

    i normailly use redhat/fedora/centos ... ill have to ask my co worker more about suse to see how the firewall is configured.

    http://en.opensuse.org/Howto_setup_SUSE_as_SAMBA_PDC_with_OpenLDAP,_DYNDNS_and_CLAM

    this link is what i use for guidance on all different types of distros. i dont do the dns, dhcp or clam portions coz those services are already available in my network
     
  3. jcdole

    jcdole New Member

    Hello.

    I think the problem comes from port 139 that is closed for an unknown reason.
    The Suse firewall is not in use.


    LINUX-SRV:~ # echo "hello" | telnet localhost 139
    Trying 127.0.0.1...
    telnet: connect to address 127.0.0.1: Connection refused
    Trying ::1...
    LINUX-SRV:~ #


    LINUX-SRV:~ # echo "hello" | telnet localhost
    Trying 127.0.0.1...
    Connected to localhost.
    Escape character is '^]'.
    Connection closed by foreign host.
    LINUX-SRV:~ #
     
  4. sangamc

    sangamc New Member

    it may be that the port is in use by a previous install that didnt get removed completely. this would happen to me on occassion during my testing. you could always try and specifiy a different port in the config file to see if thats the issue
     
  5. jcdole

    jcdole New Member

    Hello.

    I have install a small linux on a new partition on the same PC ( with no firewall, no SAMBA, nothing but the minimum ).
    I am unable to telnet on any port.

    I think that the problem is to open port when not using the firewall. Isn't it ?

    I need help please .



    LINUX-SRV:~ # echo "hello" | telnet localhost 110
    Trying 127.0.0.1...
    telnet: connect to address 127.0.0.1: Connection refused
    Trying ::1...
    LINUX-SRV:~ #


    LINUX-SRV:~ # echo "hello" | telnet localhost
    Trying 127.0.0.1...
    Connected to localhost.
    Escape character is '^]'.
    Connection closed by foreign host.
    LINUX-SRV:~ #

    LINUX-SRV:~ # echo "hello" | telnet localhost 139
    Trying 127.0.0.1...
    telnet: connect to address 127.0.0.1: Connection refused
    Trying ::1...
    LINUX-SRV:~ #


    LINUX-SRV:~ # echo "hello" | telnet localhost
    Trying 127.0.0.1...
    Connected to localhost.
    Escape character is '^]'.
    Connection closed by foreign host.
    LINUX-SRV:~ #
    Edit/Delete Message
     
  6. sangamc

    sangamc New Member

    i tried your test commands on a working centos pdc with red hat directory server and samba fully configured and got the same results. i think we may be approaching this problem from the wrong angle.
     
  7. jcdole

    jcdole New Member

    Should be possible.

    But I used to install samba on suse linux 10.0 and x86 processor with no problem ( and no firewall ). This time my new pc is an X64 processor with suse 10.3.
     
  8. jcdole

    jcdole New Member

    Have uninstall samba and ldap.

    Have remove 32 bits libs.

    Have re-install samba and ldap x64 lib ( without 32 bits libs.

    No more problems.

    Thanks for your times.

    This thread should be closed.
     
Thread Status:
Not open for further replies.

Share This Page