Installation d`un Contrôleur Principal de Domaine SAMBA 4
Transcription
Installation d`un Contrôleur Principal de Domaine SAMBA 4
EIL Côte d'Opale 2013 Installation d'un Contrôleur Principal de Domaine SAMBA 4 Pré-requis : uname -a Linux mars 3.2.0-4-686-pae #1 SMP Debian 3.2.39-2 i686 GNU/Linux apt-get install linux-headers-3.2.0-4-686-pae apt-get install gcc make build-essential libacl1-dev libattr1-dev libblkid-dev libgnutls-dev libreadline-dev python-dev python-dnspython gdb pkg-config libpopt-dev libldap2-dev dnsutils Ne pas installer les paquets'krb5-config' (serveur Kerberos), 'bind9' et 'bind9-host' (serveur DNS). SAMBA 4 intègre un serveur Kerberos et DNS. Utilisez la commande dpkg -l bind*/krb* pour vérification. Téléchargement et installation de Samba 4 : http://www.samba.org/ cd dossier_de_téléchargements/ ls mv samba-4.0.4.tar.gz /opt/ cd /opt/ tar xvzf samba-4.0.4.tar.gz cd samba-4.0.4 ./configure.developer make make install L’installation de SAMBA se trouve dans /usr/local/samba. Création du domaine Active Directory : cd /usr/local/samba/bin/ ./samba-tool domain provision --realm='nom_de_domaine' --domain='nom_netbios' --adminpass='mot_de_passe' –server-role='dc' Retour console : Looking up IPv4 addresses Looking up IPv6 addresses No IPv6 address will be assigned Setting up secrets.ldb Setting up the registry Setting up the privileges database Setting up idmap db Setting up SAM db Setting up sam.ldb partitions and settings Setting up sam.ldb rootDSE Pre-loading the Samba 4 and AD schema Adding DomainDN: DC=calais,DC=fr 1/5 EIL Côte d'Opale 2013 Adding configuration container Setting up sam.ldb schema Setting up sam.ldb configuration data Setting up display specifiers Modifying display specifiers Adding users container Modifying users container Adding computers container Modifying computers container Setting up sam.ldb data Setting up well known security principals Setting up sam.ldb users and groups Setting up self join Adding DNS accounts Creating CN=MicrosoftDNS,CN=System,DC=calais,DC=fr Creating DomainDnsZones and ForestDnsZones partitions Populating DomainDnsZones and ForestDnsZones partitions Setting up sam.ldb rootDSE marking as synchronized Fixing provision GUIDs A Kerberos configuration suitable for Samba 4 has been generated at /usr/local/samba/private/krb5.conf Once the above files are installed, your Samba4 server will be ready to use Server Role: active directory domain controller Hostname: mars NetBIOS Domain: CALAIS DNS Domain: calais.fr DOMAIN SID: S-1-5-21-4032581557-266244832-419113493 Configuration du serveur DNS : vim /etc/resolv.conf domain 'nom_de_domaine' search 'nom_de_domaine' nameserver votre_ip Pour démarrer le serveur SAMBA : /usr/local/samba/sbin/samba Pour vérifier que les services SAMBA sont démarrés: nmap addresseipserveur Éviter de taper 'nmap localhost' car on ne voit pas le service DNS en écoute. Retour console : 53/tcp open domain 80/tcp open http 88/tcp open kerberos-sec 111/tcp open rpcbind 135/tcp open msrpc 139/tcp open netbios-ssn 389/tcp open ldap 2/5 EIL Côte d'Opale 2013 445/tcp open microsoft-ds 464/tcp open kpasswd5 636/tcp open ldapssl 1024/tcp open kdm 3268/tcp open globalcatLDAP 3269/tcp open globalcatLDAPssl Les services ci-dessus doivent être démarrés. Configuration de Kerberos : apt-get install krb5-user pour disposer des outils kinit et klist Un assistant apparaît et vous demande les éléments suivants. Entrer le 'nom du serveur de royaume'. Taper le nom complet du serveur SAMBA : nom_pc.nom_de_domaine Entrer le 'nom du serveur administratif du royaume Kerberos': nom_pc.nom_de_domaine Cela génère alors le fichier /etc/krb5.conf suivant : ************************************************************************* [libdefaults] default_realm = nom_de_domaine # 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 encryption type specification will be used by MIT Kerberos # if uncommented. In general, the defaults in the MIT Kerberos code are # correct and overriding these specifications only serves to disable new # encryption types as they are added, creating interoperability problems. # # Thie only time when you might need to uncomment these lines and change # the enctypes is if you have local software that will break on ticket # caches containing ticket encryption types it doesn't know about (such as # old versions of Sun Java). # # # default_tgs_enctypes = des3-hmac-sha1 default_tkt_enctypes = des3-hmac-sha1 permitted_enctypes = des3-hmac-sha1 # The following libdefaults parameters are only for Heimdal Kerberos. v4_instance_resolve = false v4_name_convert = { host = { rcmd = host ftp = ftp 3/5 EIL Côte d'Opale 2013 } plain = { something = something-else } } fcc-mit-ticketflags = true [realms] nom_de_domaine = { kdc = nom_pc admin_server = nom_pc } ATHENA.MIT.EDU = { ************************************************************************* Création du ticket de service Kerberos: kinit administrator@'nom_de_domaine' Saisir le mot de passe. Le système doit vous renvoyer ' Warning : Your password will expire in 41 days on… ' Informations sur le ticket de service : klist Testez votre serveur en joignant Windows Seven à votre domaine. Quelques commandes : cd /usr/local/samba/bin/ wbinfo -t, wbinfo -u, wbinfo -g ./smbstatus ./pdbedit -L ./pdbedit -v 'nom_d'utilisateur' less /usr/local/samba/etc/smb.conf Installation des outils d'administrations Windows Serveur 2008 R2 : Connectez-vous en tant qu'administrator' du domaine sous Windows Seven, nous allons maintenant administrer le PDC SAMBA 4 Téléchargez les outils d'administrations : http://stephane.lebegue.free.fr/downloads/Windows6.1-KB958830-x64-RefreshPkg.msu Après installation, ajout des fonctionnalités des logiciels enfichables disponibles dans la MMC (Microsoft Management Console) : Panneau de configuration\Tous les Panneaux de configuration\Programmes et fonctionnalités\Activez ou désactivez des fonctionnalités Windows Ajoutez les outils d'administration de serveur distant Exécutez mmc puis ajouter/supprimer un composant logiciel enfichable. Ajoutez les composants nécessaires et connectez-vous à l'AD SAMBA 4 Vous pouvez maintenant administrer votre SAMBA 4 comme un Windows Serveur 2008 R2 4/5 EIL Côte d'Opale 2013 Test : Créez un utilisateur avec la mmc et testez la connexion. Quelques screenshots : è- 5/5