2

I've recently upgraded my home server from Ubuntu 20.04 to 22.04 and it's been pretty rough. Today when attempting to connect to the file shares from Windows I got a connection refused message. I remember being asked about configuration files during the upgrade and chose to keep my smb.conf because the only difference were my configured shares.

Troubleshooting I went to the Services list on the Web Console and saw that smbd and nmbd were both listed as Not Running, masked. I had not run into this before and some searching seemed to indicate that the thing to do was to unmask it, start it, and if you get an error, check the logs.

  • systemctl unmask smbd.service && systemctl unmask nmbd.service
  • systemctl restart smbd.service nmbd.service
  • journalctl -xe

There were no errors starting the service, and the journalctl just said they had been started. The web console said they were running, even their detail pages, as did service --status-all but I still could not connect from windows or even with smbclient on the server. With debugging on it said it couldn't connect to 139 or 445. I tried looking at a longer log list and even in the /var/log/samba/ log files. No clues.

  • journalctl -r

1 Answer 1

1

Samba had been removed. Re-install to fix it.

I first tried following smbclient's non-debug error, NT_STATUS_CONNECTION_REFUSED, but that lead me in the wrong direction. Next I checked listening ports and did not see anything on those ports. I tried searching the process list and did not see smbd or nmbd except in journalctl processes. So I looked for another way to list running services and found systemctl list-units. It said the state of smbd and nmbd were loaded active exited. So I looked to apt for the smbd status and it was configured, not installed. I verified that I had /etc/init.d/smbd, but I did not have /usr/sbin/smbd. I had /etc/init.d/nmbd, but not /usr/sbin/nmbd. Samba had been uninstalled and I do not remember doing it.

  • netstat -tln | grep -e '\(139\|445\)'
  • systemctl list-units
  • apt search smbd

I installed the samba package and that pulled in a bunch of dependencies. Once it was installed my file share was accessible from Windows.

I am surprised and disappointed that the Web Console services list, along with service --status-all said that these processes were running instead of having an error because smbd was missing. At least systemctl list-units gave the clue about it being exited. Maybe the service being masked should have been a clue, but it was new to me. Also, be aware that while the web Terminal is handy, it doesn't seem to trigger the events to write to .bash_history.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .