Cette page montre comment installer deux serveurs Kerberos redondants (kerb1 le maître et kerb2 l'esclave).
Sommaire |
---|
Installation du serveur maître
...
Les deux serveurs kerb1 et kerb2 sont maintenant installés.
Gestion des principals
La gestion des principals peut se faire à distance à l'aide kadmin depuis une machine d'administration (de confiance).
Pour cela, depuis la machine d'administration, on génère un principal manager/admin et on exporte sa clé dans une keytab locale :
Bloc de code |
---|
[root@admin ~]# kadmin -p root/admin
Authenticating as principal root/admin with password.
Password for root/admin@UNIV-RENNES1.FR:
kadmin: addprinc -randkey manager/admin
WARNING: no policy specified for manager/admin@UNIV-RENNES1.FR; defaulting to no policy
Principal "manager/admin@UNIV-RENNES1.FR" created.
kadmin: ktadd -k /etc/manager.keytab manager/admin
Entry for principal manager/admin with kvno 3, encryption type Triple DES cbc mode with HMAC/sha1 added to keytab WRFILE:/etc/manager.keytab.
Entry for principal manager/admin with kvno 3, encryption type ArcFour with HMAC/md5 added to keytab WRFILE:/etc/manager.keytab.
Entry for principal manager/admin with kvno 3, encryption type DES with HMAC/sha1 added to keytab WRFILE:/etc/manager.keytab.
Entry for principal manager/admin with kvno 3, encryption type DES cbc mode with RSA-MD5 added to keytab WRFILE:/etc/manager.keytab.
kadmin: exit
[root@admin ~]# |
On utilise ensuite la commande kadmin -p manager/admin -k -t /etc/manager.keytab -q "commande_kadmin" pour exécuter la commande commande_kadmin. Par exemple :
Bloc de code |
---|
[root@admin ~]# kadmin -p manager/admin -k -t /etc/manager.keytab -q "listprincs"
Authenticating as principal manager/admin with keytab /etc/manager.keytab.
HTTP/cas-kerb.univ-rennes1.fr@UNIV-RENNES1.FR
K/M@UNIV-RENNES1.FR
cas/admin@UNIV-RENNES1.FR
host/cas-kerb.univ-rennes1.fr@UNIV-RENNES1.FR
host/clinux.ifsic.univ-rennes1.fr@UNIV-RENNES1.FR
host/cwinxp.ifsic.univ-rennes1.fr@UNIV-RENNES1.FR
host/kerb1.univ-rennes1.fr@UNIV-RENNES1.FR
host/kerb2.univ-rennes1.fr@UNIV-RENNES1.FR
kadmin/admin@UNIV-RENNES1.FR
kadmin/changepw@UNIV-RENNES1.FR
kadmin/history@UNIV-RENNES1.FR
kadmin/localhost.localdomain@UNIV-RENNES1.FR
krbtgt/UNIV-RENNES1.FR@UNIV-RENNES1.FR
manager/admin@UNIV-RENNES1.FR
paubry@UNIV-RENNES1.FR
root/admin@UNIV-RENNES1.FR
[root@admin ~]# |
On pourra écrire un script /usr/local/bin/kexec pour exécuter plus facilement les commandes sous kadmin :
Bloc de code |
---|
[root@admin ~]# cd /usr/local/bin
[root@admin bin]# cat > kexec
#!/bin/bash
kadmin -p manager/admin -k -t /etc/manager.keytab -q "$*"
[root@admin bin]# chown root.root kexec
[root@admin bin]# chmod 700 kexec
[root@admin bin]# |
La récupération d'un principal dupont dans la base Kerberos pourra ainsi se faire par :
Bloc de code |
---|
[root@admin bin]# kexec getprinc dupont
Authenticating as principal manager/admin with keytab /etc/manager.keytab.
Principal: dupont@UNIV-RENNES1.FR
Expiration date: [never]
Last password change: Wed Mar 10 12:23:31 CET 2010
Password expiration date: [none]
Maximum ticket life: 1 day 00:00:00
Maximum renewable life: 0 days 00:00:00
Last modified: Wed Mar 10 12:23:31 CET 2010 (cas/admin@UNIV-RENNES1.FR)
Last successful authentication: [never]
Last failed authentication: [never]
Failed password attempts: 0
Number of keys: 6
Key: vno 1, Triple DES cbc mode with HMAC/sha1, no salt
Key: vno 1, ArcFour with HMAC/md5, no salt
Key: vno 1, DES with HMAC/sha1, no salt
Key: vno 1, DES cbc mode with RSA-MD5, no salt
Key: vno 1, DES cbc mode with CRC-32, Version 4
Key: vno 1, DES cbc mode with CRC-32, AFS version 3
Attributes:
Policy: [none]
[root@admin bin]# |