Author Topic: Hidden shares  (Read 5365 times)

quentin.jodhaa

  • Zen Apprentice
  • *
  • Posts: 13
  • Karma: +1/-0
    • View Profile
Hidden shares
« on: July 07, 2011, 07:28:35 pm »
Hi all,

Here is my 2 cts on how to hide shares with Zentyal. Thanks to José for putting me on the right track, I just modified one thing.

1) Create the shares with Zentyal as you normally do

2) Prepare the configuration file

Code: [Select]
mkdir -p /etc/ebox/stubs/samba/
cp /usr/share/ebox/stubs/samba/smb.conf.mas /etc/ebox/stubs/samba/

3) Set up the "includes"

Code: [Select]
nano /etc/ebox/stubs/samba/smb.conf.mas
Modify the ligne 190 :
Code: [Select]
browseable = Yes
By :
Code: [Select]
include = /etc/samba/hiddenshares.conf
4) Configure the hidden shares
Code: [Select]
nano /etc/samba/hiddenshares.conf
Copy/paste in it the sections from /etc/samba/smb.conf of the shares you want to hide

Replace "browseable = yes" by "browseable = no", without the quotes, in each section

5) Restart samba
Code: [Select]
sudo /etc/init.d/ebox samba restart
I hope that will help.

If you have any idea of improvement, please let me know, and if it helped you, please let me know as well, it will make my day :)

To the Zentyal team : It would be awesome if in the Zentyal interface there was a box to tick : "Make invisible"

Cheers,

QJ

lordcolbert

  • Zen Apprentice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Re: Hidden shares
« Reply #1 on: March 28, 2015, 01:07:53 pm »
Quote
It would be awesome if in the Zentyal interface there was a box to tick : "Make invisible"

Tip taken from http://likov.me/zentyal/zentyal4ce-hidden-shares.php :

This way requires access to the command line using SSH or whatever - but only once.
Code: [Select]
cd /usr/share/zentyal/stubs/samba
cp shares.conf.mas shares.conf.mas.original
nano shares.conf.mas

There you have to find the block started with [<% $share->{share} %>]



Below this line, replace string "browseable = Yes" with the next piece of condition:
Code: [Select]
% if ($share->{comment} eq 'hidden') {
    browseable = No
% } else {
    browseable = Yes
% }

That's all! To make samba share hidden, all you need is to set comment "hidden" using GUI.