[Samba-it] samba configurato come domain member

Marco Pirola mapirola81 at gmail.com
Wed Jan 30 06:37:54 UTC 2019


Funziona tutto a parte quando devo settare i permessi da rsat sul dc. Ho 
mandato messaggi alla lista internazionale ma non ci sto' capendo nulla 
(tra l'altro conosco l'inglese a livello basa). Qualcuno puo' aiutarmi?

Vi allego i file del mio member domain

Il 09/01/2019 11:36, Marco Gaiarin ha scritto:
> Mandi! marco pirola
>    In chel di` si favelave...
>
>> configurarla come domain member di domino. Mi potreste aiutare a scrivere un
>> smb.conf e il relativo krb5.conf per poterla fare joinare con la macchina
> 'krb5.conf' è parecchio standard, contiene:
>
> [libdefaults]
>      default_realm = AD.FVG.LNF.IT
>      dns_lookup_kdc = true
>      dns_lookup_realm = false
>      forwardable = true
>      proxiable = true
>
> ; A note: This is not used for nfs4 but cifs uses it.
> ; for Windows 2003
> ;    default_tgs_enctypes = rc4-hmac des-cbc-crc des-cbc-md5
> ;    default_tkt_enctypes = rc4-hmac des-cbc-crc des-cbc-md5
> ;    permitted_enctypes = rc4-hmac des-cbc-crc des-cbc-md5
> ;
> ; for Windows 2008 with AES
>      default_tgs_enctypes =  aes256-cts-hmac-sha1-96 aes128-cts-hmac-sha1-96 rc4-hmac des-cbc-crc des-cbc-md5
>      default_tkt_enctypes = aes256-cts-hmac-sha1-96 aes128-cts-hmac-sha1-96 rc4-hmac des-cbc-crc des-cbc-md5
>      permitted_enctypes = aes256-cts-hmac-sha1-96 aes128-cts-hmac-sha1-96 rc4-hmac des-cbc-crc des-cbc-md5
>
>
> Mentre il file smb.conf è qui sotto, uso come backend 'ad':
>
> #
> # smb.conf per Domain Member LNF
> #  (c) Marco Gaiarin (gaio at sv.lnf.it) under GNU GPL Licence 2.0 or newer
>
> # Il file vuole essere una raccolta dei parametri standard, cercando di
> # essere un buon punto di partenza per la realizzazione di un file per
> # la particolare installazione.
> # Leggere con attenzione i commenti e la manpage di smb.conf.
>
> # CHANGELOG
> # (Fri Nov 24 15:43:53 CET 2017)
> #  + prima versione, a partire dall'equivalente file per dominii NT
> # (Thu Apr 19 09:12:47 CEST 2018)
> #  + cambiata l'architettura di default per i driver di stampa a 64bit (come per samba 4.7+)
> # (Fri Apr 27 12:43:58 CEST 2018)
> #  + 'users', come le vecchie 'homes' deve avere 'store dos attributes = yes'
> #  + %m -> %M,  visto che '%m' (NetBIOS Name) non c'è più...
> # (Fri May 25 17:23:50 CEST 2018)
> #  + abilito l'auditing sugli share pubblici multiutenza.
> # (Mon May 28 10:04:23 CEST 2018)
> #  + disabilitati gli usershare, forse risolto https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=772154
> # (Wed Sep  5 16:23:25 CEST 2018)
> #  + sistemati i parametri idmap per la 5.8+
> # (Thu Oct 25 10:55:18 CEST 2018)
> #  + aggiunta la gestione dei ticket kerberos.
> # (Tue Nov 20 11:07:27 CET 2018)
> #  + aggiunta l'acl per IP su WPKG, in AD tutto è raggiungibile e non ha senso l'aggiornamento in rete remota.
>
> # Parametri globali
> #
> [global]
> 	# Definizioni del dominio.
> 	#
> 	security = ADS
> 	workgroup = LNFFVG
> 	realm = AD.FVG.LNF.IT
>
> 	# Alias. In modo AD posso definire degli Alias per i DM, ma l'alias in questione NON deve avere un account macchina creato
> 	# (ergo, se devo fare aliasing di un precedente server, devo rimovere il domain account)
> 	# Gli alias in AD si ''registrano'' come CNAME nel DNS (http://dps.sv.lnf.it/wiki/SambaAD#Alias_dell.27host)
> 	#
> 	# Resta da verificare se è (anche? In che condizioni?) necessario ''registrare'' questi alias come ServicePrincipalName di modo che Kerberos funzioni, ad esempio con:
> 	#	samba-tool spn add HOST/filesv.ad.fvg.lnf.it vdmsv1$
> 	#	samba-tool spn add HOST/FILESV vdmsv1$
> 	# Oltre ovviamente a decommentare le relative righe qui sotto.
> 	#
> 	#netbios aliases = CUPSSV FILESV HOMESV
> 	#wins support = yes
>
> 	# Configurazione di Winbind/IDMap.
> 	#
> 	# Default idmap config for local BUILTIN accounts and groups
> 	# Sembra che ora questo sia obbligatorio, si veda:
> 	#	https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=909465
> 	idmap config * : backend = tdb
> 	idmap config * : range = 5000-9999
> 	# The domain
> 	idmap config LNFFVG : backend = ad
> 	idmap config LNFFVG : range = 10000-49999
> 	# Uso dei dati POSIX/rfc2307 (Samba 4.6+)
> 	idmap config LNFFVG : schema_mode = rfc2307
> 	idmap config LNFFVG : unix_nss_info = yes
> 	#idmap config LNFFVG : unix_primary_group = yes
> 	# Uso dei dati POSIX/rfc2307 (Samba 4.5-)
> 	#winbind nss info = rfc2307
> 	# Se si usa 'winbind use default domain = yes' è necessario sincerarsi che i nomi utente non siano ''overlapping''
> 	# (ovvero utenti definiti nel dominio *e* in /etc/passwd) pena ''confusione'' nella definizione dei gruppi/responsabilità.
> 	winbind use default domain = yes
> 	# Opzionalmente posso voler abilitare le ''cached credentials''; oltre ad abilitare questa opzione, occorre anche abilitarne l'uso
> 	# in winbind. Si veda: https://wiki.samba.org/index.php/PAM_Offline_Authentication
> 	winbind offline logon = yes
>
> 	# Se necessario, è possibile abilitare l'autenticazione Kerberos con
> 	# ticket.
> 	#
> 	#kerberos method = secrets and keytab
> 	#winbind refresh tickets = yes
>
> 	# Se devo connettere un client MSCHAPv2 devo riabilitare NTLMv1, ho due opzioni:
> 	# Samba 4.7+ (in ntlm_auth devo usare anche l'opzione --allow-mschapv2)
> 	#ntlm auth = mschapv2-and-ntlmv2-only
> 	# Samba 4.6+
> 	#ntlm auth = yes
>
> 	# Utenti speciali e permessi
> 	# Disabilitazione di qualche account, e definizione dell'account guest (il default è già 'nobody').
> 	# Tutti gli utenti non conosciuti vengono mappati su guest.
> 	#
> 	#invalid users =
> 	#guest account = nobody
> 	map to guest = Bad User
> 	#
> 	# Per un DM manteniamo una mappa esplicita locale per alcuni utenti, per default solo Administrator (su root)
> 	#
> 	username map = /etc/samba/user.map
>
> 	## Se necessario, ascolto solo sulle interfacce necessarie.
> 	##
> 	#bind interfaces only = yes
> 	#interfaces = lo eth0 tun99
>
> 	# Stampanti...
> 	#
> 	load printers = yes
> 	printing = cups
> 	printcap name = cups
> 	# Per gestire più efficentemente la stampa (si veda https://wiki.samba.org/index.php/Setting_up_Samba_as_a_Print_Server#Enabling_the_spoolssd_Service)
> 	rpc_server:spoolss = external
> 	rpc_daemon:spoolssd = fork
> 	# Per avere come architettura di default i 64bit, si veda https://wiki.samba.org/index.php/Setting_up_Automatic_Printer_Driver_Downloads_for_Windows_Clients#Uploading_Only_64-bit_Drivers_to_a_Samba_Print_Server
> 	spoolss: architecture = Windows x64
> 	# Se invece si vuole DISABILITARE la stampa occorre essere un pelo cattivi, vista l'integrazione Samba/CUPS:
> 	#load printers = no
> 	#printing = bsd
> 	#printcap name = /dev/null
> 	#disable spoolss = yes
>
> 	# Disabilito le estensioni CIFS UNIX, per permettere i link simbolici;
> 	# Sinceramente non credo che siano mai state utilizzate, ad ogni modo si veda:
> 	#       http://wiki.samba.org/index.php/UNIX_Extensions
> 	# ATTENZIONE che se serve pam_mount per montare le HOME, le unix extensions sono NECESSARIE
> 	#  e quindi tocca fare a meno dei link simbolici (esterni). ;-)
> 	#
> 	unix extensions = no
>
> 	# Disabilito gli 'usershare', il default sembra essere 100 per debian. Vedi:
> 	#  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=900396
> 	#
> 	usershare max shares = 0
>
> 	# LOG
> 	#
> 	log level = 0
> 	syslog = 0
> 	log file = /var/log/samba/log.%M
> 	max log size = 5000
> 	panic action = /usr/share/samba/panic-action %d
>
> 	# Creando degli appositi file posso forzare diversi default
> 	# per certi host...
> 	#
> 	include = /etc/samba/smb.conf.%M
>
>
> ##
> ## Share di 'sistema': Stampa, Point'n'Print, Netlogon, Home utente
> ## (sono share con permessi organizzati in maniera particolare)
> ##
>
> # Share stampanti, si veda https://wiki.samba.org/index.php/Setting_up_Samba_as_a_Print_Server
> #
> [printers]
> 	comment = All Printers
> 	browseable = no
> 	path = /var/spool/samba
> 	printable = yes
> 	writable = no
> 	create mask = 0700
> 	guest ok = yes
>
> # Point'n'Print, si veda https://wiki.samba.org/index.php/Setting_up_Automatic_Printer_Driver_Downloads_for_Windows_Clients
> #
> [print$]
> 	comment = Printer Drivers
> 	path = /var/lib/samba/printers
> 	browseable = no
> 	read only = no
> 	force create mode = 0664
> 	force directory mode = 2775
> 	guest ok = yes
>
>
> # Home, si veda https://wiki.samba.org/index.php/User_Home_Folders
> # Usiamo l'opzione con i permessi POSIX, anche perchè mi serve lo script per aggiungere la quota.
> #
> [users]
> 	comment = Home Directories
> 	path = /home
> 	browseable = no
> 	read only = no
> 	store dos attributes = yes
> 	force create mode = 0600
> 	force directory mode = 0700
> 	veto files = /.mail/.inbox/
> 	root preexec = /etc/samba/createhome "%U"
>
> # Profili utente, si veda https://wiki.samba.org/index.php/Roaming_Windows_User_Profiles
> # Qui usiamo le ACL.
> #
> [profiles]
> 	comment = Network Profiles Share
> 	path = /srv/samba/profiles
> 	browseable = no
> 	read only = no
> 	map acl inherit = yes
> 	store dos attributes = yes
> 	csc policy = disable
> 	vfs objects = acl_xattr
> 	# Con i permessi giusti dovrebbe crearli in automatico...
> 	#root preexec = /etc/samba/createprofile "%U"
>
>
> ##
> ## Share pubblici 'classici'...
> ## (con abilitato full ACL, cestino, ...).
> ## Qui ha senso abilitare anche l'auditing.
> ##
>
> # Spazio Utente
> #
> [Work]
>          comment = Spazio di Lavoro Utente
>          volume = Work
>          path = /srv/work
>          browseable = yes
>          writeable = yes
> 	map acl inherit = yes
> 	store dos attributes = yes
> 	vfs objects = acl_xattr recycle full_audit
> 	recycle:repository = .cestino/%U
> 	recycle:keeptree = yes
> 	recycle:versions = yes
> 	recycle:exclude=*.TMP,*.tmp,*.temp,*.o,*.obj,~$*
> 	full_audit:prefix = %S|%d|%I|%M|%u
> 	full_audit:success = mkdir rmdir read pread write pwrite rename unlink
> 	full_audit:failure = none
> 	# LOG_AUTH Non è utilizzabile per il baco https://bugzilla.samba.org/show_bug.cgi?id=13436; uso il default.
> 	#full_audit:facility = LOG_AUTH
> 	full_audit:priority = info
>
-------------- next part --------------
dc
-------------- next part --------------
127.0.0.1	localhost
192.168.1.5	dc.robinood.tst	dc

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
-------------- next part --------------
[libdefaults]
	default_realm = ROBINOOD.TST
	dns_lookup_realm = false
	dns_lookup_kdc = true
-------------- next part --------------
# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.

passwd:         files winbind
group:          files winbind
shadow:         compat
gshadow:        files

hosts:          files dns
networks:       files

protocols:      db files
services:       db files
ethers:         db files
rpc:            db files

netgroup:       nis
-------------- next part --------------
search robinood.tst
nameserver 192.168.1.6
-------------- next part --------------
# Global parameters
[global]
security = ADS
workgroup = ROBINOOD
realm = ROBINOOD.TST
#dns forwarder = 192.168.1.6
log file = /var/log/samba/%m.log
log level = 1
vfs objects = acl_xattr
map acl inherit = yes
store dos attributes = yes
# Default ID mapping configuration for local BUILTIN accounts
# and groups on a domain member. The default (*) domain:
# - must not overlap with any domain ID mapping configuration!
# - must use a read-write-enabled back end, such as tdb.
idmap config * : backend = tdb
idmap config * : range = 3000-7999
# - You must set a DOMAIN backend configuration
# idmap config for the SAMDOM domain
idmap config ROBINOOD : backend = rid
idmap config ROBINOOD : range = 10000-999999
winbind use default domain = yes
username map = /etc/samba/user.map

[samba]
path = /home/samba/
read only = no
#valid user = +"domain users"


More information about the samba-it mailing list