The Network Authentication Protocol: Kerberos
The Network Authentication Protocol: Kerberos
Presented by:
Derek Konigsberg
[email protected]
Linux Enthusiasts and Professionals
Overview of presentation
● What is Kerberos?
● Authentication
– The confirmation that a user who is requesting services
is a valid user of the network services requested
● Authorization
– The granting of specific types of service to a user,
based on their authentication, what services they are
requesting, and the current system state
● Accounting
– The tracking of the consumption of network resources
by users
Different types of cryptography
● Symmetric Key
– The same key is used for both encryption and
decryption
– Examples: DES, 3DES, AES
● Public Key
– Two keys are used for encryption and decryption
● “Private key” is used for encryption
● “Public key” is used for decryption
– Examples: RSA
● While many systems today use public key
cryptography for authentication, Kerberos
manages to do it with symmetric key cryptography
Benefits of Kerberos
Realm: FOO.COM
Kerberos KDC
E-Mail server
Print server
joe@bar:~$ klist
Ticket cache: FILE:/tmp/krb5cc_201
Default principal: [email protected]
Valid starting Expires Service principal
12/13/05 23:07:25 12/14/05 07:07:25 krbtgt/[email protected] Ticket Granting Ticket
renew until 12/14/05 23:07:24
12/13/05 23:11:57 12/14/05 07:07:25 host/[email protected] Host service ticket
renew until 12/14/05 23:07:24
12/13/05 23:33:05 12/14/05 07:33:03 imap/[email protected] IMAP service ticket
renew until 12/14/05 17:33:03
Preparing for Kerberos
● Prerequisites
– Configure NTP (time synchronization) across all
machines
● Kerberos depends on accurate and usable timestamps
– Configure DNS
● Kerberos requires fully qualified domain names (FQDN)
that are resolvable in both forward and reverse directions for
all servers
● Special DNS zone configurations can simplify Kerberos
client configurations
Kerberos-specific DNS records
● Configuration files
– /etc/krb5.conf
– /etc/kadm5.acl
● Prepare the Kerberos database
– Initialize the Kerberos database
– Add administrator's principal
– Start the KDC and KDC administration processes
● Create user principals
– Note: service principals are created when configuring
your other services to support Kerberos authentication
Configuration files
# /etc/krb5.conf
[libdefaults]
default_realm = FOO.COM
[realms]
FOO.COM = {
kdc = kdc.foo.com
admin_server = kdc.foo.com
}
[domain_realm]
.foo.com = FOO.COM
foo.com = FOO.COM
[logging]
default = FILE:/var/log/kdc.log
# /etc/kadm5.acl
*/[email protected] *
Prepare the Kerberos database
kdc# kadmin -p root/admin
...enter root/admin's password...
kadmin: addprinc john
...enter password for [email protected]...
kadmin: addprinc jane
...enter password for [email protected]...
kadmin: exit
Configuring Kerberos clients
● Configuration file
– /etc/krb5.conf
– You can just copy this from the KDC
● Service principals
– Needed if this client will be providing services that use
Kerberos authentication (i.e. remote access, e-mail)
– Involves creating the principals, then adding them to
the client's “keytab” file
● PAM (Pluggable Authentication Modules)
– Needed if you want to be able to authenticate users
logging into this machine via Kerberos
Create service principals
...
auth sufficient pam_krb5.so try_first_pass
...
account sufficient pam_krb5.so try_first_pass
...
password sufficient pam_krb5.so try_first_pass
...
Common user commands
● kinit
– Obtain and cache Kerberos ticket-granting ticket
– Used to authenticate with the KDC
● klist
– List cached Kerberos tickets
● kdestroy
– Destroy Kerberos tickets
– Used to clear out the ticket cache
● kadmin
– Kerberos database administration program
● ktutil
– Kerberos keytab file maintenance utility
Any questions?
Derek Konigsberg
[email protected]