Ciao a tutti,
scrivo per un problema di configurazione… Sto cambiando la rete per la mia azienda, il vecchio server windows è defunto, quindi siamo passati ad un nuovo server con CentOS 8.2 e lo si vorrebbe elevare a DC della rete interna. Ho installato prima l’ultima versione di Samba pacchettizzato per CentOS (4.11), in seguito ai numerosi fallimenti nella configurazione, ho disinstallato samba 4.11 (“dnf remove samba”), scaricato i pacchetti per la 4.13 (ultima stabile), configurato, compilato e installato.
Ho cercato di seguire le numerose guide presenti in rete, ma usando l’ultima versione di CentOS e l’ultima di Samba, non ho trovato molte guide aggiornate…. Quindi sono sicuro di aver fatto casini… anche perché il DC non fa il DC, quindi…
Premetto che non sono un esperto di reti e che è la prima volta che provo a fare un DC con samba (ne ho fatti altri ma sempre con sistemi win).
Cerco di fornirvi un quadro della situazione… so che non sarà completo, quindi chiedete pure…
S.O. : CentOs 4.18.0-193.19.1.el8_2.x86_64
Samba : 4.13.0
Il server è appena stato creato, quindi non ha nulla in più dell’installazione base (con gui) e samba.
Per praticità e debugging, selinux è stato disattivato:
Sul firewall :
Allego smb.conf:
Allego krb5.conf
Come si legge su smb.conf, ho creato una cartella da condividere nel gruppo amministrazione_group, le cartelle genitore sono condivise nel gruppo dipendentiAzienda.
E’ stato eseguito il provisioning senza errori:
Su samba:
AM-02 è il nome netbios di uno dei pc da collegare alla rete (al momento ne provo solo uno…)
Il pc ed il server si pingano entrambi sia con nome che con indirizzo.
Problemi:
Non ho presente quale sia l’effettivo problema… probabilmente ve ne è più di uno… posso iniziare ad elencare alcuni sintomi:
1 – quanto tento di entrare nella cartella condivisa (/home/srv/samba/amministrazione_share), non ottengo accesso:
Non è stato possibile montare la condivisione Windows: Permesso negato
2 – quando tento il join del pc (AM-02) nella rete:
Impossibile trovare un account per il computer nel dominio xxxxxxxxxx. E’ possibile che il dominio di del computers sia diverso da dominio dell’account utente.
Anche se in samba è registrato
3 -
Ovviamente "utente" è utente valido su samba
E altro… che ora non elenco, anche perché non so dire cosa sensato elencare e cosa no…
Chiedo una mano a chiunque abbia le idee più chiare delle mie (e ci vuole poco) a fare una diagnosi di ciò che effettivamente va e cosa no, in modo da poter cercare soluzioni.
Scusate per il post lungo… e grazie per la pazienza.
Andrea
scrivo per un problema di configurazione… Sto cambiando la rete per la mia azienda, il vecchio server windows è defunto, quindi siamo passati ad un nuovo server con CentOS 8.2 e lo si vorrebbe elevare a DC della rete interna. Ho installato prima l’ultima versione di Samba pacchettizzato per CentOS (4.11), in seguito ai numerosi fallimenti nella configurazione, ho disinstallato samba 4.11 (“dnf remove samba”), scaricato i pacchetti per la 4.13 (ultima stabile), configurato, compilato e installato.
Ho cercato di seguire le numerose guide presenti in rete, ma usando l’ultima versione di CentOS e l’ultima di Samba, non ho trovato molte guide aggiornate…. Quindi sono sicuro di aver fatto casini… anche perché il DC non fa il DC, quindi…
Premetto che non sono un esperto di reti e che è la prima volta che provo a fare un DC con samba (ne ho fatti altri ma sempre con sistemi win).
Cerco di fornirvi un quadro della situazione… so che non sarà completo, quindi chiedete pure…
S.O. : CentOs 4.18.0-193.19.1.el8_2.x86_64
Samba : 4.13.0
Il server è appena stato creato, quindi non ha nulla in più dell’installazione base (con gui) e samba.
Per praticità e debugging, selinux è stato disattivato:
Codice:
[root@SRV_Linux samba]# sestatus
SELinux status: disabled
Sul firewall :
Codice:
[root@SRV_Linux samba]# firewall-cmd --get-default-zone
Public
[root@SRV_Linux samba]# firewall-cmd --get-active-zones
libvirt
interfaces: virbr0
public
interfaces: eno1np0
[root@SRV_Linux samba]# firewall-cmd --zone=public --list-all
public (active)
target: default
icmp-block-inversion: no
interfaces: eno1np0
sources:
services: cockpit dhcpv6-client dns kerberos ldap ldaps samba ssh
ports: 53/tcp 53/udp 88/tcp 88/udp 135/tcp 137/tcp 137/udp 138/udp 139/tcp 389/tcp 389/udp 445/tcp 464/tcp 464/udp 636/tcp 1024-5000/tcp 1024-5000/udp 3268/tcp 3269/tcp 5353/tcp 5353/udp 137-138/udp 123/tcp 3268-3269/tcp 49152-65535/tcp 135/udp 137-138/tcp 139/udp 123/udp 445/udp 636/udp
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:
Allego smb.conf:
# Global parameters
[global]
dns forwarder = 10.0.0.1
netbios name = SRV_LINUX
realm = xxxxxxxxx.ORG
server role = active directory domain controller
workgroup = yyyyyyyyyyy
idmap_ldb:use rfc2307 = yes
security = user
server string = SRV_Linux %v
passdb backend = tdbsam
printing = cups
printcap name = cups
load printers = yes
cups options = raw
domain master = yes
local master = yes
preferred master = yes
logon path = \\%L\Profiles\%U
logon script = logon.bat
add machine script = /usr/sbin/useradd -d /dev/null -g 200 -s /sbin/nologin -M %u
wins support = yes
name resolve order = wins lmhosts bcast
interfaces = lo eno1np0
client min protocol = core
logon home = \\%L\%U
map acl inherit = Yes
store dos attributes = Yes
dedicated keytab file = /etc/krb5.keytab
kerberos method = secrets and keytab
username map = /usr/local/samba/etc/user.map
log level = 1 auth_audit:3 auth_json_audit:3
[sysvol]
path = /usr/local/samba/var/locks/sysvol
read only = No
[netlogon]
path = /usr/local/samba/var/locks/sysvol/afet.org/scripts
read only = No
[homes]
comment = Home Directories
valid users = %S, %D%w%S
browseable = Yes
read only = No
inherit acls = Yes
[printers]
comment = All Printers
path = /var/spool/samba
printable = Yes
create mask = 0600
browseable = No
print ok = Yes
[print$]
comment = Printer Drivers
path = /var/lib/samba/drivers
write list = @printadmin root
force group = @printadmin
create mask = 0664
directory mask = 0775
[Profiles]
path = /var/lib/samba/profiles
create mask = 0755
directory mask = 0755
[amministrazione_share]
path = /home/srv/samba/amministrazione_share
valid users = @amministrazione_group
guest ok = No
writable = Yes
read only = No
browsable = Yes
[global]
dns forwarder = 10.0.0.1
netbios name = SRV_LINUX
realm = xxxxxxxxx.ORG
server role = active directory domain controller
workgroup = yyyyyyyyyyy
idmap_ldb:use rfc2307 = yes
security = user
server string = SRV_Linux %v
passdb backend = tdbsam
printing = cups
printcap name = cups
load printers = yes
cups options = raw
domain master = yes
local master = yes
preferred master = yes
logon path = \\%L\Profiles\%U
logon script = logon.bat
add machine script = /usr/sbin/useradd -d /dev/null -g 200 -s /sbin/nologin -M %u
wins support = yes
name resolve order = wins lmhosts bcast
interfaces = lo eno1np0
client min protocol = core
logon home = \\%L\%U
map acl inherit = Yes
store dos attributes = Yes
dedicated keytab file = /etc/krb5.keytab
kerberos method = secrets and keytab
username map = /usr/local/samba/etc/user.map
log level = 1 auth_audit:3 auth_json_audit:3
[sysvol]
path = /usr/local/samba/var/locks/sysvol
read only = No
[netlogon]
path = /usr/local/samba/var/locks/sysvol/afet.org/scripts
read only = No
[homes]
comment = Home Directories
valid users = %S, %D%w%S
browseable = Yes
read only = No
inherit acls = Yes
[printers]
comment = All Printers
path = /var/spool/samba
printable = Yes
create mask = 0600
browseable = No
print ok = Yes
[print$]
comment = Printer Drivers
path = /var/lib/samba/drivers
write list = @printadmin root
force group = @printadmin
create mask = 0664
directory mask = 0775
[Profiles]
path = /var/lib/samba/profiles
create mask = 0755
directory mask = 0755
[amministrazione_share]
path = /home/srv/samba/amministrazione_share
valid users = @amministrazione_group
guest ok = No
writable = Yes
read only = No
browsable = Yes
Allego krb5.conf
[libdefaults]
default_realm = xxxxxxxxx.ORG
dns_lookup_realm = false
dns_lookup_kdc = true
[realms]
xxxxxxxxx.ORG = {
default_domain = yyyyyyyyyyy.org
}
[domain_realm]
SRV_Linux = xxxxxxxxx.ORG
default_realm = xxxxxxxxx.ORG
dns_lookup_realm = false
dns_lookup_kdc = true
[realms]
xxxxxxxxx.ORG = {
default_domain = yyyyyyyyyyy.org
}
[domain_realm]
SRV_Linux = xxxxxxxxx.ORG
Come si legge su smb.conf, ho creato una cartella da condividere nel gruppo amministrazione_group, le cartelle genitore sono condivise nel gruppo dipendentiAzienda.
E’ stato eseguito il provisioning senza errori:
Codice:
# samba-tool domain provision --server-role=dc --use-rfc2307 --dns-backend=SAMBA_INTERNAL --realm= xxxxxxxxx.ORG --domain= yyyyyyyyyyy --adminpass=zzzzzzzzzz
Su samba:
Codice:
[root@SRV_Linux samba]# pdbedit -L -v
---------------
Unix username: krbtgt
NT username:
Account Flags: [DU ]
User SID: S-1-5-21-32322167-3391840167-2499347120-502
Primary Group SID: S-1-5-21-32322167-3391840167-2499347120-513
Full Name:
Home Directory:
HomeDir Drive: (null)
Logon Script:
Profile Path:
Domain:
Account desc: Key Distribution Center Service Account
Workstations:
Munged dial:
Logon time: 0
Logoff time: 0
Kickoff time: gio, 14 set 30828 04:48:05 CEST
Password last set: ven, 30 ott 2020 14:21:26 CET
Password can change: ven, 30 ott 2020 14:21:26 CET
Password must change: never
Last bad password : 0
Bad password count : 0
Logon hours : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
---------------
Unix username: SRV_LINUX$
NT username:
Account Flags: [S ]
User SID: S-1-5-21-32322167-3391840167-2499347120-1000
Primary Group SID: S-1-5-21-32322167-3391840167-2499347120-516
Full Name:
Home Directory:
HomeDir Drive: (null)
Logon Script:
Profile Path:
Domain:
Account desc:
Workstations:
Munged dial:
Logon time: 0
Logoff time: 0
Kickoff time: gio, 14 set 30828 04:48:05 CEST
Password last set: ven, 30 ott 2020 14:21:27 CET
Password can change: ven, 30 ott 2020 14:21:27 CET
Password must change: never
Last bad password : 0
Bad password count : 0
Logon hours : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
---------------
Unix username: nobody
NT username:
Account Flags: [U ]
User SID: S-1-5-21-32322167-3391840167-2499347120-501
Primary Group SID: S-1-22-2-65534
Full Name: Kernel Overflow User
Home Directory:
HomeDir Drive: (null)
Logon Script:
Profile Path:
Domain: xxxxxxxxxxxxxxxxxx
Account desc:
Workstations:
Munged dial:
Logon time: 0
Logoff time: never
Kickoff time: never
Password last set: 0
Password can change: 0
Password must change: 0
Last bad password : 0
Bad password count : 0
Logon hours : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
---------------
Unix username: AM-02$
NT username:
Account Flags: [DW ]
User SID: S-1-5-21-32322167-3391840167-2499347120-1103
Primary Group SID: S-1-5-21-32322167-3391840167-2499347120-515
Full Name:
Home Directory:
HomeDir Drive: (null)
Logon Script:
Profile Path:
Domain:
Account desc:
Workstations:
Munged dial:
Logon time: 0
Logoff time: 0
Kickoff time: gio, 14 set 30828 04:48:05 CEST
Password last set: 0
Password can change: 0
Password must change: 0
Last bad password : 0
Bad password count : 0
Logon hours : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
---------------
Unix username: utente
NT username:
Account Flags: [U ]
User SID: S-1-5-21-32322167-3391840167-2499347120-1104
Primary Group SID: S-1-5-21-32322167-3391840167-2499347120-513
Full Name:
Home Directory:
HomeDir Drive: (null)
Logon Script:
Profile Path:
Domain:
Account desc:
Workstations:
Munged dial:
Logon time: 0
Logoff time: 0
Kickoff time: gio, 14 set 30828 04:48:05 CEST
Password last set: ven, 30 ott 2020 20:19:36 CET
Password can change: ven, 30 ott 2020 20:19:36 CET
Password must change: never
Last bad password : 0
Bad password count : 0
Logon hours : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
---------------
Unix username: Administrator
NT username:
Account Flags: [U ]
User SID: S-1-5-21-32322167-3391840167-2499347120-500
Primary Group SID: S-1-5-21-32322167-3391840167-2499347120-513
Full Name:
Home Directory:
HomeDir Drive: (null)
Logon Script:
Profile Path:
Domain:
Account desc: Built-in account for administering the computer/domain
Workstations:
Munged dial:
Logon time: 0
Logoff time: 0
Kickoff time: gio, 14 set 30828 04:48:05 CEST
Password last set: ven, 30 ott 2020 14:21:26 CET
Password can change: ven, 30 ott 2020 14:21:26 CET
Password must change: never
Last bad password : 0
Bad password count : 0
Logon hours : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
Unix username: krbtgt
NT username:
Account Flags: [DU ]
User SID: S-1-5-21-32322167-3391840167-2499347120-502
Primary Group SID: S-1-5-21-32322167-3391840167-2499347120-513
Full Name:
Home Directory:
HomeDir Drive: (null)
Logon Script:
Profile Path:
Domain:
Account desc: Key Distribution Center Service Account
Workstations:
Munged dial:
Logon time: 0
Logoff time: 0
Kickoff time: gio, 14 set 30828 04:48:05 CEST
Password last set: ven, 30 ott 2020 14:21:26 CET
Password can change: ven, 30 ott 2020 14:21:26 CET
Password must change: never
Last bad password : 0
Bad password count : 0
Logon hours : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
---------------
Unix username: SRV_LINUX$
NT username:
Account Flags: [S ]
User SID: S-1-5-21-32322167-3391840167-2499347120-1000
Primary Group SID: S-1-5-21-32322167-3391840167-2499347120-516
Full Name:
Home Directory:
HomeDir Drive: (null)
Logon Script:
Profile Path:
Domain:
Account desc:
Workstations:
Munged dial:
Logon time: 0
Logoff time: 0
Kickoff time: gio, 14 set 30828 04:48:05 CEST
Password last set: ven, 30 ott 2020 14:21:27 CET
Password can change: ven, 30 ott 2020 14:21:27 CET
Password must change: never
Last bad password : 0
Bad password count : 0
Logon hours : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
---------------
Unix username: nobody
NT username:
Account Flags: [U ]
User SID: S-1-5-21-32322167-3391840167-2499347120-501
Primary Group SID: S-1-22-2-65534
Full Name: Kernel Overflow User
Home Directory:
HomeDir Drive: (null)
Logon Script:
Profile Path:
Domain: xxxxxxxxxxxxxxxxxx
Account desc:
Workstations:
Munged dial:
Logon time: 0
Logoff time: never
Kickoff time: never
Password last set: 0
Password can change: 0
Password must change: 0
Last bad password : 0
Bad password count : 0
Logon hours : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
---------------
Unix username: AM-02$
NT username:
Account Flags: [DW ]
User SID: S-1-5-21-32322167-3391840167-2499347120-1103
Primary Group SID: S-1-5-21-32322167-3391840167-2499347120-515
Full Name:
Home Directory:
HomeDir Drive: (null)
Logon Script:
Profile Path:
Domain:
Account desc:
Workstations:
Munged dial:
Logon time: 0
Logoff time: 0
Kickoff time: gio, 14 set 30828 04:48:05 CEST
Password last set: 0
Password can change: 0
Password must change: 0
Last bad password : 0
Bad password count : 0
Logon hours : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
---------------
Unix username: utente
NT username:
Account Flags: [U ]
User SID: S-1-5-21-32322167-3391840167-2499347120-1104
Primary Group SID: S-1-5-21-32322167-3391840167-2499347120-513
Full Name:
Home Directory:
HomeDir Drive: (null)
Logon Script:
Profile Path:
Domain:
Account desc:
Workstations:
Munged dial:
Logon time: 0
Logoff time: 0
Kickoff time: gio, 14 set 30828 04:48:05 CEST
Password last set: ven, 30 ott 2020 20:19:36 CET
Password can change: ven, 30 ott 2020 20:19:36 CET
Password must change: never
Last bad password : 0
Bad password count : 0
Logon hours : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
---------------
Unix username: Administrator
NT username:
Account Flags: [U ]
User SID: S-1-5-21-32322167-3391840167-2499347120-500
Primary Group SID: S-1-5-21-32322167-3391840167-2499347120-513
Full Name:
Home Directory:
HomeDir Drive: (null)
Logon Script:
Profile Path:
Domain:
Account desc: Built-in account for administering the computer/domain
Workstations:
Munged dial:
Logon time: 0
Logoff time: 0
Kickoff time: gio, 14 set 30828 04:48:05 CEST
Password last set: ven, 30 ott 2020 14:21:26 CET
Password can change: ven, 30 ott 2020 14:21:26 CET
Password must change: never
Last bad password : 0
Bad password count : 0
Logon hours : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
AM-02 è il nome netbios di uno dei pc da collegare alla rete (al momento ne provo solo uno…)
Il pc ed il server si pingano entrambi sia con nome che con indirizzo.
Problemi:
Non ho presente quale sia l’effettivo problema… probabilmente ve ne è più di uno… posso iniziare ad elencare alcuni sintomi:
1 – quanto tento di entrare nella cartella condivisa (/home/srv/samba/amministrazione_share), non ottengo accesso:
Non è stato possibile montare la condivisione Windows: Permesso negato
2 – quando tento il join del pc (AM-02) nella rete:
Impossibile trovare un account per il computer nel dominio xxxxxxxxxx. E’ possibile che il dominio di del computers sia diverso da dominio dell’account utente.
Anche se in samba è registrato
3 -
Codice:
[root@SRV_Linux samba]# smbclient -L 10.0.2.54
Enter yyyyyyyyyy\utente's password:
session setup failed: NT_STATUS_ACCESS_DENIED
Ovviamente "utente" è utente valido su samba
E altro… che ora non elenco, anche perché non so dire cosa sensato elencare e cosa no…
Chiedo una mano a chiunque abbia le idee più chiare delle mie (e ci vuole poco) a fare una diagnosi di ciò che effettivamente va e cosa no, in modo da poter cercare soluzioni.
Scusate per il post lungo… e grazie per la pazienza.
Andrea