Kerberos
System security and integrity within a network can be unwieldy. It can occupy the time of several administrators just to keep track of what services are being run on a network and the manner in which these services are used.
Further, authenticating users to network services can prove dangerous when the method used by the protocol is inherently insecure, as evidenced by the transfer of unencrypted passwords over a network using the traditional FTP and Telnet protocols.
Kerberos is a way to eliminate the need for protocols that allow unsafe methods of authentication, thereby enhancing overall network security.
Kerberos is a network authentication protocol created by MIT, and uses symmetric-key cryptography[17] to authenticate users to network services, which means passwords are never actually sent over the network.
Consequently, when users authenticate to network services using Kerberos, unauthorized users attempting to gather passwords by monitoring network traffic are effectively thwarted. Most conventional network services use password-based authentication schemes. Such schemes require a user to authenticate to a given network server by supplying their username and password. Unfortunately, the transmission of authentication information for many services is unencrypted. For such a scheme to be secure, the network has to be inaccessible to outsiders, and all computers and users on the network must be trusted and trustworthy.
Even if this is the case, a network that is connected to the Internet can no longer be assumed to be secure. Any attacker who gains access to the network can use a simple packet analyzer, also known as a packet sniffer, to intercept usernames and passwords, compromising user accounts and the integrity of the entire security infrastructure.
The primary design goal of Kerberos is to eliminate the transmission of unencrypted passwords across the network. If used properly, Kerberos effectively eliminates the threat that packet sniffers would otherwise pose on a network. Although Kerberos removes a common and severe security threat, it may be difficult to implement for a variety of reasons:
http://www.nrl.navy.mil/CCS/people/kenh/kerberos-faq.html
Kerberos has its own terminology to define various aspects of the service. Before learning how Kerberos works, it is important to learn the following terms.
A server that issues tickets for a desired service which are in turn given to users for access to the service. The AS responds to requests from clients who do not have or do not send credentials with a request. It is usually used to gain access to the ticket-granting server (TGS) service by issuing a ticket-granting ticket (TGT). The AS usually runs on the same host as the key distribution center (KDC). Encrypted data.
An entity on the network (a user, a host, or an application) that can receive a ticket from Kerberos.
A temporary set of electronic credentials that verify the identity of a client for a particular service. Also called a ticket.
A file which contains the keys for encrypting communications between a user and various network services. Kerberos 5 supports a framework for using other cache types, such as shared memory, but files are more thoroughly supported.
A one-way hash used to authenticate users. These are more secure than using unencrypted data, but they are still relatively easy to decrypt for an experienced cracker.
The Generic Security Service Application Program Interface (defined in RFC-2743 published by The Internet Engineering Task Force) is a set of functions which provide security services. This API is used by clients and services to authenticate to each other without either program having specific knowledge of the underlying mechanism. If a network service (such as cyrus-IMAP) uses GSS-API, it can authenticate using Kerberos.
Also known as a hash value. A value generated by passing a string through a hash function. These values are typically used to ensure that transmitted data has not been tampered with.
A way of generating a digital "fingerprint" from input data. These functions rearrange, transpose or otherwise alter data to produce a hash value.
Data used when encrypting or decrypting other data. Encrypted data cannot be decrypted without the proper key or extremely good fortune on the part of the cracker.
A service that issues Kerberos tickets, and which usually run on the same host as the ticket-granting server (TGS).
A file that includes an unencrypted list of principals and their keys. Servers retrieve the keys they need from keytab files instead of using The The principal is the unique name of a user or service allowed to authenticate using Kerberos. A principal follows the form A network that uses Kerberos, composed of one or more servers called KDCs and a potentially large number of clients.
A program accessed over the network.
A temporary set of electronic credentials that verify the identity of a client for a particular service. Also called credentials.
A server that issues tickets for a desired service which are in turn given to users for access to the service. The TGS usually runs on the same host as the KDC.
A special ticket that allows the client to obtain additional tickets without applying for them from the KDC.
A plain text, human-readable password. Kerberos differs from username/password authentication methods. Instead of authenticating each user to each network service, Kerberos uses symmetric encryption and a trusted third party (a KDC), to authenticate users to a suite of network services. When a user authenticates to the KDC, the KDC sends a ticket specific to that session back to the user's machine, and any Kerberos-aware services look for the ticket on the user's machine rather than requiring the user to authenticate using a password.
When a user on a Kerberos-aware network logs in to their workstation, their principal is sent to the KDC as part of a request for a TGT from the Authentication Server. This request can be sent by the log-in program so that it is transparent to the user, or can be sent by the The KDC then checks for the principal in its database. If the principal is found, the KDC creates a TGT, which is encrypted using the user's key and returned to that user.
The login or The TGT is set to expire after a certain period of time (usually ten to twenty-four hours) and is stored in the client machine's credentials cache. An expiration time is set so that a compromised TGT is of use to an attacker for only a short period of time. After the TGT has been issued, the user does not have to re-enter their password until the TGT expires or until they log out and log in again.
Whenever the user needs access to a network service, the client software uses the TGT to request a new ticket for that specific service from the TGS. The service ticket is then used to authenticate the user to that service transparently.
The Kerberos system can be compromised if a user on the network authenticates against a non-Kerberos aware service by transmitting a password in plain text. The use of non-Kerberos aware services is highly discouraged. Such services include Telnet and FTP. The use of other encrypted protocols, such as SSH or SSL-secured services, however, is preferred, although not ideal.
This is only a broad overview of how Kerberos authentication works. Refer to "Additional Resources" for links to more in-depth information.
Kerberos depends on the following network services to function correctly.
A clock synchronization program should be set up for the network, such as You should ensure that the DNS entries and hosts on the network are all properly configured. Refer to the Kerberos V5 System Administrator's Guide in Kerberos-aware services do not currently make use of Pluggable Authentication Modules (PAM) - these services bypass PAM completely. However, applications that use PAM can make use of Kerberos for authentication if the Administrators should be careful not to allow users to authenticate to most network services using Kerberos passwords. Many protocols used by these services do not encrypt the password before sending it over the network, destroying the benefits of the Kerberos system. For example, users should not be allowed to authenticate to Telnet services with the same password they use for Kerberos authentication. When setting up Kerberos, install the KDC first. If it is necessary to set up slave servers, install the master first.
To configure the first Kerberos KDC, follow these steps:
Ensure that time synchronization and DNS are functioning correctly on all client and server machines before configuring Kerberos. Pay particular attention to time synchronization between the Kerberos server and its clients. If the time difference between the server and client is greater than five minutes (this is configurable in Kerberos 5), Kerberos clients can not authenticate to the server. This time synchronization is necessary to prevent an attacker from using an old Kerberos ticket to masquerade as a valid user. It is advisable to set up a Network Time Protocol (NTP) compatible client/server network even if Kerberos is not being used. Community Enterprise Linux includes the Install the Edit the Create the database using the The Edit the Most users are represented in the database by a single principal (with a NULL, or empty, instance, such as joe@EXAMPLE.COM). In this configuration, users with a second principal with an instance of admin (for example, joe/admin@EXAMPLE.COM) are able to wield full power over the realm's Kerberos database.
After The Type the following Start Kerberos using the following commands:
Add principals for the users using the Verify that the KDC is issuing tickets. First, run By default, Once these steps are completed, the Kerberos server should be up and running. Setting up a Kerberos 5 client is less involved than setting up a server. At a minimum, install the client packages and provide each client with a valid Be sure that time synchronization is in place between the Kerberos client and the KDC. Refer to "Configuring a Kerberos 5 Server" for more information. In addition, verify that DNS is working properly on the Kerberos client before configuring the Kerberos client programs. Install the Before a workstation in the realm can use Kerberos to authenticate users who connect using Using Now that the principal has been created, keys can be extracted for the workstation by running To use other kerberized network services, they must first be started. Below is a list of some common kerberized services and instructions about enabling them:
An alternative to Refer to Controlling Access to Services for details about how to enable services. When a client attempts to access a service running on a particular server, it knows the name of the service (host) and the name of the server (foo.example.com), but because more than one realm may be deployed on your network, it must guess at the name of the realm in which the service resides.
By default, the name of the realm is taken to be the DNS domain name of the server, upper-cased.
foo.example.org → EXAMPLE.ORG
In some configurations, this will be sufficient, but in others, the realm name which is derived will be the name of a non-existent realm. In these cases, the mapping from the server's DNS domain name to the name of its realm must be specified in the domain_realm section of the client system's The above configuration specifies two mappings. The first mapping specifies that any system in the "example.com" DNS domain belongs to the EXAMPLE.COM realm. The second specifies that a system with the exact name "example.com" is also in the realm. (The distinction between a domain and a specific host is marked by the presence or lack of an initial ".".) The mapping can also be stored directly in DNS. For a number of reasons, you may choose to run multiple KDCs for a given realm. In this scenario, one KDC (the master KDC) keeps a writable copy of the realm database and runs The master-slave propagation procedure entails the master KDC dumping its database to a temporary dump file and then transmitting that file to each of its slaves, which then overwrite their previously-received read-only copies of the database with the contents of the dump file.
To set up a slave KDC, first ensure that the master KDC's Start Start With its service key, the slave KDC could authenticate any client which would connect to it. Obviously, not all of them should be allowed to provide the slave's Once the slave KDC has obtained a copy of the database, it will also need the master key which was used to encrypt it. If your KDC database's master key is stored in a stash file on the master KDC (typically named Ensure that the slave KDC's firewall allows the master KDC to contact it using TCP on port 754 (krb5_prop), and start the Now perform a manual database propagation test by dumping the realm database, on the master KDC, to the default data file which the Using That done, simply create a script which dumps the realm database and runs the Cross-realm authentication is the term which is used to describe situations in which clients (typically users) of one realm use Kerberos to authenticate to services (typically server processes running on a particular server system) which belong to a realm other than their own.
For the simplest case, in order for a client of a realm named To accomplish this, select a very strong password or passphrase, and create an entry for the principal in both realms using kadmin.
Use the Security-conscious administrators may attempt to use the Clients in the This brings us to an important point: cross-realm trust is unidirectional by default. The KDC for the If direct trust relationships were the only method for providing trust between realms, networks which contain multiple realms would be very difficult to set up. Luckily, cross-realm trust is transitive. If clients from Now you face the more conventional problems: the client's system must be configured so that it can properly deduce the realm to which a particular service belongs, and it must be able to determine how to obtain credentials for services in that realm.
First things first: the principal name for a service provided from a specific server system in a given realm typically looks like this:
In this example, service is typically either the name of the protocol in use (other common values include ldap, imap, cvs, and HTTP) or host, server.example.com is the fully-qualified domain name of the system which runs the service, and To deduce the realm to which the service belongs, clients will most often consult DNS or the Having determined which to which realm a service belongs, a client then has to determine the set of realms which it needs to contact, and in which order it must contact them, to obtain credentials for use in authenticating to the service.
This can be done in one of two ways.
The default method, which requires no explicit configuration, is to give the realms names within a shared hierarchy. For an example, assume realms named The client in this scenario treats the realm name as one might treat a DNS name. It repeatedly strips off the components of its own realm's name to generate the names of realms which are "above" it in the hierarchy until it reaches a point which is also "above" the service's realm. At that point it begins prepending components of the service's realm name until it reaches the service's realm. Each realm which is involved in the process is another "hop".
For example, using credentials in A.EXAMPLE.COM → EXAMPLE.COM → B.EXAMPLE.COM
Another example, using credentials in SITE1.SALES.EXAMPLE.COM → SALES.EXAMPLE.COM → EXAMPLE.COM → EVERYWHERE.EXAMPLE.COM
Another example, this time using realm names whose names share no common suffix ( DEVEL.EXAMPLE.COM → EXAMPLE.COM → COM → ORG → EXAMPLE.ORG → PROD.EXAMPLE.ORG
The more complicated, but also more flexible, method involves configuring the The format of the Here's an example:
In this example, clients in the If those clients wish to contact a service in the If those clients wish to contact a service in the Without a capath entry indicating otherwise, Kerberos assumes that cross-realm trust relationships form a hierarchy.
Clients in the A.EXAMPLE.COM → EXAMPLE.COM → B.EXAMPLE.COM
For more information about Kerberos, refer to the following resources.What is Kerberos?
Advantages of Kerberos
Disadvantages of Kerberos
/etc/passwd
or /etc/shadow
, to a Kerberos password database can be tedious, as there is no automated mechanism to perform this task. Refer to Question 2.23 in the online Kerberos FAQ:
Kerberos Terminology
kinit
. The default keytab file is /etc/krb5.keytab
. The KDC administration server, /usr/kerberos/sbin/kadmind
, is the only service that uses any other file (it uses /var/kerberos/krb5kdc/kadm5.keytab
).
kinit
command allows a principal who has already logged in to obtain and cache the initial ticket-granting ticket (TGT). Refer to the kinit
man page for more information.
root[/instance]@REALM
. For a typical user, the root is the same as their login ID. The instance
is optional. If the principal has an instance, it is separated from the root with a forward slash ("/"). An empty string ("") is considered a valid instance (which differs from the default NULL
instance), but using it can be confusing. All principals in a realm have their own key, which for users is derived from a password or is randomly set for services.
How Kerberos Works
kinit
program after the user logs in.
kinit
program on the client then decrypts the TGT using the user's key, which it computes from the user's password. The user's key is used only on the client machine and is not transmitted over the network.
ntpd
. Refer to /usr/share/doc/ntp-
for details on setting up Network Time Protocol servers (where <version-number>
/index.html<version-number>
is the version number of the ntp
package installed on your system).
/usr/share/doc/krb5-server-
for more information (where <version-number>
<version-number>
is the version number of the krb5-server
package installed on your system).Kerberos and PAM
pam_krb5
module (provided in the pam_krb5
package) is installed. The pam_krb5
package contains sample configuration files that allow services such as login
and gdm
to authenticate users as well as obtain initial credentials using their passwords. If access to network servers is always performed using Kerberos-aware services or services that use GSS-API, such as IMAP, the network can be considered reasonably safe.
Configuring a Kerberos 5 Server
ntp
package for this purpose. Refer to /usr/share/doc/ntp-
(where <version-number>
/index.html<version-number>
is the version number of the ntp
package installed on your system) for details about how to set up Network Time Protocol servers, and http://www.ntp.org for more information about NTP.
krb5-libs
, krb5-server
, and krb5-workstation
packages on the dedicated machine which runs the KDC. This machine needs to be very secure - if possible, it should not run any services other than the KDC.
/etc/krb5.conf
and /var/kerberos/krb5kdc/kdc.conf
configuration files to reflect the realm name and domain-to-realm mappings. A simple realm can be constructed by replacing instances of EXAMPLE.COM
and example.com
with the correct domain name - being certain to keep uppercase and lowercase names in the correct format - and by changing the KDC from kerberos.example.com
to the name of the Kerberos server. By convention, all realm names are uppercase and all DNS hostnames and domain names are lowercase. For full details about the formats of these configuration files, refer to their respective man pages.
kdb5_util
utility from a shell prompt:
/usr/kerberos/sbin/kdb5_util create -s
create
command creates the database that stores keys for the Kerberos realm. The -s
switch forces creation of a stash file in which the master server key is stored. If no stash file is present from which to read the key, the Kerberos server (krb5kdc
) prompts the user for the master server password (which can be used to regenerate the key) every time it starts.
/var/kerberos/krb5kdc/kadm5.acl
file. This file is used by kadmind
to determine which principals have administrative access to the Kerberos database and their level of access. Most organizations can get by with a single line:
*/admin@EXAMPLE.COM *
kadmind
has been started on the server, any user can access its services by running kadmin
on any of the clients or servers in the realm. However, only users listed in the kadm5.acl
file can modify the database in any way, except for changing their own passwords.
kadmin
utility communicates with the kadmind
server over the network, and uses Kerberos to handle authentication. Consequently, the first principal must already exist before connecting to the server over the network to administer it. Create the first principal with the kadmin.local
command, which is specifically designed to be used on the same host as the KDC and does not use Kerberos for authentication.
kadmin.local
command at the KDC terminal to create the first principal:
/usr/kerberos/sbin/kadmin.local -q "addprinc
username
/admin"service krb5kdc start
service kadmin start
service krb524 start
addprinc
command within kadmin
. kadmin
and kadmin.local
are command line interfaces to the KDC. As such, many commands - such as addprinc
- are available after launching the kadmin
program. Refer to the kadmin
man page for more information.
kinit
to obtain a ticket and store it in a credential cache file. Next, use klist
to view the list of credentials in the cache and use kdestroy
to destroy the cache and the credentials it contains.
kinit
attempts to authenticate using the same system login username (not the Kerberos server). If that username does not correspond to a principal in the Kerberos database, kinit
issues an error message. If that happens, supply kinit
with the name of the correct principal as an argument on the command line (kinit
).
<principal>
Configuring a Kerberos 5 Client
krb5.conf
configuration file. While ssh
and slogin
are the preferred method of remotely logging in to client systems, Kerberized versions of rsh
and rlogin
are still available, though deploying them requires that a few more configuration changes be made.
krb5-libs
and krb5-workstation
packages on all of the client machines. Supply a valid /etc/krb5.conf
file for each client (usually this can be the same krb5.conf
file used by the KDC).
ssh
or Kerberized rsh
or rlogin
, it must have its own host principal in the Kerberos database. The sshd
, kshd
, and klogind
server programs all need access to the keys for the host service's principal. Additionally, in order to use the kerberized rsh
and rlogin
services, that workstation must have the xinetd
package installed.
kadmin
, add a host principal for the workstation on the KDC. The instance in this case is the hostname of the workstation. Use the -randkey
option for the kadmin
's addprinc
command to create the principal and assign it a random key:
addprinc -randkey host/
blah.example.com
kadmin
on the workstation itself, and using the ktadd
command within kadmin
:
ktadd -k /etc/krb5.keytab host/
blah.example.com
ssh
- OpenSSH uses GSS-API to authenticate users to servers if the client's and server's configuration both have GSSAPIAuthentication
enabled. If the client also has GSSAPIDelegateCredentials
enabled, the user's credentials are made available on the remote system.rsh
and rlogin
- To use the kerberized versions of rsh
and rlogin
, enable klogin
, eklogin
, and kshell
.
krb5-telnet
must be enabled.
ftp
. Be certain to set the instance to the fully qualified hostname of the FTP server, then enable gssftp
.
cyrus-imap
package uses Kerberos 5 if it also has the cyrus-sasl-gssapi
package installed. The cyrus-sasl-gssapi
package contains the Cyrus SASL plugins which support GSS-API authentication. Cyrus IMAP should function properly with Kerberos as long as the cyrus
user is able to find the proper key in /etc/krb5.keytab
, and the root for the principal is set to imap
(created with kadmin
).
cyrus-imap
can be found in the dovecot
package, which is also included in Community Enterprise Linux. This package contains an IMAP server but does not, to date, support GSS-API and Kerberos.
gserver
uses a principal with a root of cvs
and is otherwise identical to the CVS pserver
.Domain-to-Realm Mapping
foo.example.com → EXAMPLE.COM
foo.hq.example.com → HQ.EXAMPLE.COMkrb5.conf
. For example:
[domain_realm]
.example.com = EXAMPLE.COM
example.com = EXAMPLE.COM
Setting Up Secondary KDCs
kadmind
(it is also your realm's admin server), and one or more KDCs (slave KDCs) keep read-only copies of the database and run kpropd
.
krb5.conf
and kdc.conf
files are copied to the slave KDC.
kadmin.local
from a root shell on the master KDC and use its add_principal
command to create a new entry for the master KDC's host service, and then use its ktadd
command to simultaneously set a random key for the service and store the random key in the master's default keytab file. This key will be used by the kprop
command to authenticate to the slave servers. You will only need to do this once, regardless of how many slave servers you install.
~]#
kadmin.local -r EXAMPLE.COM
Authenticating as principal root/admin@EXAMPLE.COM with password.
kadmin: add_principal -randkey host/masterkdc.example.com
Principal "host/host/masterkdc.example.com@EXAMPLE.COM" created.
kadmin: ktadd host/masterkdc.example.com
Entry for principal host/masterkdc.example.com with kvno 3, encryption type Triple DES cbc mode with \
HMAC/sha1 added to keytab WRFILE:/etc/krb5.keytab.
Entry for principal host/masterkdc.example.com with kvno 3, encryption type ArcFour with HMAC/md5 \
added to keytab WRFILE:/etc/krb5.keytab.
Entry for principal host/masterkdc.example.com with kvno 3, encryption type DES with HMAC/sha1 added \
to keytab WRFILE:/etc/krb5.keytab.
Entry for principal host/masterkdc.example.com with kvno 3, encryption type DES cbc mode with RSA-MD5 \
added to keytab WRFILE:/etc/krb5.keytab.
kadmin: quit
kadmin
from a root shell on the slave KDC and use its add_principal
command to create a new entry for the slave KDC's host service, and then use kadmin
's ktadd
command to simultaneously set a random key for the service and store the random key in the slave's default keytab file. This key is used by the kpropd
service when authenticating clients.
~]#
kadmin -p jimbo/admin@EXAMPLE.COM -r EXAMPLE.COM
Authenticating as principal jimbo/admin@EXAMPLE.COM with password.
Password for jimbo/admin@EXAMPLE.COM:
kadmin: add_principal -randkey host/slavekdc.example.com
Principal "host/slavekdc.example.com@EXAMPLE.COM" created.
kadmin: ktadd host/slavekdc.example.com@EXAMPLE.COM
Entry for principal host/slavekdc.example.com with kvno 3, encryption type Triple DES cbc mode with \
HMAC/sha1 added to keytab WRFILE:/etc/krb5.keytab.
Entry for principal host/slavekdc.example.com with kvno 3, encryption type ArcFour with HMAC/md5 added \
to keytab WRFILE:/etc/krb5.keytab.
Entry for principal host/slavekdc.example.com with kvno 3, encryption type DES with HMAC/sha1 added \
to keytab WRFILE:/etc/krb5.keytab.
Entry for principal host/slavekdc.example.com with kvno 3, encryption type DES cbc mode with RSA-MD5 added \
to keytab WRFILE:/etc/krb5.keytab.
kadmin: quit
kprop
service with a new realm database. To restrict access, the kprop
service on the slave KDC will only accept updates from clients whose principal names are listed in /var/kerberos/krb5kdc/kpropd.acl
. Add the master KDC's host service's name to that file.
~]#
echo host/masterkdc.example.com@EXAMPLE.COM > /var/kerberos/krb5kdc/kpropd.acl
/var/kerberos/krb5kdc/.k5.REALM
, either copy it to the slave KDC using any available secure method, or create a dummy database and identical stash file on the slave KDC by running kdb5_util create -s
(the dummy database will be overwritten by the first successful database propagation) and supplying the same password.
kprop
service. Then, double-check that the kadmin
service is disabled.
kprop
command will read (/var/kerberos/krb5kdc/slave_datatrans
), and then use the kprop
command to transmit its contents to the slave KDC.
~]#
/usr/kerberos/sbin/kdb5_util dump /var/kerberos/krb5kdc/slave_datatrans
~]# kprop slavekdc.example.com
kinit
, verify that a client system whose krb5.conf
lists only the slave KDC in its list of KDCs for your realm is now correctly able to obtain initial credentials from the slave KDC.
kprop
command to transmit the database to each slave KDC in turn, and configure the cron
service to run the script periodically.Setting Up Cross Realm Authentication
A.EXAMPLE.COM
to access a service in the B.EXAMPLE.COM
realm, both realms must share a key for a principal named krbtgt/B.EXAMPLE.COM@A.EXAMPLE.COM
, and both keys must have the same key version number associated with them.
~]#
kadmin -r A.EXAMPLE.COM
kadmin: add_principal krbtgt/B.EXAMPLE.COM@A.EXAMPLE.COM
Enter password for principal "krbtgt/B.EXAMPLE.COM@A.EXAMPLE.COM":
Re-enter password for principal "krbtgt/B.EXAMPLE.COM@A.EXAMPLE.COM":
Principal "krbtgt/B.EXAMPLE.COM@A.EXAMPLE.COM" created.
kadmin: quit
~]# kadmin -r B.EXAMPLE.COM
kadmin: add_principal krbtgt/B.EXAMPLE.COM@A.EXAMPLE.COM
Enter password for principal "krbtgt/B.EXAMPLE.COM@A.EXAMPLE.COM":
Re-enter password for principal "krbtgt/B.EXAMPLE.COM@A.EXAMPLE.COM":
Principal "krbtgt/B.EXAMPLE.COM@A.EXAMPLE.COM" created.
kadmin: quit
get_principal
command to verify that both entries have matching key version numbers (kvno
values) and encryption types.
Dumping the Database Doesn't Do It
add_principal
command's -randkey
option to assign a random key instead of a password, dump the new entry from the database of the first realm, and import it into the second. This will not work unless the master keys for the realm databases are identical, as the keys contained in a database dump are themselves encrypted using the master key.
A.EXAMPLE.COM
realm are now able to authenticate to services in the B.EXAMPLE.COM
realm. Put another way, the B.EXAMPLE.COM
realm now trusts the A.EXAMPLE.COM
realm, or phrased even more simply, B.EXAMPLE.COM
now trusts A.EXAMPLE.COM
.
B.EXAMPLE.COM
realm may trust clients from the A.EXAMPLE.COM
to authenticate to services in the B.EXAMPLE.COM
realm, but the fact that it does has no effect on whether or not clients in the B.EXAMPLE.COM
realm are trusted to authenticate to services in the A.EXAMPLE.COM
realm. To establish trust in the other direction, both realms would need to share keys for the krbtgt/A.EXAMPLE.COM@B.EXAMPLE.COM
service (take note of the reversed in order of the two realms compared to the example above).
A.EXAMPLE.COM
can authenticate to services in B.EXAMPLE.COM
, and clients from B.EXAMPLE.COM
can authenticate to services in C.EXAMPLE.COM
, then clients in A.EXAMPLE.COM
can also authenticate to services in C.EXAMPLE.COM
, even if C.EXAMPLE.COM
doesn't directly trust A.EXAMPLE.COM
. This means that, on a network with multiple realms which all need to trust each other, making good choices about which trust relationships to set up can greatly reduce the amount of effort required.
service/server.example.com@EXAMPLE.COM
EXAMPLE.COM
is the name of the realm.
domain_realm
section of /etc/krb5.conf
to map either a hostname (server.example.com) or a DNS domain name (.example.com) to the name of a realm (EXAMPLE.COM).
A.EXAMPLE.COM
, B.EXAMPLE.COM
, and EXAMPLE.COM
. When a client in the A.EXAMPLE.COM
realm attempts to authenticate to a service in B.EXAMPLE.COM
, it will, by default, first attempt to get credentials for the EXAMPLE.COM
realm, and then to use those credentials to obtain credentials for use in the B.EXAMPLE.COM
realm.
A.EXAMPLE.COM
, authenticating to a service in B.EXAMPLE.COM
:
A.EXAMPLE.COM
and EXAMPLE.COM
share a key for krbtgt/EXAMPLE.COM@A.EXAMPLE.COM
EXAMPLE.COM
and B.EXAMPLE.COM
share a key for krbtgt/B.EXAMPLE.COM@EXAMPLE.COM
SITE1.SALES.EXAMPLE.COM
, authenticating to a service in EVERYWHERE.EXAMPLE.COM
:
SITE1.SALES.EXAMPLE.COM
and SALES.EXAMPLE.COM
share a key for krbtgt/SALES.EXAMPLE.COM@SITE1.SALES.EXAMPLE.COM
SALES.EXAMPLE.COM
and EXAMPLE.COM
share a key for krbtgt/EXAMPLE.COM@SALES.EXAMPLE.COM
EXAMPLE.COM
and EVERYWHERE.EXAMPLE.COM
share a key for krbtgt/EVERYWHERE.EXAMPLE.COM@EXAMPLE.COM
DEVEL.EXAMPLE.COM
and PROD.EXAMPLE.ORG
):
DEVEL.EXAMPLE.COM
and EXAMPLE.COM
share a key for krbtgt/EXAMPLE.COM@DEVEL.EXAMPLE.COM
EXAMPLE.COM
and COM
share a key for krbtgt/COM@EXAMPLE.COM
COM
and ORG
share a key for krbtgt/ORG@COM
ORG
and EXAMPLE.ORG
share a key for krbtgt/EXAMPLE.ORG@ORG
EXAMPLE.ORG
and PROD.EXAMPLE.ORG
share a key for krbtgt/PROD.EXAMPLE.ORG@EXAMPLE.ORG
capaths
section of /etc/krb5.conf
, so that clients which have credentials for one realm will be able to look up which realm is next in the chain which will eventually lead to the being able to authenticate to servers.
capaths
section is relatively straightforward: each entry in the section is named after a realm in which a client might exist. Inside of that subsection, the set of intermediate realms from which the client must obtain credentials is listed as values of the key which corresponds to the realm in which a service might reside. If there are no intermediate realms, the value "." is used.
[capaths]
A.EXAMPLE.COM = {
B.EXAMPLE.COM = .
C.EXAMPLE.COM = B.EXAMPLE.COM
D.EXAMPLE.COM = B.EXAMPLE.COM
D.EXAMPLE.COM = C.EXAMPLE.COM
}
A.EXAMPLE.COM
realm can obtain cross-realm credentials for B.EXAMPLE.COM
directly from the A.EXAMPLE.COM
KDC.
C.EXAMPLE.COM
realm, they will first need to obtain necessary credentials from the B.EXAMPLE.COM
realm (this requires that krbtgt/B.EXAMPLE.COM@A.EXAMPLE.COM
exist), and then use those
credentials to obtain credentials for use in the C.EXAMPLE.COM
realm (using krbtgt/C.EXAMPLE.COM@B.EXAMPLE.COM
).
D.EXAMPLE.COM
realm, they will first need to obtain necessary credentials from the B.EXAMPLE.COM
realm, and then credentials from the C.EXAMPLE.COM
realm, before finally obtaining credentials for use with the D.EXAMPLE.COM
realm.
A.EXAMPLE.COM
realm can obtain cross-realm credentials from B.EXAMPLE.COM
realm directly. Without the "." indicating this, the client would instead attempt to use a hierarchical path, in this case:
Additional Resources
Installed Documentation
/usr/share/doc/krb5-server-
directory (where <version-number>
/<version-number>
is the version number of the krb5-server
package installed on your system).
/usr/share/doc/krb5-workstation-
directory (where <version-number>
/<version-number>
is the version number of the krb5-workstation
package installed on your system).
man kerberos
- An introduction to the Kerberos system which describes how credentials work and provides recommendations for obtaining and destroying Kerberos tickets. The bottom of the man page references a number of related man pages.man kinit
- Describes how to use this command to obtain and cache a ticket-granting ticket.
man kdestroy
- Describes how to use this command to destroy Kerberos credentials.
man klist
- Describes how to use this command to list cached Kerberos credentials.
man kadmin
- Describes how to use this command to administer the Kerberos V5 database.
man kdb5_util
- Describes how to use this command to create and perform low-level administrative functions on the Kerberos V5 database.
man krb5kdc
- Describes available command line options for the Kerberos V5 KDC.
man kadmind
- Describes available command line options for the Kerberos V5 administration server.
man krb5.conf
- Describes the format and options available within the configuration file for the Kerberos V5 library.
man kdc.conf
- Describes the format and options available within the configuration file for the Kerberos V5 AS and KDC.Useful Websites