By default, Zentyal creates a Home Folder for each user created through the web interface and not through Active Directory Users & Computers (dsa.msc). To disable this action, modifying the Samba stub for Zentyal is the preferred method. In order to maintain the changes across Zentyal and Samba updates, a Samba stub should be copied and modified as outlined below.
Make the custom stubs directory.
$ sudo mkdir -p /etc/zentyal/stubs/samba
Copy the default Zentyal Samba stub to the directory just created. Modifying the default Zentyal Samba stub or Samba’s configuration file in /etc/samba/shares.conf will end up getting overwritten during a Samba update or Zentyal update.
$ sudo cp /usr/share/zentyal/stubs/samba/shares.conf.mas /etc/zentyal/stubs/samba/
The best solution is to now comment out the share in the stub configuration.
Edit /etc/zentyal/stubs/samba/shares.conf.mas.
In Zentyal 7.0 (Samba 4.11), find section in the file that begins with [homes] and comment out the lines as shown below, excluding the lines that begin with %.
...
</%init>
#[homes]
# comment = <% __('Home Directories') %>
# path = /home/%S
# read only = no
# browseable = no
# create mask = 0611
# directory mask = 0711
% my $rb = ($recycle xor defined($recycle_exceptions->{'users'}));
% my $objects = 'acl_xattr';
% unless ($disableFullAudit) {
% $objects .= ' full_audit';
% }
% if ($rb) {
% $objects .= ' recycle';
% }
# vfs objects = <% $objects %>
# full_audit:success = connect opendir disconnect unlink mkdir rmdir open rename
# 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} %>
% }
% }
# <% @shares ? "Shares\n" : "No shares configured" %>
...
Save the file and then restart Samba.
$ sudo zs samba restart
Confirm the changes by looking at /etc/samba/shares.conf.