...
Les tests sont fait sur la machine cas.ifsic.univ-rennes1.fr, sur laquelle on installe Samba.
Configuration de Samba
Editer /etc/samba/smb.conf comme suit :
| Bloc de code |
|---|
[global] use kerberos keytab = yes realm = UNIV-RENNES1.FR security = ADS log file = /var/log/samba/log.%m max log size = 50 log level = 3 hosts allow = 148.60.10. 127. [tmp] comment = Temporary file space path = /tmp read only = no public = yes |
Configuration Kerberos
Il faut à la fois déclarer Déclarer le client (host, déjà fait précédemment) et le service SMB (cifs) :root@cas ~# kadmin
Authenticating as principal root/admin@UNIV-RENNES1.FR with password.
Password for root/admin@UNIV-RENNES1.FR:
kadmin: addprinc -randkey cifs/cas.ifsic.univ-rennes1.fr
WARNING: no policy specified for cifs/cas.ifsic.univ-rennes1.fr@UNIV-RENNES1.FR; defaulting to no policy
Principal "cifs/cas.ifsic.univ-rennes1.fr@UNIV-RENNES1.FR" created.
kadmin: exit
root@cas ~# root@cas ~]# kadmin
Authenticating as principal root/admin@UNIV-RENNES1.FR with password.
Password for root/admin@UNIV-RENNES1.FR:
kadmin: ktadd -k /etc/krb5.keytab cifs/cas.ifsic.univ-rennes1.fr
Entry for principal HTTP/cas.ifsic.univ-rennes1.fr with kvno 3, encryption type AES-256 CTS mode with 96-bit SHA-1 HMAC added to keytab WRFILE:/etc/httpd/conf/mod_auth_kerb.keytab.
Entry for principal HTTP/cas.ifsic.univ-rennes1.fr with kvno 3, encryption type AES-128 CTS mode with 96-bit SHA-1 HMAC added to keytab WRFILE:/etc/httpd/conf/mod_auth_kerb.keytab.
Entry for principal HTTP/cas.ifsic.univ-rennes1.fr with kvno 3, encryption type Triple DES cbc mode with HMAC/sha1 added to keytab WRFILE:/etc/httpd/conf/mod_auth_kerb.keytab.
Entry for principal HTTP/cas.ifsic.univ-rennes1.fr with kvno 3, encryption type ArcFour with HMAC/md5 added to keytab WRFILE:/etc/httpd/conf/mod_auth_kerb.keytab.
Entry for principal HTTP/cas.ifsic.univ-rennes1.fr with kvno 3, encryption type DES with HMAC/sha1 added to keytab WRFILE:/etc/httpd/conf/mod_auth_kerb.keytab.
Entry for principal HTTP/cas.ifsic.univ-rennes1.fr with kvno 3, encryption type DES cbc mode with RSA-MD5 added to keytab WRFILE:/etc/httpd/conf/mod_auth_kerb.keytab.
kadmin: exit
root@cas ~#
Test
Configuration mod_auth_kerb
Exporter la clé du client dans le fichier le fichier /etc/httpd/conf/mod_auth_kerb.keytab (ce fichier sera utilisé par mod_auth_kerb) :root@cas ~# kadmin
Authenticating as principal root/admin@UNIV-RENNES1.FR with password.
Password for root/admin@UNIV-RENNES1.FR:
kadmin: ktadd -k /etc/httpd/conf/mod_auth_kerb.keytab HTTP/cas.ifsic.univ-rennes1.fr
Entry for principal HTTP/cas.ifsic.univ-rennes1.fr with kvno 3, encryption type AES-256 CTS mode with 96-bit SHA-1 HMAC added to keytab WRFILE:/etc/httpd/conf/mod_auth_kerb.keytab.
Entry for principal HTTP/cas.ifsic.univ-rennes1.fr with kvno 3, encryption type AES-128 CTS mode with 96-bit SHA-1 HMAC added to keytab WRFILE:/etc/httpd/conf/mod_auth_kerb.keytab.
Entry for principal HTTP/cas.ifsic.univ-rennes1.fr with kvno 3, encryption type Triple DES cbc mode with HMAC/sha1 added to keytab WRFILE:/etc/httpd/conf/mod_auth_kerb.keytab.
Entry for principal HTTP/cas.ifsic.univ-rennes1.fr with kvno 3, encryption type ArcFour with HMAC/md5 added to keytab WRFILE:/etc/httpd/conf/mod_auth_kerb.keytab.
Entry for principal HTTP/cas.ifsic.univ-rennes1.fr with kvno 3, encryption type DES with HMAC/sha1 added to keytab WRFILE:/etc/httpd/conf/mod_auth_kerb.keytab.
Entry for principal HTTP/cas.ifsic.univ-rennes1.fr with kvno 3, encryption type DES cbc mode with RSA-MD5 added to keytab WRFILE:/etc/httpd/conf/mod_auth_kerb.keytab.
kadmin: exit
root@cas ~#
Revoir toute la suite
Il n'est pas nécessaire de configurer l'authentification des utilisateurs avec system-config-authentication sur ce serveur (les utilisateurs n'ont pas à se connecter sur le serveur CAS). Il faut néanmoins installer le fichier /etc/krb5.conf :
...
Les logs sont dans le répertoire /var/log/httpd.
Test
Tester en accédant à http://cas.ifsic.univ-rennes1.fr/kerb/test.php .
Installation mod_auth_kerb
Configuration Kerberos
Déclarer le client Kerberos :
| Bloc de code |
|---|
[root@cas ~]# kadmin Authenticating as principal root/admin@UNIV-RENNES1.FR with password. Password for root/admin@UNIV-RENNES1.FR: kadmin: addprinc -randkey HTTP/cas.ifsic.univ-rennes1.fr WARNING: no policy specified for HTTP/cas.ifsic.univ-rennes1.fr@UNIV-RENNES1.FR; defaulting to no policy Principal "HTTP/cas.ifsic.univ-rennes1.fr@UNIV-RENNES1.FR" created. kadmin: exit [root@cas ~]# |
Configuration mod_auth_kerb
Exporter la clé du client dans le fichier le fichier /etc/httpd/conf/mod_auth_kerb.keytab (ce fichier sera utilisé par mod_auth_kerb) :
...
| Bloc de code |
|---|
<Location /kerb> #SSLRequireSSL AuthType KerberosV5 AuthName "Kerberos Login" KrbMethodNegotiate On KrbMethodK5Passwd Off KrbAuthRealms UNIV-RENNES1.FR Krb5KeyTab /etc/httpd/conf/mod_auth_kerb.keytab require valid-user </Location> |
Test
Avant de tester, ne pas oublier d'ouvrir le port 80 entrant (system-config-firewall).
...