1

From one day to another, my samba share (Debian 8 with current Samba 4.1.17) stopped turning up in the windows network neighborhood (Win 10). For a few days it was still accessible by typing \\servername in the addressline, but this is not possible anymore now.

The shares are, however, still accessible by typing \\192.168.200.10 (the servers ip) in the address line, so the service is up & running, firewall lets the traffic in etc.

Since I didn't change any configs, I guess some update broke something. I tried everything I found to fix this issue, but no luck.

Question is now: How can I make the server show up in the network neighborhood like it did before, and make it accessible by hostname again? It's hard to get the family to always type in the IP.

EDIT: After reinstalling every package remotely connected to samba and copy-pasting the config back, I can access the shares via \\SERVER\share, but the server does still not show up in the network neighborhood.

Here come the smb.conf and iptables config:

smb.conf:

[global]
domain master = yes
preferred master = yes
local master = yes
wins support = yes
os level = 255
workgroup = WORKGROUP
netbios name = SERVER
security = user
guest ok = yes
guest account = nobody
map to guest = bad user
name resolve order = bcast lmhosts host wins

# disable printer stuff
load printers = no
printing = bsd
printcap name = /dev/null
disable spoolss = yes

[Share]
path = /path/to/share
force user = nobody
read only = No
create mask = 0777
force create mode = 0777
directory mask = 02777
force directory mode = 02777
browseable = yes
public = yes

iptables config:

root@SERVER:/etc/samba# iptables -L -n -v
Chain INPUT (policy ACCEPT 2070 packets, 209K bytes)
 pkts bytes target     prot opt in     out     source               destination
  463 83236 fail2ban-owncloud  tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            multiport dports 80,443
  463 83236 fail2ban-apache-nohome  tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            multiport dports 80,443
  463 83236 fail2ban-apache-modsecurity  tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            multiport dports 80,443
  463 83236 fail2ban-apache-overflows  tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            multiport dports 80,443
  463 83236 fail2ban-apache-noscript  tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            multiport dports 80,443
 1519  117K fail2ban-ssh-ddos  tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            multiport dports 22
 1519  117K fail2ban-ssh  tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            multiport dports 22
  600 47664 ACCEPT     udp  --  eth0   *       0.0.0.0/0            0.0.0.0/0            udp dpt:137 state NEW,ESTABLISHED
   46 10365 ACCEPT     udp  --  eth0   *       0.0.0.0/0            0.0.0.0/0            udp dpt:138 state NEW,ESTABLISHED
   18  1983 ACCEPT     tcp  --  eth0   *       0.0.0.0/0            0.0.0.0/0            tcp dpt:139 state NEW,ESTABLISHED
73360   99M ACCEPT     tcp  --  eth0   *       0.0.0.0/0            0.0.0.0/0            tcp dpt:445 state NEW,ESTABLISHED

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain OUTPUT (policy ACCEPT 1605 packets, 284K bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 ACCEPT     udp  --  *      eth0    0.0.0.0/0            0.0.0.0/0            udp spt:137 state ESTABLISHED
   11  2310 ACCEPT     udp  --  *      eth0    0.0.0.0/0            0.0.0.0/0            udp spt:138 state ESTABLISHED
   17  1964 ACCEPT     tcp  --  *      eth0    0.0.0.0/0            0.0.0.0/0            tcp spt:139 state ESTABLISHED
83301   26M ACCEPT     tcp  --  *      eth0    0.0.0.0/0            0.0.0.0/0            tcp spt:445 state ESTABLISHED

Chain fail2ban-apache-modsecurity (1 references)
 pkts bytes target     prot opt in     out     source               destination
  463 83236 RETURN     all  --  *      *       0.0.0.0/0            0.0.0.0/0

Chain fail2ban-apache-nohome (1 references)
 pkts bytes target     prot opt in     out     source               destination
  463 83236 RETURN     all  --  *      *       0.0.0.0/0            0.0.0.0/0

Chain fail2ban-apache-noscript (1 references)
 pkts bytes target     prot opt in     out     source               destination
  463 83236 RETURN     all  --  *      *       0.0.0.0/0            0.0.0.0/0

Chain fail2ban-apache-overflows (1 references)
 pkts bytes target     prot opt in     out     source               destination
  463 83236 RETURN     all  --  *      *       0.0.0.0/0            0.0.0.0/0

Chain fail2ban-owncloud (1 references)
 pkts bytes target     prot opt in     out     source               destination
  463 83236 RETURN     all  --  *      *       0.0.0.0/0            0.0.0.0/0

Chain fail2ban-ssh (1 references)
 pkts bytes target     prot opt in     out     source               destination
 1519  117K RETURN     all  --  *      *       0.0.0.0/0            0.0.0.0/0

Chain fail2ban-ssh-ddos (1 references)
 pkts bytes target     prot opt in     out     source               destination
 1519  117K RETURN     all  --  *      *       0.0.0.0/0            0.0.0.0/0

smbd and nmbd are running:

root@SERVER:/etc/samba# pgrep -l mbd
5999 smbd
6000 smbd
6023 nmbd
6024 nmbd

This

 smbclient -L localhost 

yields

    SERVER              Samba 4.1.17-Debian

    Workgroup            Master
    ---------            -------
    WORKGROUP            SERVER

so it looks like the server is correctly elected master.

  • What exactly are you trying to fix? Do you want the samba share to show up in windows homegroup? Do you want it to be accessible by a hostname? Do you want to map it as a network drive? – ecube Dec 29 '15 at 17:40
  • I want it to show up in the network neighborhood like it did before, and make it accessible by hostname again. It's hard to get the family to always type in the IP. – user3696412 Dec 29 '15 at 18:40
0

Sounds like a DNS problem. This is is more of a hackish workaround, but what you can do is add an entry in your HOSTS file (under %SystemRoot%\System32\drivers\etc\hosts) which maps the IP address to the hostname. Just add a new line with IP_ADDRESS HOSTNAME in it (example: 192.168.200.10 servername). This will allow your computer to resolve servername to the ip address. It's less than ideal because you have to do this to all the computers, and you also have to update your hosts file whenever your server's ip changes. Meanwhile, you can check your router settings to see if you can manually assign a hostname to the server.

https://en.wikipedia.org/wiki/Hosts_(file)

| improve this answer | |
  • Possible, but really not nice, since there are a couple of pc's on the network. Furthermore, DNS resolution works for https (owncloud running on the server), is there a difference between DNS for Samba and for http? Additionally see the edits above. – user3696412 Dec 29 '15 at 22:49
  • There is no difference between DNS for samba, http, or anything really; DNS translates a hostname into an IP address for any application. If the hostname works when you browse to it on https, have you tried pinging it? – ecube Dec 30 '15 at 3:10
  • Yes, pinging it works fine as well. Might be interesting that accessing via \\SERVER\Share does not work every time, sometimes I have to try 3-5 times until the share is displayed... – user3696412 Dec 30 '15 at 6:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.