@
S_i_O
Full disclosure - in this approach, the smbd (SMB server daemon) service is still enabled but isn’t configured to publish any shares. One can dig deeper into the O/S to disable the service itself. It’s not hard but I didn’t want to get into the sysop-level discussion.
Regards,
Kent
ETA: Changed my mind. I see use of systemctl showing up in other threads so let's go for the sysop-fu!
Instead of my hack, we can totally disable the smbd service from the command line
Code:
sudo systemctl kill smbd
sudo systemctl disable smbd
The first line kills any existing smbd processes and the second disables (duh!) the smbd service. This setting persists over reboots so no need to do it more than once.
At any time later, we can reverse the steps
Code:
sudo systemctl enable smbd
sudo systemctl start smbd
Note that if the /etc/samba/smb.conf file was renamed/moved it will have to be restored before any shares will appear on the LAN.
Sidebar question: this looks easy, Kent. Why didn't you start with this?
Answers:
- (this one makes me look sage) I wanted to leave open the possibility that other Samba functions might be wanted
- (this one just makes me look like a sage, e.g., old) My brain has fossilized, stuck in lessons I learned with the old Unix System 5 init. I have to think twice to remember the versatility of systemctl.