OpenMediaVault e Active Directory
OpenMediaVault è una distribuzione Linux specifica per creare un server NAS, vediamo come associarla ad un dominio Active Directory per sfruttarne i permessi utente.
Per ogni informazione aggiuntiva si rimanda al thread specifico sul forum Active Directory / LDAP Revisited.
- Installare il sistema dalla ISO
- Aggiornare il sistema da shell tramite apt-get
- Riavviare
- Modificare /etc/nsswitch.conf e cambiare:
-
1234# cambiare dahosts: files mdns4_minimal [NOTFOUND=return] dns# cambiare inhosts: files dns mdns4_minimal [NOTFOUND=return]
-
- Dalla GUI abilitare il servizio Samba con l’aggiunta in Extra Options:
-
123456client signing = yesclient use spnego = yeskerberos method = secrets and keytabpassword server = dc.domain.comrealm = DOMAIN.COMsecurity = ads
-
- Da shell creare ed eseguire lo script ad-join.sh:
-
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103#!/bin/bashapt-get updateapt-get dist-upgrade# This script should join Debian Jessie (8) to an Active Directory domain.# Adapted from a script here. http://www.alandmoore.com/blog/2015/05/06/joining-debian-8-to-active-directory/if ! $(sudo which sssd 2>/dev/null); thenapt-get install krb5-user krb5-config sssd libpam-sss libnss-sss sssd-tools libsss-sudo libsasl2-modules-gssapi-mitfi# Get domain and userecho "Please enter the domain you wish to join: UPPER CASE?"read DOMAINecho "Please enter a domain admin login to use: "read ADMIN# create /sssd.confecho "[sssd]services = nss, pam, pac, sshconfig_file_version = 2domains = EXAMPLE.COM[domain/EXAMPLE.COM]id_provider = adaccess_provider = adauth_provider = adchpass_provider = ad#ldap_schema = rfc2307bis#ldap_schema = adldap_idmap_autorid_compat = True# Enumeration is discouraged for performance reasons.# OMV needs True to show users in ui and aclenumerate = True# timeout (integer) #### The default value for this parameter is 10 seconds.# This get the users in range to show in UI and ACLldap_idmap_range_min = 20000# ldap_idmap_range_max = 60000 ### Does not seem to work# ### Causes not able to start# If unneeded users or other objects show.# Use "dsquery user -name * " to see on windows with powershell#ldap_user_search_base = OU=SBSUsers,OU=Users,OU=MyBusiness,DC=example,DC=com# ldap_user_search_base = CN=Users,DC=example,DC=com# Use this if users are being logged in at /. OMV does this. Otherwise not tested# This example specifies /home/DOMAIN-FQDN/user as $HOME. Use with pam_mkhomedir.so#override_homedir = /home/%u#ldap_user_email = email # Could this fill the email field? might not be in this version#ldap_user_search_base = dc=example,dc=com#ldap_group_search_base = dc=example,dc=com#ldap_user_object_class = user#ldap_user_name = sAMAccountName#ldap_user_fullname = displayName ### Seems to be maps to comment in OMV?#ldap_user_home_directory = unixHomeDirectory#ldap_user_principal = userPrincipalName#ldap_group_object_class = group#ldap_group_name = sAMAccountName ### Seems to be maps to Name in OMV?# Unused options#ldap_idmap_default_domain = example.com#ldap_id_mapping = True#default_domain_suffix = example.com#ldap_access_order = expire#ldap_account_expire_policy = ad#ldap_force_upper_case_realm = true#ldap_user_search_base = dc=example,dc=com#ldap_group_search_base = dc=example,dc=com#ldap_user_object_class = user#ldap_user_name = sAMAccountName#ldap_user_fullname = displayName#ldap_user_home_directory = unixHomeDirectory#ldap_user_principal = userPrincipalName#ldap_group_object_class = group#ldap_group_name = sAMAccountName# ldap_id_mapping = True# Uncomment if the client machine hostname doesn't match the computer object on the DC.# ad_hostname = mymachine.EXAMPLE.com# Uncomment if DNS SRV resolution is not working# ad_server = dc.mydomain.example.com# Uncomment if the AD domain is named differently than the Samba domain# ad_domain = EXAMPLE.COM# filter_groups =# For other options see "man sssd.conf"# https://jhrozek.wordpress.com/2015/03/11/anatomy-of-sssd-user-lookup/" > /etc/sssd/sssd.conf# Fix permisionschmod 0600 /etc/sssd/sssd.confsed -i 's/EXAMPLE.COM/'"$DOMAIN"'/g' /etc/sssd/sssd.conf# TODO# Add test to see if $DOMAIN passes dns tests# Add test to see if $DOMAIN passes krb5.conf testsecho "If join fails please check /etc/nsswitch.conf and /etc/krb5.conf"# Join domainkinit $ADMINnet ads join -k
-
- Se l’associazione al dominio ha successo si ottiene un messaggio Joined ‘OMV’
- Riavviare e poi dalla GUI creare una condivisione impostando i permessi con gli utenti/gruppi di dominio