Author Topic: Share a hide folder  (Read 2013 times)

ricardocenteno

  • Zen Apprentice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Share a hide folder
« on: November 16, 2019, 10:56:46 pm »
Hello everyone!
I have some difficulty performing a hidden share using Zentyal. Every time I change the line "browsable = no" in the shares.conf file located in / etc / samba / it seems that the file returns to its original state. I tried to copy the share information and paste it in the /etc/samba/smb.conf file, but when I restart, all the information contained in the file is erased. How do I perform this hidden sharing? The goal is to create the roaming profile without the home folder, for example: \\srv-files\profile_user$ (as done in Windows).
Grateful for the attention.

doncamilo

  • Zen Samurai
  • ****
  • Posts: 478
  • Karma: +165/-1
    • View Profile
Re: Share a hide folder
« Reply #1 on: November 18, 2019, 12:56:26 pm »
- Do my pigeons bother you passing over your land?
- They block the sun!

G. Guareschi., Don Camillo.,

ricardocenteno

  • Zen Apprentice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Share a hide folder
« Reply #2 on: November 21, 2019, 10:25:13 pm »
:)

Read this: https://doc.zentyal.org/en/appendix-c.html#stubs

Cheers!

Hello doncamilo.
What would I have to do then? Ali shows the example of DNS, but I tried to do samba and couldn't, can you help me?
I want to create shares that will be hidden, will be responsible for users roaming profiles.
I thank you for your attention.
« Last Edit: November 22, 2019, 01:20:58 am by ricardocenteno »

ricardocenteno

  • Zen Apprentice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Share a hide folder
« Reply #3 on: November 23, 2019, 06:37:37 pm »
How do I disable this Zentyal imposition?

doncamilo

  • Zen Samurai
  • ****
  • Posts: 478
  • Karma: +165/-1
    • View Profile
Re: Share a hide folder
« Reply #4 on: December 02, 2019, 04:34:24 pm »
 :)

Code: [Select]
sudo mkdir -p /etc/zentyal/stubs/samba
sudo cp /usr/share/zentyal/stubs/samba/shares.conf.mas /etc/zentyal/stubs/samba/shares.conf.mas

You can customize your /etc/zentyal/stubs/samba/shares.conf.mas template to hide the shares which name contains a dot character, for instance,  this way:

Code: [Select]
(...)
# <% @shares ? "Shares\n" : "No shares configured" %>
% foreach my $share (@shares) {
[<% $share->{share} %>]
% if ($share->{comment}) {
    comment = <% $share->{comment} %>
% }
    path = <% $share->{path} %>
    force create mode = 0660
    force directory mode = 0660
% if (index($share->{share}, '.') != -1 ) {
    browseable = no 
% } else {
    browseable = yes
% }
% if ($share->{guest}) {
    guest ok = yes
    read only = no
% } elsif ($unmanagedAcls) {
    read only = no
% } else {
    valid users = <% $share->{validUsers} %>
    read list = <% $share->{readOnly} %>
    write list = <% $share->{readWrite} %>
    admin users = <% $share->{administrators} %>
% }
% my $rb = ($recycle xor defined($recycle_exceptions->{'share'}->{$share->{'share'}}));
% my $objects = 'acl_xattr';
% unless ($disableFullAudit) {
%   $objects .= ' full_audit';
% }
% if ($rb) {
%   $objects .= ' recycle';
% }
    vfs objects = <% $objects %>
% if ($unmanagedAcls) {
    acl_xattr:ignore system acls = yes
% }
    full_audit:failure = connect opendir disconnect unlink mkdir rmdir open rename
% if ($rb) {
%   foreach my $key (keys %{$recycle_config}) {
%       next unless $key;
    recycle: <% $key %> = <% $recycle_config->{$key} %>
%   }
% }

% }

Afterwards:

Code: [Select]
sudo zs samba restart

Cheers!
- Do my pigeons bother you passing over your land?
- They block the sun!

G. Guareschi., Don Camillo.,