4 069
contributi
Riga 115: | Riga 115: | ||
masterPw="passworddiadmindigitataprecedentemente" | masterPw="passworddiadmindigitataprecedentemente" | ||
</pre> | </pre> | ||
Eseguire il comando: | Il contenuto del file dovrebbe essere il seguente:<br/> | ||
'''/etc/smbldap-tools/smbldap_bind.conf''': | |||
<pre> | |||
############################ | |||
# Credential Configuration # | |||
############################ | |||
# Notes: you can specify two differents configuration if you use a | |||
# master ldap for writing access and a slave ldap server for reading access | |||
# By default, we will use the same DN (so it will work for standard Samba | |||
# release) | |||
slaveDN="cn=admin,dc=dominio,dc=local" | |||
slavePw="password" | |||
masterDN="cn=admin,dc=dominio,dc=local" | |||
masterPw="password" | |||
</pre> | |||
Eseguire ora il comando: | |||
<pre> | <pre> | ||
# net getlocalsid | # net getlocalsid | ||
Riga 133: | Riga 148: | ||
ldapTLS="0" | ldapTLS="0" | ||
</pre> | </pre> | ||
Configurare il corretto suffisso per il dominio (quello specificato nella configurazione di LDAP) e il nome corretto per il dominio che si vuole configurare ( | Configurare il corretto suffisso per il dominio (quello specificato nella configurazione di LDAP) e il nome corretto per il dominio che si vuole configurare (DOMINIO). | ||
<pre> | <pre> | ||
suffix="dc=miodominio,dc=local" | suffix="dc=miodominio,dc=local" | ||
sambaUnixIdPooldn="sambaDomainName= | sambaUnixIdPooldn="sambaDomainName=DOMINIO,${suffix}" | ||
</pre> | </pre> | ||
Potrebbe tornare utile anche impostare una differente scadenza per le password, in modo che non ne venga richiesta la sostituzione troppo di frequente: | Potrebbe tornare utile anche impostare una differente scadenza per le password, in modo che non ne venga richiesta la sostituzione troppo di frequente: | ||
Riga 145: | Riga 160: | ||
Configurare infine i percorsi per le home degli utenti e per le cartelle che conterranno i profiles nel caso di roaming profiles. | Configurare infine i percorsi per le home degli utenti e per le cartelle che conterranno i profiles nel caso di roaming profiles. | ||
<pre> | <pre> | ||
userSmbHome="\\ | userSmbHome="\\SERVER\%U" | ||
userProfile="\\ | userProfile="\\SERVER\profiles\%U" | ||
</pre> | </pre> | ||
PDC-SERVER deve essere sostituito con il nome SAMBA del server che funziona come PDC (il server che stiamo configurando; lo stesso nome che verrà impostato più avanti nel file di configurazione di Samba). In questo esempio, inoltre, si è ritenuto di fornire uno script di logon comune a tutti gli utenti, anziché di uno script personale per ogni utente, pertanto si è impostato il seguente parametro: | PDC-SERVER deve essere sostituito con il nome SAMBA del server che funziona come PDC (il server che stiamo configurando; lo stesso nome che verrà impostato più avanti nel file di configurazione di Samba). In questo esempio, inoltre, si è ritenuto di fornire uno script di logon comune a tutti gli utenti, anziché di uno script personale per ogni utente, pertanto si è impostato il seguente parametro: | ||
Riga 156: | Riga 171: | ||
<pre> | <pre> | ||
mailDomain="miodominio.local" | mailDomain="miodominio.local" | ||
</pre> | |||
Il contenuto completo del file dovrebbe essere il seguente:<br/> | |||
'''/etc/smbldap-tools/smbldap.conf''': | |||
<pre> | |||
# | |||
# Purpose : | |||
# . be the configuration file for all smbldap-tools scripts | |||
############################################################################## | |||
## | |||
General Configuration | |||
# ############################################################################## | |||
# Put your own SID. To obtain this number do: "net getlocalsid". | |||
# If not defined, parameter is taking from "net getlocalsid" return | |||
SID="S-1-5-21-125945932-740595490-3132273231" | |||
# Domain name the Samba server is in charged. | |||
# If not defined, parameter is taking from smb.conf configuration file | |||
sambaDomain="DOMINIO" | |||
############################################################################## | |||
# | |||
# LDAP Configuration | |||
# | |||
############################################################################## | |||
# Slave LDAP server | |||
# If not defined, parameter is set to "127.0.0.1" | |||
slaveLDAP="127.0.0.1" | |||
# Slave LDAP port | |||
# If not defined, parameter is set to "389" | |||
slavePort="389" | |||
# Master LDAP server: needed for write operations | |||
# If not defined, parameter is set to "127.0.0.1" | |||
masterLDAP="127.0.0.1" | |||
# Master LDAP port | |||
# If not defined, parameter is set to "389" | |||
masterPort="389" | |||
# Use TLS for LDAP | |||
# If set to 1, this option will use start_tls for connection | |||
# (you should also used the port 389) | |||
# If not defined, parameter is set to "1" | |||
ldapTLS="0" | |||
# How to verify the server's certificate (none, optional or require) | |||
# see "man Net::LDAP" in start_tls section for more details | |||
verify="none" | |||
# CA certificate | |||
# see "man Net::LDAP" in start_tls section for more details | |||
#cafile="/etc/opt/IDEALX/smbldap-tools/ca.pem" | |||
# certificate to use to connect to the ldap server | |||
# see "man Net::LDAP" in start_tls section for more details | |||
#clientcert="/etc/opt/IDEALX/smbldap-tools/smbldap-tools.pem" | |||
# key certificate to use to connect to the ldap server | |||
# see "man Net::LDAP" in start_tls section for more details | |||
#clientkey="/etc/opt/IDEALX/smbldap-tools/smbldap-tools.key" | |||
# LDAP Suffix | |||
suffix="dc=dominio,dc=local" | |||
# Where are stored Users | |||
# Warning: if 'suffix' is not set here, you must set the full dn for usersdn | |||
usersdn="ou=users,${suffix}" | |||
# Where are stored Computers | |||
# Warning: if 'suffix' is not set here, you must set the full dn for computersdn | |||
computersdn="ou=machines,${suffix}" | |||
# Where are stored Groups | |||
# Warning: if 'suffix' is not set here, you must set the full dn for groupsdn | |||
groupsdn="ou=groups,${suffix}" | |||
# Where are stored Idmap entries (used if samba is a domain member server) | |||
# Warning: if 'suffix' is not set here, you must set the full dn for idmapdn | |||
#idmapdn="ou=Idmap,${suffix}" | |||
# Where to store next uidNumber and gidNumber available for new users and groups | |||
# If not defined, entries are stored in sambaDomainName object. | |||
sambaUnixIdPooldn="sambaDomainName=DOMINIO,${suffix}" | |||
# Default scope Used | |||
scope="sub" | |||
# Unix password encryption (CRYPT, MD5, SMD5, SSHA, SHA, CLEARTEXT) | |||
hash_encrypt="MD5" | |||
# if hash_encrypt is set to CRYPT, you may set a salt format. | |||
# default is "%s", but many systems will generate MD5 hashed | |||
# passwords if you use "$1$%.8s". This parameter is optional! | |||
crypt_salt_format="%s" | |||
############################################################################## | |||
# | |||
# Unix Accounts Configuration | |||
# | |||
############################################################################## | |||
# Login defs | |||
# Default Login Shell | |||
userLoginShell="/bin/false" | |||
# Home directory | |||
userHome="/home/users/%U" | |||
# Default mode used for user homeDirectory | |||
userHomeDirectoryMode="700" | |||
# Gecos | |||
userGecos="System Computer" | |||
# Default User (POSIX and Samba) GID | |||
defaultUserGid="515" | |||
# Default Computer (Samba) GID | |||
defaultComputerGid="20003" | |||
# Skel dir | |||
skeletonDir="/etc/skel" | |||
# Default password validation time (time in days) Comment the next line if | |||
# you don't want password to be enable for defaultMaxPasswordAge days (be | |||
# careful to the sambaPwdMustChange attribute's value) | |||
#defaultMaxPasswordAge="180" | |||
############################################################################## | |||
## | |||
SAMBA Configuration | |||
# ############################################################################## | |||
# The UNC path to home drives location (%U username substitution) | |||
# Just set it to a null string if you want to use the smb.conf 'logon home' | |||
# directive and/or disable roaming profiles | |||
userSmbHome="" | |||
# The UNC path to profiles locations (%U username substitution) | |||
# Just set it to a null string if you want to use the smb.conf 'logon path' | |||
# directive and/or disable roaming profiles | |||
userProfile="" | |||
# The default Home Drive Letter mapping | |||
# (will be automatically mapped at logon time if home directory exist) | |||
userHomeDrive="H:" | |||
# The default user netlogon script name (%U username substitution) | |||
# if not used, will be automatically username.cmd | |||
# make sure script file is edited under dos | |||
userScript="logon.bat" | |||
# Domain appended to the users "mail"-attribute | |||
# when smbldap-useradd -M is used | |||
#mailDomain="idealx.com" | |||
############################################################################## | |||
# | |||
# SMBLDAP-TOOLS Configuration | |||
# | |||
############################################################################## | |||
# Allows not to use smbpasswd (if with_smbpasswd == 0 in smbldap_conf.pm) but | |||
# prefer Crypt::SmbHash library | |||
with_smbpasswd="0" | |||
smbpasswd="/usr/bin/smbpasswd" | |||
# Allows not to use slappasswd (if with_slappasswd == 0 in smbldap_conf.pm) | |||
# but prefer Crypt:: libraries | |||
with_slappasswd="0" | |||
slappasswd="/usr/sbin/slappasswd" | |||
</pre> | </pre> | ||
Terminate le modifiche al file, bisogna cambiare i permessi per i file appena modificati al fine di aumentare la sicurezza del sistema ed impedire agli utenti di avere accesso alle password di amministratore di LDAP, scritta in chiaro nel file di configurazione precedentemente modificato. | Terminate le modifiche al file, bisogna cambiare i permessi per i file appena modificati al fine di aumentare la sicurezza del sistema ed impedire agli utenti di avere accesso alle password di amministratore di LDAP, scritta in chiaro nel file di configurazione precedentemente modificato. |