Every now and then my Samba share stops working.

$ smbclient -U sambauser '\\192.168.12.11\Apartment'
do_connect: Connection to 192.168.12.11 failed (Error NT_STATUS_CONNECTION_REFUSED)

This is incredibly annoying, since it happens somewhat frequently too. I restart the container, with no fix. It might be client-side, but I’m boggled by how that could even occur. There are no logs in systemd for smbd. The firewall is disabled.

/etc/samba/smb.conf: https://pastebin.com/HNgw8YcV

  • greyfox@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    1 month ago

    Connection refused is generally a network level issue meaning that a firewall is rejecting the tcp handshake, or more likely samba is not listening on that IP.

    So you are attempting to connect to your samba server and the OS (not Samba) is saying there is no service running on that port so I am refusing your connection request.

    So you have one of these problems

    • Samba isn’t running in the first place
    • Samba is crashing, systemd might be restarting it so if this problem is intermittent this is most likely
    • you have firewall issues (you said firewall was off, but are they on the same subnet? Might be other firewalls in your network rejecting the connection?)
    • Samba is listening on a different interface. I see you have lo/eth0 in your config most distros don’t use eth0 anymore are you sure that is correct?

    Even if those interface names are correct sometimes network managers rename interfaces. So when Samba starts that might be the wrong interface name, but by the time you login it is correct. I would just remove that line and the bind interfaces only line as well unless you specifically need to bind to specific interfaces.

    Try connecting to samba from the server itself on 127.0.0.1, which will probably work just fine because lo is probably a correct interface.

    You can also look at what interfaces/IP samba is listening on by running one of these commands as root

    ss -tlp | grep 445

    netstat -nlp | grep 445