NethServer Version: 7.7.1908 Module: Active Directory File Server
Hello everyone,
my work to integrate NS with my services continue.
I’m trying to integrate the AD authentication on Openmediavault using NS as AD.
Unfortunately it’s bit a pain, since the samba version that OMV is using.
I was thinking to migrate the file server on a second instance of NS.
I tried and the integration is perfect, I can join the domain and use the users to setup the file server.
There are a couple of things I didn’t find out:
Recycle Bin autodelete policy: Is it possible to delete the recycle bin after N days? ( I can also managed by a script, but it will be useful have it from the GUI ).
Is it possible change the recycle bin name? Since the first letter is an R, it will be mix up with my document. Using something like “#Recycle Bin” should address it, since the folder will be on the top. I might change it in smb.conf, but probably it will be overwritten.
I didn’t see any Recycle bin for user home directory.
#!/bin/bash
# cleanup recycle dir:
# delete all files with last access time
# older than a specific number of days and
# remove all empty subdirs afterwards.
#
# make sure you set recycle:touch = yes
# in your smb.conf.
# set vars
recycle_dir='/mystorage/recycle/your_recycle_dir_name'
lastaccess_maxdays=30
# execute commands
find $recycle_dir -atime +$lastaccess_maxdays -type f -delete
find $recycle_dir -type d ! -path $recycle_dir -empty -delete
thank you for you reply.
While we can manage the policy with a script, recycle bin for home user should be implemented.
Is there any way I can manually add it in the config without it will be overwritten?
I saw you use templates which are integrated in the smb.conf, but I don’t if I can edit the template manually, probably they’ll be overwritten with some updates, isn’t it?
Do you have any suggestion to integrate NS AD with samba 4.9.x?
I’m fighting with the new version of OpenMediaVault 5 ( Debian 10 ) which is using samba 4.9.5.
AFAIK starting from version 4.8 something changed with the winbind so the config needs to be changed.
I saw NS is using samba 4.9.1 and I tried to take a look on this files:
nssswitch.conf, sssd.conf, smb.conf and krb5.conf, but I’m still having trouble with the authentication and user mapping.
I cannot post further details right now, but I’ll if someone can give some tips.
If users don’t use the option to see hidden files and folders, from Windows you can set each Recycle Bin as hidden.
Something like this shall work.
mkdir -p /etc/e-smith/templates-custom/etc/samba/smb.conf/ibay-default/
vi /etc/e-smith/templates-custom/etc/samba/smb.conf/ibay-default/01vfs_recycle_custom
{
#
# 01vfs_recycle_custom
#
# if repository is not set, default path .recycle is used
delete($ibay_vfs->{recycle}->{repository});
# or to set a specific name
# $ibay_vfs->{recycle}->{repository} = "#Recycle Bin";
'';
}
signal-event nethserver-samba-update
…at least while original template does not change drastically.
It is not set.
Yes, do not edit original templates as they could be overwritten by updates. Instead, create a template-custom (see docs).
Here's an indicative example.
mkdir -p /etc/e-smith/templates-custom/etc/samba/smb.conf/
vi /etc/e-smith/templates-custom/etc/samba/smb.conf/99custom
The 99custom file content is hard-coded (not dynamically generated):
…hoping smb.conf sees content from repeated sections.
Note: I was trying default and custom recycle bins and seems they don’t keep all deleted files and tree structure. Anyone can confirm it (no customization required)?