Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
linux:service:samba:installer-controleur-domaine [03/11/2018 18:45] thierry [Démarrer le service] |
linux:service:samba:installer-controleur-domaine [04/11/2018 18:42] (Version actuelle) thierry ↷ Liens modifiés en raison d'un déplacement. |
||
---|---|---|---|
Ligne 192: | Ligne 192: | ||
===== Installation ===== | ===== Installation ===== | ||
- | >><code bash> | ||
- | sudo apt-get install samba smbclient krb5-user dnsutils krb5-config winbind libpam-winbind libnss-winbind | ||
- | </code> | ||
<code bash> | <code bash> | ||
sudo apt -y install samba krb5-config winbind smbclient krb5-user dnsutils | sudo apt -y install samba krb5-config winbind smbclient krb5-user dnsutils | ||
Ligne 397: | Ligne 394: | ||
</code> | </code> | ||
- | + | === Erreurs rencontrées === | |
- | ERREUR : [[##failed_to_listen_on_000053_-_nt_status_address_already_associat|Failed to listen on 0.0.0.0:53 - NT_STATUS_ADDRESS_ALREADY_ASSOCIAT]] | + | * ERREUR : [[##failed_to_listen_on_000053_-_nt_status_address_already_associat|Failed to listen on 0.0.0.0:53 - NT_STATUS_ADDRESS_ALREADY_ASSOCIAT]] |
- | + | ||
- | ==== Kerberos ==== | + | |
- | configurer et tester Kerberos | + | |
- | [[https://linoxide.com/ubuntu-how-to/setup-ubuntu-active-directory-domain-controller-samba/]] | + | |
Ligne 509: | Ligne 502: | ||
==== Kerberos ==== | ==== Kerberos ==== | ||
=== krb5.conf === | === krb5.conf === | ||
- | Verifions le fichier de configuration de Kerberos | + | Verifions le fichier de configuration de [[linux:service:kerberos|Kerberos]] |
<code bash>thierry@bino:~$ cat /etc/krb5.conf | <code bash>thierry@bino:~$ cat /etc/krb5.conf | ||
[libdefaults] | [libdefaults] | ||
Ligne 517: | Ligne 510: | ||
</code> | </code> | ||
=== Test de connexion === | === Test de connexion === | ||
- | Avec [[:kinit]] | + | Avec [[linux:commandes:kinit]] |
<code bash> | <code bash> | ||
thierry@bino:~$ kinit administrator@BINOVA.LAN | thierry@bino:~$ kinit administrator@BINOVA.LAN | ||
Ligne 532: | Ligne 525: | ||
</note> | </note> | ||
===== Et ensuite... ===== | ===== Et ensuite... ===== | ||
- | *[[:connection_domaine|Connexion d'une station de travail Windows au domaine]] | + | *[[windows:domaine:se_connecter|Connexion d'une station de travail Windows au domaine]] |
*[[linux:service:samba:admin_samba4_depuis_windows|Administration distante de Samba4 PDC]] | *[[linux:service:samba:admin_samba4_depuis_windows|Administration distante de Samba4 PDC]] | ||
- | *[[:partage_de_fichiers_avec_samba|Mettre en place le partage de fichiers]] | + | *[[linux:service:samba:partage_de_fichiers_avec_samba|Mettre en place le partage de fichiers]] |
Ligne 553: | Ligne 546: | ||
==== Failed to listen on 0.0.0.0:53 - NT_STATUS_ADDRESS_ALREADY_ASSOCIAT ==== | ==== Failed to listen on 0.0.0.0:53 - NT_STATUS_ADDRESS_ALREADY_ASSOCIAT ==== | ||
+ | === L'erreur === | ||
Lors du lancement du service on voit cette erreur: | Lors du lancement du service on voit cette erreur: | ||
Ligne 598: | Ligne 591: | ||
</code> | </code> | ||
Cela signifie que le port 53 est déjà utilisé !!! | Cela signifie que le port 53 est déjà utilisé !!! | ||
+ | |||
+ | === Diagnostique === | ||
+ | |||
+ | |||
+ | Si je regarde qui utilise ce port avec une **[[linux:commandes:netstat]] -lnp | [[linux:commandes:grep]] :53** | ||
+ | <code bash Config qui marche pas> | ||
+ | thierry@binova-srv:~$ sudo netstat -lnp | grep :53 | ||
+ | tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN 1870/systemd-resolv | ||
+ | tcp6 0 0 :::53 :::* LISTEN 1243/samba | ||
+ | udp 0 0 127.0.0.53:53 0.0.0.0:* 1870/systemd-resolv | ||
+ | udp6 0 0 :::53 :::* 1243/samba | ||
+ | </code> | ||
+ | |||
+ | On constate que j'ai un ''systemd-resolv'' qui est présent, alors qu'il n'est pas présent dans une config qui tourne déjà... | ||
+ | <code bash Comparaison avec une config qui marche...> | ||
+ | thierry@bino:~$ sudo netstat -nlp | grep :53 | ||
+ | tcp 0 0 0.0.0.0:53 0.0.0.0:* LISTEN 3317/samba | ||
+ | tcp6 0 0 :::53 :::* LISTEN 3317/samba | ||
+ | udp 43776 0 0.0.0.0:53 0.0.0.0:* 3317/samba | ||
+ | udp6 2304 0 :::53 :::* 3317/samba | ||
+ | </code> | ||
+ | === Résolution === | ||
+ | |||
+ | |||
+ | On supprime systemd-resolved | ||
+ | |||
+ | Source: [[https://askubuntu.com/questions/907246/how-to-disable-systemd-resolved-in-ubuntu]] | ||
+ | |||
+ | <code bash> | ||
+ | # On désactive le service | ||
+ | thierry@binova-srv:~$ sudo systemctl disable systemd-resolved.service | ||
+ | Removed /etc/systemd/system/multi-user.target.wants/systemd-resolved.service. | ||
+ | Removed /etc/systemd/system/dbus-org.freedesktop.resolve1.service. | ||
+ | |||
+ | # On stop le service | ||
+ | thierry@binova-srv:~$ sudo systemctl stop systemd-resolved | ||
+ | |||
+ | # On verifie... | ||
+ | thierry@binova-srv:~$ sudo netstat -lnp | grep :53 | ||
+ | tcp6 0 0 :::53 :::* LISTEN 1243/samba | ||
+ | udp6 0 0 :::53 :::* 1243/samba | ||
+ | </code> | ||
+ | |||
+ | Donc le problème a disparu, relançons le service Samba pour voir si ça marche... | ||
+ | <code bash> | ||
+ | thierry@bino:~$ sudo systemctl restart samba-ad-dc.service | ||
+ | </code> | ||
+ | |||
+ | === Vérifications === | ||
+ | <code bash> | ||
+ | thierry@bino:~$ sudo systemctl status samba-ad-dc.service | ||
+ | ● samba-ad-dc.service - Samba AD Daemon | ||
+ | Loaded: loaded (/lib/systemd/system/samba-ad-dc.service; enabled; vendor preset: enabled) | ||
+ | Active: active (running) since Sat 2018-11-03 18:14:04 UTC; 10s ago | ||
+ | Docs: man:samba(8) | ||
+ | man:samba(7) | ||
+ | man:smb.conf(5) | ||
+ | Main PID: 28122 (samba) | ||
+ | Status: "smbd: ready to serve connections..." | ||
+ | Tasks: 24 (limit: 2320) | ||
+ | CGroup: /system.slice/samba-ad-dc.service | ||
+ | ├─28122 /usr/sbin/samba --foreground --no-process-group | ||
+ | ├─28143 /usr/sbin/samba --foreground --no-process-group | ||
+ | ├─28144 /usr/sbin/samba --foreground --no-process-group | ||
+ | ├─28145 /usr/sbin/samba --foreground --no-process-group | ||
+ | ├─28146 /usr/sbin/samba --foreground --no-process-group | ||
+ | ├─28147 /usr/sbin/samba --foreground --no-process-group | ||
+ | ├─28148 /usr/sbin/samba --foreground --no-process-group | ||
+ | ├─28150 /usr/sbin/samba --foreground --no-process-group | ||
+ | ├─28151 /usr/sbin/samba --foreground --no-process-group | ||
+ | ├─28153 /usr/sbin/samba --foreground --no-process-group | ||
+ | ├─28154 /usr/sbin/smbd -D --option=server role check:inhibit=yes --foreground | ||
+ | ├─28155 /usr/sbin/samba --foreground --no-process-group | ||
+ | ├─28156 /usr/sbin/samba --foreground --no-process-group | ||
+ | ├─28157 /usr/sbin/samba --foreground --no-process-group | ||
+ | ├─28158 /usr/sbin/samba --foreground --no-process-group | ||
+ | ├─28159 /usr/sbin/samba --foreground --no-process-group | ||
+ | ├─28160 /usr/sbin/samba --foreground --no-process-group | ||
+ | ├─28161 /usr/sbin/winbindd -D --option=server role check:inhibit=yes --foreground | ||
+ | ├─28169 /usr/sbin/smbd -D --option=server role check:inhibit=yes --foreground | ||
+ | ├─28170 /usr/sbin/smbd -D --option=server role check:inhibit=yes --foreground | ||
+ | ├─28171 /usr/sbin/winbindd -D --option=server role check:inhibit=yes --foreground | ||
+ | ├─28173 /usr/sbin/winbindd -D --option=server role check:inhibit=yes --foreground | ||
+ | ├─28175 /usr/sbin/winbindd -D --option=server role check:inhibit=yes --foreground | ||
+ | └─28176 /usr/sbin/smbd -D --option=server role check:inhibit=yes --foreground | ||
+ | |||
+ | nov. 03 18:14:01 bino samba[28122]: Copyright Andrew Tridgell and the Samba Team 1992-2017 | ||
+ | nov. 03 18:14:02 bino samba[28122]: [2018/11/03 18:14:02.198210, 0] ../source4/smbd/server.c:620(binary_smbd_main) | ||
+ | nov. 03 18:14:02 bino samba[28122]: samba: using 'standard' process model | ||
+ | nov. 03 18:14:03 bino winbindd[28161]: [2018/11/03 18:14:03.032310, 0] ../source3/winbindd/winbindd_cache.c:3170(initialize_w | ||
+ | nov. 03 18:14:03 bino winbindd[28161]: initialize_winbindd_cache: clearing cache and re-creating with version number 2 | ||
+ | nov. 03 18:14:04 bino systemd[1]: Started Samba AD Daemon. | ||
+ | nov. 03 18:14:05 bino winbindd[28161]: [2018/11/03 18:14:04.923125, 0] ../lib/util/become_daemon.c:124(daemon_ready) | ||
+ | nov. 03 18:14:05 bino winbindd[28161]: STATUS=daemon 'winbindd' finished starting up and ready to serve connections | ||
+ | nov. 03 18:14:09 bino smbd[28154]: [2018/11/03 18:14:09.556902, 0] ../lib/util/become_daemon.c:124(daemon_ready) | ||
+ | nov. 03 18:14:09 bino smbd[28154]: STATUS=daemon 'smbd' finished starting up and ready to serve connections | ||
+ | </code> | ||
+ | |||
+ | |||
+ | On verifie avec [[linux:commandes:netstat|NetStat]] | ||
+ | <code bash> | ||
+ | thierry@bino:~$ sudo netstat -nlp | grep :53 | ||
+ | tcp 0 0 0.0.0.0:53 0.0.0.0:* LISTEN 28159/samba | ||
+ | tcp6 0 0 :::53 :::* LISTEN 28159/samba | ||
+ | udp 36864 0 0.0.0.0:53 0.0.0.0:* 28159/samba | ||
+ | udp6 0 0 :::53 :::* 28159/samba | ||
+ | </code> | ||
+ | Et on verifie la résolution des nom avec un [[linux:commandes:nslookup|NSLookup]] | ||
+ | <code bash> | ||
+ | thierry@binova-srv:~$ nslookup google.fr | ||
+ | Server: 127.0.0.1 | ||
+ | Address: 127.0.0.1#53 | ||
+ | |||
+ | Non-authoritative answer: | ||
+ | Name: google.fr | ||
+ | Address: 216.58.206.227 | ||
+ | </code> | ||
+ | Notre serveur DNS est bien **127.0.0.1#53** | ||
+ | ===== Voir aussi ===== | ||
+ | * [[linux:service:kerberos|Service Kerberos]] | ||
+ | |||
+ | |||
+ | |||