Projet

Général

Profil

Configurer manuel pour AD

http://zeldor.biz/2010/12/debian-join-windows-domain/#more-1240
http://ubuntuforums.org/showthread.php?t=91510
http://stankiewicz.free.fr/Wikka/wikka.php?wakka=HowtoSambaAD

Installation

aptitude install libkrb53 krb5-config krb5-user samba winbind ntpdate ntp

Attention : pour un container OpenVZ ne pas installer ntpdate/ntp !

Configuration

arrêt des services

/etc/init.d/samba stop
/etc/init.d/winbind stop
/etc/init.d/ntp stop

Kerberos

Editer /etc/krb5.conf

[libdefaults]
        default_realm = REGDRASIL.NET

# The following krb5.conf variables are only for MIT Kerberos.
        krb4_config = /etc/krb.conf
        krb4_realms = /etc/krb.realms
        kdc_timesync = 1
        ccache_type = 4
        forwardable = true
        proxiable = true

# The following libdefaults parameters are only for Heimdal Kerberos.
        v4_instance_resolve = false
        v4_name_convert = {
                host = {
                        rcmd = host
                        ftp = ftp
                }
                plain = {
                        something = something-else
                }
        }
        fcc-mit-ticketflags = true

[realms]
        REGDRASIL.NET = {
                kdc = 192.168.100.150:88
                admin_server = 192.168.100.150
        }

[domain_realm]
        .redirector.name = REGDRASIL.NET
        redirector.name = REGDRASIL.NET

[login]
        krb4_convert = true
        krb4_get_tickets = false

NTP

Configurer NTP (Pas besoin pour un serveur OpenVZ)

Configurer NTP

Tester NTP sur le contrôleur

ntpdate 192.168.100.150

...

DNS

Vérifier que le serveur DNS de la machine est bien le contrôleur de domaine. (/etc/resolv.conf)

Winbind

/etc/samba/smb.conf

   map untrusted to domain = yes
   workgroup = REGDRASIL
   realm = REGDRASIL.NET
   security = ADS
   encrypt passwords = true
   idmap uid = 10000-20000
   idmap gid = 10000-20000
   template shell = /bin/bash
   winbind enum groups = yes
   winbind enum users = yes
   winbind separator = +
   winbind use default domain = yes
   template homedir = /home/%D/%U
   wins server = controler.regdrasil.net

Nsswitch

Editer /etc/nsswitch.conf

passwd:         compat winbind
group:          compat winbind
shadow:         compat

hosts:          files dns wins
networks:       files

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

netgroup:       nis

Activer les modifications

ldconfig

Redémarrer les services

/etc/init.d/samba restart
/etc/init.d/winbind restart
/etc/init.d/ssh restart

Configurer PAM

Crée le répertoire des utilisateurs du domaine

mkdir /home/REGDRASIL

Ajouter au fichier /etc/pam.d/common-account

session    required   pam_mkhomedir.so skel=/etc/skel/ umask=0022

Rejoindre le domaine

net ads join -U admindudomaine

Si un message d'erreur DNS update failed! apparaît : c'est un bug lorsqu'on joint un domaine 2008 R2 (Patché)

Tester la connection

getent passwd

Doit retourner la liste des comptes Unix + AD

Quitter le domaine

net ads leave -U admindudomaine

Authentification

Tester l'authentification :

se connecter avec utilisateurad ou domain+utilisateur

Exemple en ssh

quentin@machine

ou

regdrasil.net+quentin@machine