Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


SMB - Possible to Disable?
#1
Hi All.
I saw a few posts on this, but no real solution.

My question: Is it possible do permanently disable SMB share from mOode installed on RPi's ?

Thx alot!
Happy new-year to all!
Reply
#2
(01-07-2022, 09:49 PM)S_i_O Wrote: Hi All.
I saw a few posts on this, but no real solution.

My question: Is it possible do permanently disable SMB share from mOode installed on RPi's ?

Thx alot!
Happy new-year to all!

Sure.

As root, rename the file /etc/samba/smb.conf to something like /etc/samba/smb.conf.dist so that you still have it in case you want to reinstate it later but it won't be interpreted by smbd. Reboot and you'll find there are not smb shares on offer.

E.g.,
Code:
sudo mv /etc/samba/smb.conf /etc/samba/smb.conf.dist

Regards,
Kent
Reply
#3
(01-08-2022, 01:25 AM)TheOldPresbyope Wrote:
(01-07-2022, 09:49 PM)S_i_O Wrote: Hi All.
I saw a few posts on this, but no real solution.

My question: Is it possible do permanently disable SMB share from mOode installed on RPi's ?

Thx alot!
Happy new-year to all!

Sure.

As root, rename the file /etc/samba/smb.conf to something like /etc/samba/smb.conf.dist so that you still have it in case you want to reinstate it later but it won't be interpreted by smbd. Reboot and you'll find there are not smb shares on offer.

E.g.,
Code:
sudo mv /etc/samba/smb.conf /etc/samba/smb.conf.dist

Regards,
Kent

Thx for your great support as always!
Reply
#4
@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:  
  1. (this one makes me look sage) I wanted to leave open the possibility that other Samba functions might be wanted
  2. (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.
Reply
#5
Hi 
First suggestion didn't work.

Let my try your second and I'll get back with result's.

Thx
Reply
#6
Sorry to say this second idea does not work eighter...

sudo systemctl kill smbd
sudo systemctl disable smbd

I still see my mOode device showing up in Networks..
Both on my Linux box and iMac.

They seem to be advertising themselves still...

(Note: can't write any files in thought. That's a step forward)

Thx again!
Reply
#7
Whats the usage scenario where it would be necessary to hide Samba shares and the moode host on your home network?
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#8
(01-09-2022, 03:27 PM)S_i_O Wrote: Sorry to say this second idea does not work eighter...

sudo systemctl kill smbd
sudo systemctl disable smbd

I still see my mOode device showing up in Networks..
Both on my Linux box and iMac.

They seem to be advertising themselves still...

(Note: can't write any files in thought. That's a step forward)

Thx again!

There may be caching going on.

Tim has already twigged that you seem to want to hide the host itself. What I suggested turns off only the Samba aka SMB/CIFS service (after which there is no process listening to port 445). There remains mdns service (implemented in avahi) so that, for example, a moOde player can be discovered via the pseudodomain ".local".

Regards,
Kent
Reply
#9
(01-09-2022, 05:33 PM)Tim Curtis Wrote: Whats the usage scenario where it would be necessary to hide Samba shares and the moode host on your home network?
Hi Tim.
I'm using LMS, so all my media files are on it's share.

I wont store anything directly on the PI's running mOode.
So there is no need for me to see those devices anywhere really.

If a service is unused, I believe its best practice to disable it.
That's pretty much it  Smile
Reply
#10
(01-09-2022, 06:24 PM)TheOldPresbyope Wrote:
(01-09-2022, 03:27 PM)S_i_O Wrote: Sorry to say this second idea does not work eighter...

sudo systemctl kill smbd
sudo systemctl disable smbd

I still see my mOode device showing up in Networks..
Both on my Linux box and iMac.

They seem to be advertising themselves still...

(Note: can't write any files in thought. That's a step forward)

Thx again!

There may be caching going on.

Tim has already twigged that you seem to want to hide the host itself. What I suggested turns off only the Samba aka SMB/CIFS service (after which there is no process listening to port 445). There remains mdns service (implemented in avahi) so that, for example, a moOde player can be discovered via the pseudodomain ".local".

Regards,
Kent


I also tried what was posted on this thread:

https://raspberrypi.stackexchange.com/qu...-discovery

For some reason my Pi running MoOde never booted back Sad

Had to flash it back on SD card and start over.
So i'm not confident to try this again...
Reply


Forum Jump: