cn:ccr:aai:howto:krb5-install
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| cn:ccr:aai:howto:krb5-install [2008/11/30 18:12] – fulvio@le.infn.it | cn:ccr:aai:howto:krb5-install [2009/11/26 20:45] (current) – roberto.lulli@roma2.infn.it | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Installazione di un realm Kerberos5 ====== | ||
| + | |||
| + | |||
| + | ** NOTA BENE ** | ||
| + | Gli esempi citati in questa guida si intendono per MIT Kerberos 5 versione 1.6 su Scientific Linux 5.1. | ||
| + | ===== Descrizione dell' | ||
| + | kdc.example.com: | ||
| + | |||
| + | client.example.com: | ||
| + | |||
| + | server.example.com: | ||
| + | |||
| + | lab1.d1.example.com: | ||
| + | |||
| + | lab2.d2.example.com: | ||
| + | |||
| + | .... | ||
| + | |||
| + | .... | ||
| + | |||
| + | .... | ||
| + | |||
| + | labn.dn.example.com: | ||
| + | |||
| + | |||
| + | ===== Preparazione del sistema ===== | ||
| + | |||
| + | [root@kdc ~]$ yum install krb5-server | ||
| + | |||
| + | ===== Configurazione client e librerie K5 ===== | ||
| + | [root@kdc ~]$ vi / | ||
| + | < | ||
| + | [logging] | ||
| + | | ||
| + | kdc = FILE:/ | ||
| + | | ||
| + | |||
| + | [libdefaults] | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | |||
| + | [realms] | ||
| + | | ||
| + | kdc = kerberos.example.com: | ||
| + | admin_server = kerberos.example.com: | ||
| + | default_domain = example.com | ||
| + | } | ||
| + | |||
| + | [domain_realm] | ||
| + | | ||
| + | | ||
| + | |||
| + | [appdefaults] | ||
| + | pam = { | ||
| + | debug = false | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ===== Configurazione del KDC (Key Distribution Center) ===== | ||
| + | |||
| + | [root@kdc ~]# vi / | ||
| + | |||
| + | < | ||
| + | [kdcdefaults] | ||
| + | | ||
| + | | ||
| + | |||
| + | [realms] | ||
| + | | ||
| + | # | ||
| + | acl_file = / | ||
| + | dict_file = / | ||
| + | admin_keytab = / | ||
| + | supported_enctypes = des3-hmac-sha1: | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ===== Creazione del database per il REALM EXAMPLE.COM ===== | ||
| + | |||
| + | |||
| + | |||
| + | [root@kdc ~]$ kdb5_util create -s | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | ===== Avviamento dei servizi che caratterizzano un KDC ===== | ||
| + | |||
| + | [root@kdc ~]$ service krb5kdc start | ||
| + | |||
| + | [root@kdc ~]$ service kadmin start | ||
| + | |||
| + | [root@kdc ~]$ service krb524 start | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | ===== Creare il primo utente amministratore del REALM ===== | ||
| + | |||
| + | |||
| + | [root@kdc ~]$ kadmin.local | ||
| + | |||
| + | |||
| + | kadmin.local: | ||
| + | |||
| + | kadmin.local: | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | ===== Impostazione delle ACL di amministratore ===== | ||
| + | |||
| + | |||
| + | [root@kdc ~]$ vi / | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | ===== Creare un utente non privilegiato ===== | ||
| + | |||
| + | |||
| + | [root@kdc ~]$ kinit admin/admin | ||
| + | |||
| + | [root@kdc ~]$ kadmin | ||
| + | |||
| + | kadmin: addprinc user1 | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | ===== Creare la chiave di servizio per la macchina kdc.example.com nel database del KDC ===== | ||
| + | |||
| + | |||
| + | kadmin: addprinc -randkey host/ | ||
| + | |||
| + | |||
| + | |||
| + | ===== Inserire la chiave di servizio nella keytable del server applicativo ===== | ||
| + | |||
| + | |||
| + | |||
| + | kadmin: ktadd host/ | ||
| + | |||
| + | kadmin: exit | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | ===== Kerberizzazione del servizio ssh mediante le librerie GSSAPI ===== | ||
| + | |||
| + | |||
| + | [root@kdc ~] vi / | ||
| + | |||
| + | GSSAPIAuthentication yes | ||
| + | |||
| + | GSSAPICleanupCredentials yes (elimina il ticket alla chiusura della sessione ssh) | ||
| + | |||
| + | [root@kdc ~]$ service sshd restart | ||
| + | |||
| + | [root@kdc ~]$ vi / | ||
| + | |||
| + | GSSAPIDelegateCredentials yes | ||
| + | |||
| + | ===== Inserimento di un utente nel database di autorizzazione | ||
| + | |||
| + | |||
| + | [root@kdc ~]$ adduser -m user1 | ||
| + | |||
| + | |||
| + | |||
| + | ===== Test di utilizzo dell’account Kerberos con ssh ===== | ||
| + | |||
| + | |||
| + | [root@kdc ~]$ kinit user1 | ||
| + | |||
| + | [root@kdc ~]$ klist | ||
| + | |||
| + | [root@kdc ~]$ ssh user1@kdc.example.com | ||
| + | |||
| + | [user1@kdc ~]$ klist (la cache delle credenziali è vuota) | ||
| + | |||
| + | [user1@kdc ~]$ exit | ||
| + | |||
| + | [root@kdc ~]$ kinit -f user1 | ||
| + | |||
| + | [root@kdc ~]$ klist -f | ||
| + | |||
| + | [root@kdc ~]$ ssh user1@kdc.example.com | ||
| + | |||
| + | [user1@kdc ~]$ klist -f (notare che il TGT è ancora forwardabile) | ||
| + | |||
| + | [user1@kdc ~]$ exit | ||
| + | |||
| + | |||
| + | ===== Configurazione dei moduli PAM per l’autenticazione con Kerberos 5 ===== | ||
| + | |||
| + | |||
| + | [root@kdc ~]$ authconfig --update --enablekrb5 | ||
| + | |||
| + | [root@kdc ~]$ vi / | ||
| + | |||
| + | auth sufficient | ||
| + | |||
| + | |||
| + | |||
| + | ===== Verifica del telnet kerberizzato ===== | ||
| + | |||
| + | |||
| + | [root@kdc ~]$ vi / | ||
| + | |||
| + | [root@kdc ~]$ service xinetd restart | ||
| + | |||
| + | [root@kdc ~]$ telnet -f -a -l user1 kdc.example.com | ||
| + | |||
| + | [user1@kdc ~]$ exit | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | ===== Configurazione del DNS del dominio example.com per i servizi Kerberos 5 ===== | ||
| + | |||
| + | |||
| + | [root@kdc ~]$ vi / | ||
| + | |||
| + | _kerberos | ||
| + | |||
| + | _kerberos._udp | ||
| + | |||
| + | _kerberos._tcp | ||
| + | |||
| + | _kerberos-master._udp | ||
| + | |||
| + | _kerberos-adm._tcp | ||
| + | |||
| + | _kpasswd._udp | ||
| + | |||
| + | |||
| + | |||
| + | |||
