- /etc/network/interfaces
auto eth0 iface eth0 inet static address 192.168.215.2/24 gateway 192.168.215.1
Siehe auch: https://wiki.samba.org/index.php/Setting_up_Samba_as_an_Active_Directory_Domain_Controller
Installation mit debian 10 getestet.
apt install samba winbind
systemctl stop samba-ad-dc systemctl disable --now nmbd.service systemctl disable --now smbd.service systemctl disable --now winbind.service mv /etc/samba/smb.conf{,.orig}
Übersicht über samba-tool
Unterbefehle:
samba-tool samba-tool domain provision --help samba-tool domain provision --domain kurs --realm kurs.linuxhotel.de --adminpass v0gelsang,
oder
samba-tool domain provision
Realm: KURS.LINUXHOTEL.DE Domain [KURS]: KURS Server Role: dc DNS backend: SAMBA_INTERNAL DNS forwarder IP address: 192.168.1.17 Administrator password: v0gelsang,
domain kurs.linuxhotel.de search kurs.linuxhotel.de linuxhotel.de nameserver 127.0.0.1
Neue smb.conf
anzeigen:
testparm
systemctl unmask samba-ad-dc systemctl enable --now samba-ad-dc
Optional, zum debuggen:
apt install smbclient ldb-tools krb5-user ldap-utils dnsutils
Offene Ports checken:7)
lsof -Pi :53,88,135,137,138,139,389,445,464,636,3268,3269
DNS testen:
dig _ldap._tcp.kurs.linuxhotel.de SRV dig _kerberos._tcp.kurs.linuxhotel.de SRV
Benutzer anzeigen:
pdbedit -L samba-tool user list
Kerberos testen:
cp -b /var/lib/samba/private/krb5.conf /etc/krb5.conf kinit Administrator
oder
kinit Administrator@KURS.LINUXHOTEL.DE klist
CIFS testen:
nmblookup -S vm2 smbclient -k -L vm2 smbclient -k //vm2/sysvol klist
LDAP testen:
URI ldaps://localhost BINDDN cn=Administrator,cn=users,dc=kurs,dc=linuxhotel,dc=de BASE dc=kurs,dc=linuxhotel,dc=de TLS_REQCERT ALLOW
ldapsearch -x -W
ldbsearch -H /var/lib/samba/private/sam.ldb
Nur in Testumgebungen:
samba-tool domain passwordsettings --help samba-tool domain passwordsettings set --complexity=off samba-tool domain passwordsettings set --min-pwd-length=1 samba-tool user --help
Benutzerliste ansehen:
samba-tool user list
Benutzer anlegen:
samba-tool user add heinz
Benutzer: Administrator
Password: wie oben im samba-tool eingegeben
Als Benutzer heinz an der Domäne example.com anmelden
kinit Administrator kdestroy kinit heinz ls /tmp/krb5cc_0
auto eth0 iface eth0 inet static address 192.168.215.2/24 gateway 192.168.215.1
lsof -i :53,88,135,139,389,445,464,636,3268,3269,49152,49153,49154→ leer
lxc network set lxdbr0 dns.domain kurs.linuxhotel.de lxc init images:debian/10 test1 lxc config set test1 security.privileged=true lxc network attach lxdbr0 test1 eth0 eth0 lxc config device set test1 eth0 ipv4.address 192.168.239.10 lxc start test1 lxc exec test1 -- /bin/bash
samba-tool domain provision --use-rfc2307 --use-xattrs=yes Alternative zu --use-xattrs=yes siehe https://wiki.samba.org/index.php/Samba4/s3fs
rm /etc/samba/smb.conf
/etc/default/sernet-samba
:
SAMBA_START_MODE="ad" # SAMBA_IGNORE_NSUPDATE_G defines whether the samba daemon should be started # when 'nsupdate -g' is not available. Setting this to "yes" would mean that # samba will be started even without 'nsupdate -g'. This will lead to severe # problems without a proper workaround! SAMBA_IGNORE_NSUPDATE_G="no"
Service | Port | Protocol |
---|---|---|
DNS | 53 | tcp/udp |
Kerberos | 88 | tcp/udp |
ntp | 123 | udp |
End Point Mapper (DCE/RPC Locator Service) | 135 | tcp |
NetBIOS Name Service | 137 | udp |
NetBIOS Datagram | 138 | udp |
NetBIOS Session | 139 | tcp |
LDAP | 389 | tcp/udp |
SMB over TCP | 445 | tcp |
Kerberos kpasswd | 464 | tcp/udp |
LDAPS | 636 | tcp |
Global Catalog | 3268 | tcp |
Global Catalog SSL | 3269 | tcp |
Dynamic RPC Ports | 49152-65535 | tcp |