Solved Samba server spamming logs

Nyakov

Member

Reaction score: 6
Messages: 38

Hi. I have very simple setup. One windows PC and one FreeBSD server with samba share.
I don't need anything regarding windows network management, printing, netbios etc. Only one share.

There is my smb4.conf:
Code:
[global]
server string = My Samba Server
netbios name = my-samba
workgroup = MYHOME

max log size = 1000
## Enable user-based security and map unknown users to the Guest user
security = user
encrypt passwords = true
map to guest = bad user
guest account = nobody

## Store DOS attributes in extended attributes (no mapping)
map hidden = no
map system = no
map archive = no
map readonly = no
#store dos attributes = yes

hosts allow = 192.168.1.5
interfaces = re0
bind interfaces only = yes


[share]
comment = Share
path = /my-pool/share
public = yes
guest only = yes
guest ok = yes
writable = yes
read only = no
directory mask = 0775
create mask = 0775
I get repeated messages from samba:
Code:
[2020/06/24 12:00:37.587594,  0] ../../source3/libsmb/nmblib.c:924(send_udp)
Packet send failed to 192.168.1.255(138) ERRNO=Permission denied
And few on load:
Code:
[2020/06/24 11:59:27.095232,  0] ../../source3/nmbd/nmbd_packets.c:180(send_netbios_packet)
send_netbios_packet: send_packet() to IP 192.168.1.1 port 137 failed

[2020/06/24 11:59:27.095328,  0] ../../source3/nmbd/nmbd_nameregister.c:582(register_name)
register_name: Failed to send packet trying to register name MYHOME<1b>
I played in config with:
Code:
local master = yes
domain master = yes
domain logons = no
preferred master = yes
But this wont change much.

I have firewall config:
Code:
$cmd 00270 allow tcp from $smbips to $hostip 139,445 in via $host_if setup keep-state
$cmd 00271 allow udp from $smbips to $hostip 139,445 in via $host_if
And most outband traffic is blocked.

Share work fine.

But my /var/log/messages get spammed.
As I understand samba tries to do some weird broadcast stuff (find worms and infect system I assume), how I can disable this?
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 9,283
Messages: 33,826

I don't need anything regarding windows network management, printing, netbios etc.
Simply turn off nmbd(8) then. It's not needed. Just add to rc.conf:
Code:
nmbd_enable="NO"
And restart Samba.

As I understand samba tries to do some weird broadcast stuff (find worms and infect system I assume)
No, these are the regular NetBIOS broadcasts. It has nothing to do with finding worms or infected systems.

For NetBT (NetBIOS over TCP/IP) you really only need TCP port 445. The 137, 138 and 139 ports are for the old NetBIOS protocol (pre-Windows 2000 systems).
 

rootbert

Well-Known Member

Reaction score: 103
Messages: 274

hm, I thought that its only necessary if you have an AD setup to open port 445, for all other configurations ports 137-139 are also necessary.
 
Top