Copyright © 1985-2007 by the Massachusetts Institute of Technology.
Export of software employing encryption from the United States of America may require a specific license from the United States Government. It is the responsibility of any person or organization contemplating export to obtain such a license before exporting.
WITHIN THAT CONSTRAINT, permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of M.I.T. not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. Furthermore if you modify this software you must label your software as modified software and not distribute it in such a fashion that it might be confused with the original MIT software. M.I.T. makes no representations about the suitability of this software for any purpose. It is provided “as is” without express or implied warranty.
Individual source code files are copyright MIT, Cygnus Support, Novell, OpenVision Technologies, Oracle, Red Hat, Sun Microsystems, FundsXpress, and others.
Project Athena, Athena, Athena MUSE, Discuss, Hesiod, Kerberos, Moira, and Zephyr are trademarks of the Massachusetts Institute of Technology (MIT). No commercial use of these trademarks may be made without prior written permission of MIT.
“Commercial use” means use of a name in a product or other for-profit manner. It does NOT prevent a commercial firm from referring to the MIT trademarks in order to convey information (although in doing so, recognition of their trademark status should be given).
The following copyright and permission notice applies to the
OpenVision Kerberos Administration system located in
kadmin/create
, kadmin/dbutil
, kadmin/passwd
,
kadmin/server
, lib/kadm5
, and portions of
lib/rpc
:
Copyright, OpenVision Technologies, Inc., 1996, All Rights ReservedWARNING: Retrieving the OpenVision Kerberos Administration system source code, as described below, indicates your acceptance of the following terms. If you do not agree to the following terms, do not retrieve the OpenVision Kerberos administration system.
You may freely use and distribute the Source Code and Object Code compiled from it, with or without modification, but this Source Code is provided to you “AS IS” EXCLUSIVE OF ANY WARRANTY, INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, OR ANY OTHER WARRANTY, WHETHER EXPRESS OR IMPLIED. IN NO EVENT WILL OPENVISION HAVE ANY LIABILITY FOR ANY LOST PROFITS, LOSS OF DATA OR COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY SPECIAL, INDIRECT, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, INCLUDING, WITHOUT LIMITATION, THOSE RESULTING FROM THE USE OF THE SOURCE CODE, OR THE FAILURE OF THE SOURCE CODE TO PERFORM, OR FOR ANY OTHER REASON.
OpenVision retains all copyrights in the donated Source Code. OpenVision also retains copyright to derivative works of the Source Code, whether created by OpenVision or by a third party. The OpenVision copyright notice must be preserved if derivative works are made based on the donated Source Code.
OpenVision Technologies, Inc. has donated this Kerberos Administration system to MIT for inclusion in the standard Kerberos 5 distribution. This donation underscores our commitment to continuing Kerberos technology development and our gratitude for the valuable work which has been performed by MIT and the Kerberos community.
Portions contributed by Matt Crawford <crawdad@fnal.gov>
were work
performed at Fermi National Accelerator Laboratory, which is operated
by Universities Research Association, Inc., under contract
DE-AC02-76CHO3000 with the U.S. Department of Energy.
Portions of src/lib/crypto
have the following copyright:
Copyright © 1998 by the FundsXpress, INC.All rights reserved.
Export of this software from the United States of America may require a specific license from the United States Government. It is the responsibility of any person or organization contemplating export to obtain such a license before exporting.
WITHIN THAT CONSTRAINT, permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of FundsXpress. not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. FundsXpress makes no representations about the suitability of this software for any purpose. It is provided “as is” without express or implied warranty.
THIS SOFTWARE IS PROVIDED “AS IS” AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
The implementation of the Yarrow pseudo-random number generator
in src/lib/crypto/yarrow
has the following copyright:
Copyright 2000 by Zero-Knowledge Systems, Inc.Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Zero-Knowledge Systems, Inc. not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. Zero-Knowledge Systems, Inc. makes no representations about the suitability of this software for any purpose. It is provided “as is” without express or implied warranty.
ZERO-KNOWLEDGE SYSTEMS, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL ZERO-KNOWLEDGE SYSTEMS, INC. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
The implementation of the AES encryption algorithm in
src/lib/crypto/aes
has the following copyright:
Copyright © 2001, Dr Brian Gladman<brg@gladman.uk.net>
, Worcester, UK.
All rights reserved.LICENSE TERMS
The free distribution and use of this software in both source and binary form is allowed (with or without changes) provided that:
- distributions of this source code include the above copyright notice, this list of conditions and the following disclaimer;
- distributions in binary form include the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other associated materials;
- the copyright holder's name is not used to endorse products built using this software without specific written permission.
DISCLAIMER
This software is provided 'as is' with no explcit or implied warranties in respect of any properties, including, but not limited to, correctness and fitness for purpose.
Portions contributed by Red Hat, including the pre-authentication plug-in framework, contain the following copyright:
Copyright © 2006 Red Hat, Inc.
Portions copyright © 2006 Massachusetts Institute of Technology
All Rights Reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of Red Hat, Inc., nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
The implementations of GSSAPI mechglue in GSSAPI-SPNEGO in
src/lib/gssapi
, including the following files:
lib/gssapi/generic/gssapi_err_generic.et lib/gssapi/mechglue/g_accept_sec_context.c lib/gssapi/mechglue/g_acquire_cred.c lib/gssapi/mechglue/g_canon_name.c lib/gssapi/mechglue/g_compare_name.c lib/gssapi/mechglue/g_context_time.c lib/gssapi/mechglue/g_delete_sec_context.c lib/gssapi/mechglue/g_dsp_name.c lib/gssapi/mechglue/g_dsp_status.c lib/gssapi/mechglue/g_dup_name.c lib/gssapi/mechglue/g_exp_sec_context.c lib/gssapi/mechglue/g_export_name.c lib/gssapi/mechglue/g_glue.c lib/gssapi/mechglue/g_imp_name.c lib/gssapi/mechglue/g_imp_sec_context.c lib/gssapi/mechglue/g_init_sec_context.c lib/gssapi/mechglue/g_initialize.c lib/gssapi/mechglue/g_inquire_context.c lib/gssapi/mechglue/g_inquire_cred.c lib/gssapi/mechglue/g_inquire_names.c lib/gssapi/mechglue/g_process_context.c lib/gssapi/mechglue/g_rel_buffer.c lib/gssapi/mechglue/g_rel_cred.c lib/gssapi/mechglue/g_rel_name.c lib/gssapi/mechglue/g_rel_oid_set.c lib/gssapi/mechglue/g_seal.c lib/gssapi/mechglue/g_sign.c lib/gssapi/mechglue/g_store_cred.c lib/gssapi/mechglue/g_unseal.c lib/gssapi/mechglue/g_userok.c lib/gssapi/mechglue/g_utils.c lib/gssapi/mechglue/g_verify.c lib/gssapi/mechglue/gssd_pname_to_uid.c lib/gssapi/mechglue/mglueP.h lib/gssapi/mechglue/oid_ops.c lib/gssapi/spnego/gssapiP_spnego.h lib/gssapi/spnego/spnego_mech.c
are subject to the following license:
Copyright © 2004 Sun Microsystems, Inc.Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Kerberos V5 includes documentation and software developed at the University of California at Berkeley, which includes this copyright notice:
Copyright © 1983 Regents of the University of California.
All rights reserved.Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of the University nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Portions contributed by Novell, Inc., including the LDAP database backend, are subject to the following license:
Copyright (c) 2004-2005, Novell, Inc. All rights reserved.Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- The copyright holder's name is not used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Permission is granted to make and distribute verbatim copies of this manual provided the copyright notices and this permission notice are preserved on all copies.
Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided also that the entire resulting derived work is distributed under the terms of a permission notice identical to this one.
Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions.
Since Kerberos negotiates authenticated, and optionally encrypted, communications between two points anywhere on the internet, it provides a layer of security that is not dependent on which side of a firewall either client is on. Since studies have shown that half of the computer security breaches in industry happen from inside firewalls, Kerberos V5 from MIT will play a vital role in the security of your network.
This document is one piece of the document set for Kerberos V5. The documents, and their intended audiences, are:
The next chapter describes how Kerberos works.
Chapter three describes administration of the principals in the Kerberos database.
Chapter four describes how you can use DNS in configuring your Kerberos realm.
Chapter five describes administrative programs for manipulating the Kerberos database as a whole.
Chapter six describes OpenLDAP Configuration steps.
Chapter seven describes issues to consider when adding an application server to the database.
Chapter eight describes our problem reporting system.
The appendices include the list of Kerberos error messages, and a
complete list of the time zones understood by kadmin
.
This section provides a simplified description of a general user's
interaction with the Kerberos system. This interaction happens
transparently—users don't need to know and probably don't care about
what's going on—but Kerberos administrators might find a schematic
description of the process useful. This description glosses over a lot
of details; for more information, see Kerberos: An Authentication
Service for Open Network Systems, a paper presented at Winter USENIX
1988, in Dallas, Texas. This paper can be retreived by FTP from
athena-dist.mit.edu
, in the location:
/pub/ATHENA/kerberos/doc/usenix.PS
.
In an environment that provides network services, you use client programs to request services from server programs that are somewhere on the network. Suppose you have logged in to a workstation and you want to rlogin to a typical UNIX host. You use the local rlogin client program to contact the remote machine's rlogind daemon.
Under Kerberos, the klogind daemon allows you to login to a remote machine if you can provide klogind a Kerberos ticket which proves your identity. In addition to the ticket, you must also have possession of the corresponding ticket session key. The combination of a ticket and the ticket's session key is known as a credential.
Typically, a client program automatically obtains credentials identifying the person using the client program. The credentials are obtained from a Kerberos server that resides somewhere on the network. A Kerberos server maintains a database of user, server, and password information.
Kerberos will give you credentials only if you have an entry in the Kerberos server's Kerberos database. Your database entry includes your Kerberos principal (an identifying string, which is often just your username), and your Kerberos password. Every Kerberos user must have an entry in this database.
Each administrative domain will have its own Kerberos database, which contains information about the users and services for that particular site or administrative domain. This administrative domain is the Kerberos realm.
Each Kerberos realm will have at least one Kerberos server, where the master Kerberos database for that site or administrative domain is stored. A Kerberos realm may also have one or more slave servers, which have read-only copies of the Kerberos database that are periodically propagated from the master server. For more details on how this is done, see the “Set Up the Slave KDCs for Database Propagation” and “Propagate the Database to Each Slave KDC” sections of the Kerberos V5 Installation Guide.
The kinit command prompts for your password. If you enter it successfully, you will obtain a ticket-granting ticket and a ticket session key which gives you the right to use the ticket. This combination of the ticket and its associated key is known as your credentials. As illustrated below, client programs use your ticket-granting ticket credentials in order to obtain client-specific credentials as needed.
Your credentials are stored in a credentials cache, which is often
just a file in /tmp
. The credentials cache is also called the
ticket file, especially in Kerberos V4 documentation. Note,
however, that a credentials cache does not have to be stored in a file.
The master database also contains entries for all network services that require Kerberos authentication. Suppose that your site has a machine, laughter.mit.edu, that requires Kerberos authentication from anyone who wants to rlogin to it. The host's Kerberos realm is ATHENA.MIT.EDU.
This service must be registered in the Kerberos database, using the proper service name, which in this case is the principal:
host/laughter.mit.edu@ATHENA.MIT.EDU
The / character separates the Kerberos primary (in this case, host) from the instance (in this case, laughter.mit.edu); the @ character separates the realm name (in this case, ATHENA.MIT.EDU) from the rest of the principal. The primary, host, denotes the name or type of the service that is being offered: generic host-level access to the machine. The instance, laughter.mit.edu, names the specific machine that is offering this service. There will generally be many different machines, each offering one particular type of service, and the instance serves to give each one of these servers a different Kerberos principal.
For each service, there must also be a service key known only by Kerberos and the service. On the Kerberos server, the service key is stored in the Kerberos database.
On the server host, these service keys are stored in key tables,
which are files known as keytabs.1 For example, the service keys used by
services that run as root are usually stored in the keytab file
/etc/krb5.keytab
. N.B.: This service key is the equivalent
of the service's password, and must be kept secure. Data which is meant
to be read only by the service is encrypted using this key.
Suppose that you walk up to a host intending to login to it, and then rlogin to the machine laughter. Here's what happens:
host% rlogin laughter
klogind
will let you
login.
Following are definitions of some of the Kerberos terminology.
The typical format of a typical Kerberos principal is
primary/instance@REALM.
telnet
and
rsh
), “ftp” (FTP), “krbtgt” (authentication;
cf. ticket-granting ticket), and “pop” (email).
Any tag in the configuration files which requires a list of encryption types can be set to some combination of the following strings.
des-cbc-crc
des-cbc-md4
des-cbc-md5
des3-cbc-sha1
des3-hmac-sha1
des3-cbc-sha1-kd
des-hmac-sha1
aes256-cts-hmac-sha1-96
aes256-cts
aes128-cts-hmac-sha1-96
aes128-cts
arcfour-hmac
rc4-hmac
arcfour-hmac-md5
arcfour-hmac-exp
rc4-hmac-exp
arcfour-hmac-md5-exp
While aes128-cts and aes256-cts are supported for all Kerberos operations, they are not supported by older versions of our GSSAPI implementation (krb5-1.3.1 and earlier).
By default, AES is enabled in this release. Sites wishing to use AES encryption types on their KDCs need to be careful not to give GSSAPI services AES keys if the servers have not been updated. If older GSSAPI services are given AES keys, then services may fail when clients supporting AES for GSSAPI are used. Sites may wish to use AES for user keys and for the ticket granting ticket key, although doing so requires specifying what encryption types are used as each principal is created.
If all GSSAPI-based services have been updated before or with the KDC, this is not an issue.
Your Kerberos key is derived from your password. To ensure that people who happen to pick the same password do not have the same key, Kerberos 5 incorporates more information into the key using something called a salt. The supported values for salts are as follows.
normal
v4
norealm
onlyrealm
afs3
special
The krb5.conf
file contains Kerberos configuration information,
including the locations of KDCs and admin servers for the Kerberos
realms of interest, defaults for the current realm and for Kerberos
applications, and mappings of hostnames onto Kerberos realms. Normally,
you should install your krb5.conf
file in the directory
/etc
. You can override the default location by setting the
environment variable KRB5_CONFIG.
The krb5.conf
file is set up in the style of a Windows INI file.
Sections are headed by the section name, in square brackets. Each
section may contain zero or more relations, of the form:
foo = bar
or
fubar = { foo = bar baz = quux }
Placing a `*' at the end of a line indicates that this is the final value for the tag. This means that neither the remainder of this configuration file nor any other configuration file will be checked for any other values for this tag.
For example, if you have the following lines:
foo = bar* foo = baz
then the second value of foo (baz) would never be read.
The krb5.conf
file may contain any or all of the following
sections:
The libdefaults
section may contain any of the following
relations:
Enabling this option does open up a type of denial-of-service attack, if someone spoofs the DNS records and redirects you to another server. However, it's no worse than a denial of service, because that fake KDC will be unable to decode anything you send it (besides the initial ticket request, which has no encrypted data), and anything the fake KDC sends will not be trusted without verification using some secret that it won't know.
If this option is not specified but dns_fallback is, that value will be used instead. If neither option is specified, the behavior depends on configure-time options; if none were given, the default is to enable this option. If the DNS support is not compiled in, this entry has no effect.
Enabling this option may permit a redirection attack, where spoofed DNS replies persuade a client to authenticate to the wrong realm, when talking to the wrong host (either by spoofing yet more DNS records or by intercepting the net traffic). Depending on how the client software manages hostnames, however, it could already be vulnerable to such attacks. We are looking at possible ways to minimize or eliminate this exposure. For now, we encourage more adventurous sites to try using Secure DNS.
If this option is not specified but dns_fallback is, that value will be used instead. If neither option is specified, the behavior depends on configure-time options; if none were given, the default is to disable this option. If the DNS support is not compiled in, this entry has no effect.
udp_preference_list
.
If the message is smaller than udp_preference_list
, then UDP
will be tried before TCP. Regardless of the size, both protocols will
be tried if the first attempt fails.
Each tag in the [appdefaults] section names a Kerberos V5 application or an option that is used by some Kerberos V5 application[s]. The value of the tag defines the default behaviors for that application.
For example:
[appdefaults] telnet = { ATHENA.MIT.EDU = { option1 = false } } telnet = { option1 = true option2 = true } ATHENA.MIT.EDU = { option2 = false } option2 = true
The above four ways of specifying the value of an option are shown in order of decreasing precedence. In this example, if telnet is running in the realm EXAMPLE.COM, it should, by default, have option1 and option2 set to true. However, a telnet program in the realm ATHENA.MIT.EDU should have option1 set to false and option2 set to true. Any other programs in ATHENA.MIT.EDU should have option2 set to false by default. Any programs running in other realms should have option2 set to true.
The list of specifiable options for each application may be found in that application's man pages. The application defaults specified here are overridden by those specified in the [realms] section.
A special application name (afs_krb5) is used by the krb524 service to
know whether new format AFS tokens based on Kerberos 5 can be used
rather than the older format which used a converted Kerberos 4 ticket.
The new format allows for cross-realm authentication without
introducing a security hole. It is used by default. Older AFS
servers (before OpenAFS 1.2.8) will not support the new format. If
servers in your cell do not support the new format, you will need to
add an afs_krb5
relation to the appdefaults
section.
The following config file shows how to disable new format AFS tickets
for the afs.example.com
cell in the EXAMPLE.COM
realm.
[appdefaults] afs_krb5 = { EXAMPLE.COM = { afs/afs.example.com = false } }
Each tag in the [login] section of the file is an option for login.krb5. This section may contain any of the following relations:
Each tag in the [realms] section of the file is the name of a Kerberos realm. The value of the tag is a subsection with relations that define the properties of that particular realm. For each realm, the following tags may be specified in the realm's subsection:
The format for exp is
[
n:$
d..
string](
regexp)s/
pattern/
replacement/g
.
The integer n indicates how many components the target principal
should have. If this matches, then a string will be formed by putting
together the components of the principal in the order indicated by each
integer d, and the arbitrary string string (i.e. if the
principal was johndoe/admin then [2:$2$1foo] would result in
the string "adminjohndoefoo". If this string matches
regexp, then the s//[g]
substitution command will be run over the
string. The optional g will cause the substitution to be global over
the string, instead of replacing only the first match in the string.
For example:
[realms] ATHENA.MIT.EDU = { auth_to_local = { RULE:[2:$1](johndoe)s/^.*$/guest/ RULE:[2:$1;$2](^.*;admin$)s/;admin$// RULE:[2:$2](^.*;root)s/^.*$/root/ DEFAULT } }
would result in any principal without root
or admin
as
the second component to be translated with the default rule. A
principal with a second component of admin
will become its first
component. root
will be used as the local name for any
principal with a second component of root
. The exception to
these two rules are any principals johndoe/*, which will
always get the local name guest
.
The [domain_realm] section provides a translation from a domain name or hostname to a Kerberos realm name. The tag name can be a host name, or a domain name, where domain names are indicated by a prefix of a period (.). The value of the relation is the Kerberos realm name for that particular host or domain. Host names and domain names should be in lower case.
If no translation entry applies, the host's realm is considered to be the hostname's domain portion converted to upper case. For example, the following [domain_realm] section:
[domain_realm] .mit.edu = ATHENA.MIT.EDU mit.edu = ATHENA.MIT.EDU crash.mit.edu = TEST.ATHENA.MIT.EDU example.com = EXAMPLE.COM
maps crash.mit.edu into the TEST.ATHENA.MIT.EDU realm. All other hosts in the mit.edu domain will map by default to the ATHENA.MIT.EDU realm, and all hosts in the example.com domain will map by default into the EXAMPLE.COM realm. Note the entries for the hosts mit.edu and example.com. Without these entries, these hosts would be mapped into the Kerberos realms EDU and ORG, respectively.
The [logging] section indicates how a particular entity is to perform its logging. The relations in this section assign one or more values to the entity name. Currently, the following entities are used:
Values are of the following forms:
The severity argument specifies the default severity of system log
messages. This may be any of the following severities supported by the
syslog(3)
call, minus the LOG_ prefix: LOG_EMERG, LOG_ALERT,
LOG_CRIT, LOG_ERR, LOG_WARNING, LOG_NOTICE, LOG_INFO, and LOG_DEBUG.
For example, a value of CRIT would specify LOG_CRIT severity.
The facility argument specifies the facility under which the messages are logged. This may be any of the following facilities supported by the syslog(3) call minus the LOG_ prefix: LOG_KERN, LOG_USER, LOG_MAIL, LOG_DAEMON, LOG_AUTH, LOG_LPR, LOG_NEWS, LOG_UUCP, LOG_CRON, and LOG_LOCAL0 through LOG_LOCAL7.
If no severity is specified, the default is ERR. If no facility is specified, the default is AUTH.
In the following example, the logging messages from the KDC will go to the console and to the system log under the facility LOG_DAEMON with default severity of LOG_INFO; and the logging messages from the administrative server will be appended to the file /var/adm/kadmin.log and sent to the device /dev/tty04.
[logging] kdc = CONSOLE kdc = SYSLOG:INFO:DAEMON admin_server = FILE:/var/adm/kadmin.log admin_server = DEVICE=/dev/tty04
In order to perform direct (non-hierarchical) cross-realm authentication, a database is needed to construct the authentication paths between the realms. This section defines that database.
A client will use this section to find the authentication path between its realm and the realm of the server. The server will use this section to verify the authentication path used by the client, by checking the transited field of the received ticket.
There is a tag for each participating realm, and each tag has subtags for each of the realms. The value of the subtags is an intermediate realm which may participate in the cross-realm authentication. The subtags may be repeated if there is more then one intermediate realm. A value of "." means that the two realms share keys directly, and no intermediate realms should be allowed to participate.
There are n**2 possible entries in this table, but only those entries which will be needed on the client or the server need to be present. The client needs a tag for its local realm, with subtags for all the realms of servers it will need to authenticate with. A server needs a tag for each realm of the clients it will serve.
For example, ANL.GOV, PNL.GOV, and NERSC.GOV all wish to use the ES.NET realm as an intermediate realm. ANL has a sub realm of TEST.ANL.GOV which will authenticate with NERSC.GOV but not PNL.GOV. The [capaths] section for ANL.GOV systems would look like this:
[capaths] ANL.GOV = { TEST.ANL.GOV = . PNL.GOV = ES.NET NERSC.GOV = ES.NET ES.NET = . } TEST.ANL.GOV = { ANL.GOV = . } PNL.GOV = { ANL.GOV = ES.NET } NERSC.GOV = { ANL.GOV = ES.NET } ES.NET = { ANL.GOV = . }
The [capaths] section of the configuration file used on NERSC.GOV systems would look like this:
[capaths] NERSC.GOV = { ANL.GOV = ES.NET TEST.ANL.GOV = ES.NET TEST.ANL.GOV = ANL.GOV PNL.GOV = ES.NET ES.NET = . } ANL.GOV = { NERSC.GOV = ES.NET } PNL.GOV = { NERSC.GOV = ES.NET } ES.NET = { NERSC.GOV = . } TEST.ANL.GOV = { NERSC.GOV = ANL.GOV NERSC.GOV = ES.NET }
In the above examples, the ordering is not important, except when the same subtag name is used more then once. The client will use this to determine the path. (It is not important to the server, since the transited field is not sorted.)
This feature is not currently supported by DCE. DCE security servers can be used with Kerberized clients and servers, but versions prior to DCE 1.1 did not fill in the transited field, and should be used with caution.
The [dbdefaults] section provides default values for the database specific parameters. It can also specify the configuration section under [dbmodules] section for database specific parameters used by the database library.(see dbmodules).
The following tags are used in this section:
Contains database specific parameters used by the database library. Each tag in the [dbmodules] section of the file names a configuration section for database specific parameters that can be referred to by a realm. The value of the tag is a subsection where the relations in that subsection define the database specific parameters.
For each section, the following tags may be specified in the subsection:
Here is an example of a generic krb5.conf
file:
[libdefaults] default_realm = ATHENA.MIT.EDU default_tkt_enctypes = des3-hmac-sha1 des-cbc-crc default_tgs_enctypes = des3-hmac-sha1 des-cbc-crc dns_lookup_kdc = true dns_lookup_realm = false [realms] ATHENA.MIT.EDU = { kdc = kerberos.mit.edu kdc = kerberos-1.mit.edu kdc = kerberos-2.mit.edu:750 admin_server = kerberos.mit.edu master_kdc = kerberos.mit.edu default_domain = mit.edu } EXAMPLE.COM = { kdc = kerberos.example.com kdc = kerberos-1.example.com admin_server = kerberos.example.com } OPENLDAP.MIT.EDU = { kdc = kerberos.mit.edu admin_server = kerberos.mit.edu database_module = openldap_ldapconf } [domain_realm] .mit.edu = ATHENA.MIT.EDU mit.edu = ATHENA.MIT.EDU [capaths] ATHENA.MIT.EDU = { EXAMPLE.COM = . } EXAMPLE.COM = { ATHENA.MIT.EDU = . } [logging] kdc = SYSLOG:INFO admin_server = FILE=/var/kadm5.log [dbdefaults] ldap_kerberos_container_dn = cn=krbcontainer,o=mit [dbmodules] openldap_ldapconf = { db_library = kldap ldap_kerberos_container_dn = cn=krbcontainer,o=mit ldap_kdc_dn = "cn=krbadmin,o=mit" # this object needs to have read rights on # the realm container, principal container and realm sub-trees ldap_kadmind_dn = "cn=krbadmin,o=mit" # this object needs to have read and write rights on # the realm container, principal container and realm sub-trees ldap_service_password_file = /etc/kerberos/service.keyfile ldap_servers = ldaps://kerberos.mit.edu ldap_conns_per_server = 5 }
The kdc.conf
file contains KDC configuration information,
including defaults used when issuing Kerberos tickets. Normally, you
should install your kdc.conf
file in the directory
/usr/local/var/krb5kdc
. You can override the default
location by setting the environment variable KRB5_KDC_PROFILE.
The kdc.conf
file is set up in the same format as the
krb5.conf
file. (See krb5.conf.) The kdc.conf
file
may contain any or all of the following three sections:
The following relation is defined in the [kdcdefaults] section:
If you wish to change this (which we do not recommend, because the current implementation has little protection against denial-of-service attacks), the standard port number assigned for Kerberos TCP traffic is port 88.
Each tag in the [realms] section of the file names a Kerberos realm. The value of the tag is a subsection where the relations in that subsection define KDC parameters for that particular realm.
For each realm, the following tags may be specified in the [realms] subsection:
/usr/local/var/krb5kdc/kadm5.acl
.
kadmind4
and v5passwdd
use to authenticate to
the database. The default is /usr/local/var/krb5kdc/kadm5.keytab
.
/usr/local/var/krb5kdc/principal
.
There are a number of possible flags:
kdb5_util stash
). The default is
/usr/local/var/krb5kdc/.k5.
REALM, where REALM is the
Kerberos realm.
kadmin
will have keys of these types. The default value for this tag is
des3-hmac-sha1:normal des-cbc-crc:normal. For lists of possible values, see
Supported Encryption Types and Salts.
true
, false
). If set to true
, the
KDC will check the list of transited realms for cross-realm tickets
against the transit path computed from the realm names and the
capaths
section of its krb5.conf
file; if the path in the
ticket to be issued contains any realms not in the computed path, the
ticket will not be issued, and an error will be returned to the client
instead. If this value is set to false
, such tickets will be
issued anyways, and it will be left up to the application server to
validate the realm transit path.
If the disable-transited-check
flag is set in the incoming
request, this check is not performed at all. Having the
reject_bad_transit
option will cause such ticket requests to be
rejected always.
This transit path checking and config file option currently apply only to TGS requests.
Earlier versions of the MIT release (before 1.2.3) had bugs in the application server support such that the server-side checks may not be performed correctly. We recommend turning this option on, unless you know that all application servers in this realm have been updated to fixed versions of the software, and for whatever reason, you don't want the KDC to do the validation.
This is a per-realm option so that multiple-realm KDCs may control it separately for each realm, in case (for example) one realm has had the software on its application servers updated but another has not.
This option defaults to true
.
Here's an example of a kdc.conf
file:
[kdcdefaults] kdc_ports = 88 [realms] ATHENA.MIT.EDU = { kadmind_port = 749 max_life = 12h 0m 0s max_renewable_life = 7d 0h 0m 0s master_key_type = des3-hmac-sha1 supported_enctypes = des3-hmac-sha1:normal des-cbc-crc:normal des-cbc-crc:v4 } [logging] kdc = FILE:/usr/local/var/krb5kdc/kdc.log admin_server = FILE:/usr/local/var/krb5kdc/kadmin.log
Mapping hostnames onto Kerberos realms is done in one of two ways.
The first mechanism, which has been in use for years in MIT-based
Kerberos distributions, works through a set of rules in
the krb5.conf
configuration file. (See krb5.conf.) You can
specify mappings for an entire domain or subdomain, and/or on a
hostname-by-hostname basis. Since greater specificity takes precedence,
you would do this by specifying the mappings for a given domain or
subdomain and listing the exceptions.
The second mechanism works by looking up the information in special
TXT
records in the Domain Name Service. This is currently not
used by default because security holes could result if the DNS TXT
records were spoofed. If this mechanism is enabled on the client,
it will try to look up a TXT
record for the DNS name formed by
putting the prefix _kerberos
in front of the hostname in question.
If that record is not found, it will try using _kerberos
and the
host's domain name, then its parent domain, and so forth. So for the
hostname BOSTON.ENGINEERING.FOOBAR.COM, the names looked up would be:
_kerberos.boston.engineering.foobar.com _kerberos.engineering.foobar.com _kerberos.foobar.com _kerberos.com
The value of the first TXT record found is taken as the realm name. (Obviously, this doesn't work all that well if a host and a subdomain have the same name, and different realms. For example, if all the hosts in the ENGINEERING.FOOBAR.COM domain are in the ENGINEERING.FOOBAR.COM realm, but a host named ENGINEERING.FOOBAR.COM is for some reason in another realm. In that case, you would set up TXT records for all hosts, rather than relying on the fallback to the domain name.)
Even if you do not choose to use this mechanism within your site, you may wish to set it up anyway, for use when interacting with other sites.
MIT recommends that your KDCs have a predefined set of
CNAME records (DNS hostname aliases), such as kerberos
for the master KDC and
kerberos-1
, kerberos-2
, ... for the
slave KDCs. This way, if you need to swap a machine, you only need to
change a DNS entry, rather than having to change hostnames.
A new mechanism for locating KDCs of a realm through DNS has been added
to the MIT Kerberos V5 distribution. A relatively new
record type called SRV
has been added to DNS. Looked up by a
service name and a domain name, these records indicate the hostname and
port number to contact for that service, optionally with weighting and
prioritization. (See RFC 2782 if you want more information. You can
follow the example below for straightforward cases.)
The use with Kerberos is fairly straightforward. The domain name used in the SRV record name is the domain-style Kerberos realm name. (It is possible to have Kerberos realm names that are not DNS-style names, but we don't recommend it for Internet use, and our code does not support it well.) Several different Kerberos-related service names are used:
_kerberos._udp
_kerberos._tcp
_kerberos-master._udp
If you have only one KDC, or for whatever reason there is no accessible
KDC that would get database changes faster than the others, you do not
need to define this entry.
_kerberos-adm._tcp
kadmin
program and related utilities. For now, you
will also need the admin_server
entry in krb5.conf
.
(See krb5.conf.)
_kpasswd._udp
_kerberos-iv._udp
Be aware, however, that the DNS SRV specification requires that the hostnames listed be the canonical names, not aliases. So, for example, you might include the following records in your (BIND-style) zone file:
$ORIGIN foobar.com. _kerberos TXT "FOOBAR.COM" kerberos CNAME daisy kerberos-1 CNAME use-the-force-luke kerberos-2 CNAME bunny-rabbit _kerberos._udp SRV 0 0 88 daisy SRV 0 0 88 use-the-force-luke SRV 0 0 88 bunny-rabbit _kerberos-master._udp SRV 0 0 88 daisy _kerberos-adm._tcp SRV 0 0 749 daisy _kpasswd._udp SRV 0 0 464 daisy
As with the DNS-based mechanism for determining the Kerberos realm of a
host, we recommend distributing the information this way for use by
other sites that may want to interact with yours using Kerberos, even if
you don't immediately make use of it within your own site. If you
anticipate installing a very large number of machines on which it will
be hard to update the Kerberos configuration files, you may wish to do
all of your Kerberos service lookups via DNS and not put the information
(except for admin_server
as noted above) in future versions of
your krb5.conf
files at all. Eventually, we hope to phase out
the listing of server hostnames in the client-side configuration files;
making preparations now will make the transition easier in the future.
Your Kerberos database contains all of your realm's Kerberos principals,
their passwords, and other administrative information about each
principal. For the most part, you will use the kdb5_util
program
to manipulate the Kerberos database as a whole, and the kadmin
program to make changes to the entries in the database. (One notable
exception is that users will use the kpasswd
program to change
their own passwords.) The kadmin
program has its own
command-line interface, to which you type the database administrating
commands.
Kdb5_util
provides a means to create, delete, load, or dump a
Kerberos database. It also includes a command to stash a copy of the
master database key in a file on a KDC, so that the KDC can authenticate
itself to the kadmind
and krb5kdc
daemons at boot time.
Kadmin
provides for the maintenance of Kerberos principals, KADM5
policies, and service key tables (keytabs). It exists as both a
Kerberos client, kadmin
, using Kerberos authentication and an
RPC, to operate securely from anywhere on the network, and as a local
client, kadmin.local
, intended to run directly on the KDC without
Kerberos authentication. kadmin.local
need not run on the kdc if
the database is LDAP. Other than the fact that the remote client uses
Kerberos to authenticate the person using it, the functionalities of the two
versions are identical. The local version is necessary to enable you to set up
enough of the database to be able to use the remote version.
It replaces the now obsolete kdb5_edit
(except for
database dump and load, which are provided by kdb5_util
).
The remote version authenticates to the KADM5 server using the service
principal kadmin/admin
. If the credentials cache contains a
ticket for the kadmin/admin
principal, and the -c ccache
option is specified, that ticket is used to authenticate to KADM5.
Otherwise, the -p and -k options are used to specify the
client Kerberos principal name used to authenticate. Once kadmin has
determined the principal name, it requests a kadmin/admin
Kerberos service ticket from the KDC, and uses that service ticket to
authenticate to KADM5.
You can invoke kadmin
or kadmin.local
with any of the
following options:
kadmin
will append admin
to
either the primary principal name, the environment variable USER, or to
the username obtained from getpwuid
, in order of preference.
kadmin
. This is useful for writing
scripts that pass specific queries to kadmin
.
You can invoke kadmin
with any of the following options:
kadmin/admin
service, which can be acquired with the kinit
program. If this
option is not specified, kadmin
requests a new service ticket
from the KDC, and stores it in its own temporary ccache.
Note: This database specific argument is applicable only to kadmin.local
and the KADM5 server.
You can invoke kadmin.local
with an of the follwing options:
Many of the kadmin
commands take a duration or time as an
argument. The date can appear in a wide variety of formats, such as:
"15 minutes" "7 days" "1 month" "2 hours" "400000 seconds" "next year" "this Monday" "next Monday" yesterday tomorrow now "second Monday" fortnight "3/31/1992 10:00:07 PST" "January 23, 2007 10:05pm" "22:00 GMT"
Note that if the date specification contains spaces, you must enclose it in double quotes. Note also that you cannot use a number without a unit. (I.e., “"60 seconds"” is correct, but “60” is incorrect.) All keywords are case-insensitive. The following is a list of all of the allowable keywords.
kadmin
recognizes abbreviations for most of the world's time
zones. A complete listing appears in kadmin Time Zones.
Each entry in the Kerberos database contains a Kerberos principal (see Definitions) and the attributes and policies associated with that principal.
To retrieve a listing of the attributes and/or policies associated with
a principal, use the kadmin
get_principal
command, which
requires the “inquire” administrative privilege. The syntax is:
get_principal principal
The get_principal
command has the alias getprinc
.
For example, suppose you wanted to view the attributes of the
principal
jennifer/root@ATHENA.MIT.EDU
.
You would type:
shell% kadmin kadmin: getprinc jennifer/root Principal: jennifer/root@ATHENA.MIT.EDU Expiration date: [never] Last password change: Mon Jan 31 02:06:40 EDT 2002 Password Expiration date: [none] Maximum ticket life: 0 days 10:00:00 Maximum renewable life: 7 days 00:00:00 Last modified: Wed Jul 24 14:46:25 EDT 2002 (joeadmin/admin@ATHENA.MIT.EDU) Last successful authentication: Mon Jul 29 18:20:17 EDT 2002 Last failed authentication: Mon Jul 29 18:18:54 EDT 2002 Failed password attempts: 3 Number of keys: 2 Key: vno 2, Triple DES cbc mode with HMAC/sha1, no salt Key: vno 2, DES cbc mode with CRC-32, no salt Attributes: DISALLOW_FORWARDABLE, DISALLOW_PROXIABLE Policy: [none] kadmin:
The get_principal
command has a -terse
option, which lists
the fields as a quoted, tab-separated string. For example:
kadmin: getprinc -terse jennifer/root jennifer/root@ATHENA.MIT.EDU 0 1027458564 0 36000 (joeadmin/admin@ATHENA.MIT.EDU 1027536385 18 2 0 [none] 604800 1027980137 1027980054 3 2 1 2 16 0 1 2 1 0 kadmin:
To generate a listing of principals, use the kadmin
list_principals
command, which requires the “list” privilege.
The syntax is:
list_principals [expression]
where expression is a shell-style glob expression that
can contain the characters *, ?, [, and ].
All policy names matching the expression are displayed. The
list_principals
command has the aliases listprincs
,
get_principals
, and getprincs
. For example:
kadmin: listprincs test* test3@ATHENA.MIT.EDU test2@ATHENA.MIT.EDU test1@ATHENA.MIT.EDU testuser@ATHENA.MIT.EDU kadmin:
If no expression is provided, all principals are printed.
Administrative privileges for the Kerberos database are stored in the
file kadm5.acl
.
The format of the file is:
Kerberos_principal permissions [target_principal] [restrictions]
The Kerberos principal (and optional target principal) can include the
“*” wildcard, so if you want any principal with the instance
“admin” to have full permissions on the database, you could use the
principal “*/admin@REALM
” where “REALM” is your Kerberos
realm. target_principal
can also include backreferences to
Kerberos_principal
, in which "*number" matches the
component number in the Kerberos_principal
.
Note: a common use of an admin instance is so you can grant
separate permissions (such as administrator access to the Kerberos
database) to a separate Kerberos principal. For example, the user
joeadmin
might have a principal for his administrative
use, called joeadmin/admin
. This way,
joeadmin
would obtain joeadmin/admin
tickets only when he actually needs to use those permissions.
The permissions are represented by single letters; UPPER-CASE letters represent negative permissions. The permissions are:
The restrictions are a string of flags. Allowed restrictions are:
+
and -
flags for the kadmin addprinc
and
modprinc
commands.
The above flags act as restrictions on any add or modify operation which is allowed due to that ACL line.
Here is an example of a kadm5.acl
file. Note that order is
important; permissions are determined by the first matching entry.
*/admin@ATHENA.MIT.EDU * joeadmin@ATHENA.MIT.EDU ADMCIL joeadmin/*@ATHENA.MIT.EDU il */root@ATHENA.MIT.EDU *@ATHENA.MIT.EDU cil *1/admin@ATHENA.MIT.EDU */*@ATHENA.MIT.EDU i */admin@EXAMPLE.COM * -maxlife 9h -postdateable
In the above file, any principal in the
ATHENA.MIT.EDU realm with an admin
instance has all
administrative privileges. The user joeadmin
has all permissions with his admin
instance,
joeadmin/admin@ATHENA.MIT.EDU
(matches the first
line). He has no permissions at all with his null
instance,
joeadmin@ATHENA.MIT.EDU
(matches the second line).
His root instance has inquire and list permissions with any
other principal that has the instance root
. Any principal
in ATHENA.MIT.EDU can inquire, list, or change the password of
their admin
instance, but not any other admin
instance.
Any principal in the realm ATHENA.MIT.EDU
(except for
joeadmin@ATHENA.MIT.EDU
, as mentioned above) has
inquire privileges. Finally, any principal with an admin instance
in EXAMPLE.COM has all permissions, but any principal that they
create or modify will not be able to get postdateable tickets or tickets
with a life of longer than 9 hours.
To add a principal to the database, use the kadmin add_principal
command, which requires the “add” administrative privilege. This
function creates the new principal, prompting twice for a password, and,
if neither the -policy nor -clearpolicy options are specified and the
policy “default” exists, assigns it that policy. The syntax is:
kadmin: add_principal [options] principal
To modify attributes of a principal, use the kadmin
modify_principal
command, which requires the “modify”
administrative privilege. The syntax is:
kadmin: modify_principal [options] principal
add_principal
has the aliases addprinc
and
ank
2. modify_principal
has the alias modprinc
.
The add_principal
and modify_principal
commands take the
following switches:
modify_principal
, the current policy assigned to the principal is
set or changed. With add_principal
, if this option is not
supplied, the -clearpolicy is not specified, and the policy “default”
exists, that policy is assigned. If a principal is created with no
policy, kadmin
will print a warning message.
modify_principal
, removes the current policy from a
principal. For add_principal
, suppresses the automatic
assignment of the policy “default”.
add_principal
only). MIT recommends using this option for host keys.
add_principal
only). MIT does
not recommend using this option.
If you want to just use the default values, all you need to do is:
kadmin: addprinc jennifer WARNING: no policy specified for "jennifer@ATHENA.MIT.EDU"; defaulting to no policy. Enter password for principal jennifer@ATHENA.MIT.EDU: <= Type the password. Re-enter password for principal jennifer@ATHENA.MIT.EDU: <=Type it again. Principal "jennifer@ATHENA.MIT.EDU" created. kadmin:
If you want to create a principal which is contained by a LDAP object, all you need to do is:
kadmin: addprinc -x dn=cn=jennifer,o=mit jennifer WARNING: no policy specified for "jennifer@ATHENA.MIT.EDU"; defaulting to no policy. Enter password for principal jennifer@ATHENA.MIT.EDU: <= Type the password. Re-enter password for principal jennifer@ATHENA.MIT.EDU: <=Type it again. Principal "jennifer@ATHENA.MIT.EDU" created. kadmin:
If you want to create a principal under a specific LDAP container and link to an existing LDAP object, all you need to do is:
kadmin: addprinc -x containerdn=o=mit -x linkdn=cn=david,o=mit david WARNING: no policy specified for "david@ATHENA.MIT.EDU"; defaulting to no policy. Enter password for principal david@ATHENA.MIT.EDU: <= Type the password. Re-enter password for principal david@ATHENA.MIT.EDU: <=Type it again. Principal "david@ATHENA.MIT.EDU" created. kadmin:
If you want to associate a ticket policy to a principal, all you need to do is:
kadmin: modprinc -x tktpolicy=userpolicy david Principal "david@ATHENA.MIT.EDU" modified. kadmin:
If, on the other hand, you want to set up an account that expires on January 1, 2000, that uses a policy called “stduser”, with a temporary password (which you want the user to change immediately), you would type the following. (Note: each line beginning with => is a continuation of the previous line.)
kadmin: addprinc david -expire "1/1/2000 12:01am EST" -policy stduser => +needchange Enter password for principal david@ATHENA.MIT.EDU: <= Type the password. Re-enter password for principal david@ATHENA.MIT.EDU: <= Type it again. Principal "david@ATHENA.MIT.EDU" created. kadmin:
If you will need cross-realm authentication, you need to add principals
for the other realm's TGT to each realm. For example, if you need to
do cross-realm authentication between the realms ATHENA.MIT.EDU
and EXAMPLE.COM, you would need to add the principals
krbtgt/EXAMPLE.COM@ATHENA.MIT.EDU and
krbtgt/ATHENA.MIT.EDU@EXAMPLE.COM to both
databases. You need to be sure the passwords and the key version
numbers (kvno) are the same in both databases. This may require
explicitly setting the kvno with the -kvno option. See
Cross-realm Authentication for more details.
To delete a principal, use the kadmin delete_principal
command,
which requires the “delete” administrative privilege. The syntax is:
delete_principal [-force] principal
delete_principal
has the alias delprinc
. The
-force
option causes delete_principal
not to ask if you're
sure. For example:
kadmin: delprinc jennifer Are you sure you want to delete the principal "jennifer@ATHENA.MIT.EDU"? (yes/no): yes Principal "jennifer@ATHENA.MIT.EDU" deleted. Make sure that you have removed this principal from all ACLs before reusing. kadmin:
To change a principal's password use the kadmin change_password
command, which requires the “modify” administrative privilege (unless
the principal is changing his/her own password). The syntax is:
change_password [options] principal
The change_password
option has the alias cpw
.
change_password
takes the following options:
For example:
kadmin: cpw david Enter password for principal david@ATHENA.MIT.EDU: <= Type the new password. Re-enter password for principal david@ATHENA.MIT.EDU: <= Type it again. Password for david@ATHENA.MIT.EDU changed. kadmin:
Note that change_password
will not let you change the password to
one that is in the principal's password history.
A policy is a set of rules governing passwords. Policies can dictate minimum and maximum password lifetimes, minimum number of characters and character classes a password must contain, and the number of old passwords kept in the database.
To retrieve a policy, use the kadmin get_policy
command, which
requires the “inquire” administrative privilege. The syntax is:
get_policy [-terse] policy
The get_policy
command has the alias getpol
. For example:
kadmin: get_policy admin Policy: admin Maximum password life: 180 days 00:00:00 Minimum password life: 00:00:00 Minimum password length: 6 Minimum number of password character classes: 2 Number of old keys kept: 5 Reference count: 17 kadmin:
The reference count is the number of principals using that policy.
The get_policy
command has a -terse
option, which lists
each field as a quoted, tab-separated string. For example:
kadmin: get_policy -terse admin admin 15552000 0 6 2 5 17 kadmin:
You can retrieve the list of policies with the kadmin
list_policies
command, which requires the “list” privilege. The
syntax is:
list_policies [expression]
where expression is a shell-style glob expression that can
contain the characters *, ?, and []. All policy names matching the
expression are displayed. The list_policies
command has the aliases
listpols
, get_policies
, and getpols
. For example:
kadmin: listpols test-pol dict-only once-a-min test-pol-nopw kadmin: listpols t* test-pol test-pol-nopw kadmin:
To add a new policy, use the kadmin add_policy
command, which
requires the “add” administrative privilege. The syntax is:
add_policy [options] policy_name
To modify attributes of a principal, use the kadmin modify_policy
command, which requires the “modify” administrative privilege. The
syntax is:
modify_policy [options] policy_name
add_policy
has the alias addpol
.
modify_poilcy
has the alias modpol
.
The add_policy
and modify_policy
commands take the
following switches:
Note: The policies are created under realm container in the LDAP database.
To delete a policy, use the kadmin
delete_policy
command,
which requires the “delete” administrative privilege. The syntax is:
delete_policy [-force] policy_name
The delete_policy
command has the alias delpol
.
It prompts for confirmation before deletion.
For example:
kadmin: delete_policy guests Are you sure you want to delete the policy "guests"? (yes/no): yes kadmin:
Note that you must cancel the policy from all principals before deleting
it. The delete_policy
command will fail if it is in use by any
principals.
The kdb5_util
command is the primary tool for administrating the
Kerberos database. The syntax is:
kdb5_util command [kdb5_util_options] [command_options]
The kdb5_util
command takes the following options, which override
the defaults specified in the configuration files:
To dump a Kerberos database into a file, use the kdb5_util
dump
command on one of the KDCs. The syntax is:
kdb5_util dump [-old] [-b6] [-b7] [-ov] [-verbose] [-mkey_convert] [-new_mkey_file] [filename [principals...]]
The kdb5_util dump
command takes the following options:
For example:
shell% kdb5_util dump dumpfile shell%
shell% kbd5_util dump -verbose dumpfile kadmin/admin@ATHENA.MIT.EDU krbtgt/ATHENA.MIT.EDU@ATHENA.MIT.EDU kadmin/history@ATHENA.MIT.EDU K/M@ATHENA.MIT.EDU kadmin/changepw@ATHENA.MIT.EDU shell%
If you specify which principals to dump, you must use the full principal, as in the following example. (The line beginning with => is a continuation of the previous line.):
shell% kdb5_util dump -verbose dumpfile K/M@ATHENA.MIT.EDU => kadmin/admin@ATHENA.MIT.EDU kadmin/admin@ATHENA.MIT.EDU K/M@ATHENA.MIT.EDU shell%
Otherwise, the principals will not match those in the database and will not be dumped:
shell% kdb5_util dump -verbose dumpfile K/M kadmin/admin shell%
If you do not specify a dump file, kdb5_util
will dump the
database to the standard output.
There is currently a bug where the default dump format omits the per-principal policy information. In order to dump all the data contained in the Kerberos database, you must perform a normal dump (with no option flags) and an additional dump using the “-ov” flag to a different file.
To restore a Kerberos database dump from a file, use the
kdb5_util
load
command on one of the KDCs. The syntax
is:
kdb5_util load [-old] [-b6] [-b7] [-ov] [-verbose] [-update] [-hash] dumpfilename dbname [admin_dbname]
The kdb5_util load
command takes the following options:
For example:
shell% kdb5_util load dumpfile principal shell%
shell% kdb5_util load -update dumpfile principal shell%
If the database file exists, and the -update flag was not given,
kdb5_util
will overwrite the existing database.
A stash file allows a KDC to authenticate itself to the database
utilities, such as kadmin
, kadmind
, krb5kdc
, and
kdb5_util
.
To create a stash file, use the kdb5_util
stash
command.
The syntax is:
kdb5_util stash [-f keyfile]
For example:
shell% kdb5_util stash kdb5_util: Cannot find/read stored master key while reading master key kdb5_util: Warning: proceeding without master key Enter KDC database master key: <= Type the KDC database master password. shell%
If you do not specify a stash file, kdb5_util
will stash the key
in the file specified in your kdc.conf
file.
If you need to create a new Kerberos database, use the kdb5_util
create
command. The syntax is:
kdb5_util create [-s]
If you specify the -s option, kdb5_util
will stash a copy
of the master key in a stash file. (See Creating a Stash File.) For
example:
shell% /usr/local/sbin/kdb5_util -r ATHENA.MIT.EDU create -s kdb5_util: No such file or directory while setting active database to => '/usr/local/var/krb5kdc/principal' Initializing database '/usr/local/var/krb5kdc/principal' for => realm 'ATHENA.MIT.EDU', master key name 'K/M@ATHENA.MIT.EDU' You will be prompted for the database Master Password. It is important that you NOT FORGET this password. Enter KDC database master key: <= Type the master password. Re-enter KDC database master key to verify: <= Type it again. shell%
If you need to destroy the current Kerberos database, use the
kdb5_util
destroy
command. The syntax is:
kdb5_util destroy [-f]
The destroy
command destroys the database, first overwriting the
disk sectors and then unlinking the files. If you specify the
-f option, kdb5_util
will not prompt you for a
confirmation before destroying the database.
shell% /usr/local/sbin/kdb5_util -r ATHENA.MIT.EDU destroy kdb5_util: Deleting KDC database stored in /usr/local/var/krb5kdc/principal, are you sure (type yes to confirm)? <== yes OK, deleting database '/usr/local/var/krb5kdc/principal'... shell%
The kdb5_ldap_util
is the primary tool for administrating the Kerberos LDAP database. It allows an administrator to manage realms, Kerberos services ( KDC and Admin Server) and ticket policies.
The syntax is:
kdb5_ldap_util [-D user_dn [-w passwd]] [-H ldap_uri] command [command_options]
If you need to create a new realm, use the command as follows:
create [-r realm] [-subtrees subtree_dn_list] [-sscope search_scope] [-containerref container_reference_dn] [-k mkeytype] [-m|-P password][-sf stashlename] [-s] [-maxtktlife max_ticket_life] [-maxrenewlife max_renewable_ticket_life] [ticket_flags]
Options to create realm in directory are as follows:
-allow_postdated
prohibits principals from obtaining postdated tickets. (Sets the KRB5_KDB_DISALLOW_POSTDATED flag.).+allow_postdated
clears this flag.
-allow_forwardable
prohibits principals from obtaining forwardable tickets. (Sets the
KRB5_KDB_DISALLOW_FORWARDABLE flag.) +allow_forwardable
clears this flag.
-allow_renewable
prohibits principals from obtaining renewable tickets. (Sets the KRB5_KDB_DISALLOW_RENEWABLE flag.) +allow_renewable
clears this flag.
-allow_proxiable
prohibits principals from obtaining proxiable tickets. (Sets the KRB5_KDB_DISALLOW_PROXABLE flag.) +allow_proxiable
clears this flag.
-allow_dup_skey
disables user-to-user authentication for
principals by prohibiting principals from obtaining a sessions key for
another user. (Sets the KRB5_KDB_DISALLOW_DUP_SKEY flag.)
+allow_dup_skey
clears this flag.
+requires_preauth
requires principals to preauthenticate before being allowed to kinit. (Sets the KRB5_KDB_REQURES_PRE_AUTH flag.) -requires_preauth
clears this flag.
+requires_hwauth
requires principals to preauthenticate using a
hardware device before being allowed to kinit. (Sets the
KRB5_KDB_REQURES_HW_AUTH flag.) -requires_hwauth
clears
this flag.
-allow_svr
prohibits the issuance of service tickets for principals. (Sets the KRB5_KDB_DISALLOW_SVR flag.) +allow_svr
clears this flag.
-allow_tgs_req
specifies that a Ticket-Granting Service
(TGS) request for a service ticket for principals is not
permitted. This option is useless for most
things.+allow_tgs_req
clears this flag. The default is
+allow_tgs_req
. In effect, -allow_tgs_req
sets the
KRB5_KDB_DISALLOW_TGT_BASED flag on principals in the
database.
-allow_tix
forbids the issuance of any tickets for
principals. +allow_tix
clears this flag. The default is
+allow_tix
. In effect, -allow_tix
sets the
KRB5_KDB_DISALLOW_ALL_TIX flag on principals in the database.
+needchange
sets a flag in attributes field to force a password change;
-needchange
clears it. The default is -needchange
. In effect,
+needchange
sets the KRB5_KDB_REQURES_PWCHANGE flag on
principals in the database.
+password_changing_service
sets a flag in the attributes field
marking principal as a password change service principal (useless for
most things). -password_changing_service
clears the flag. This
flag intentionally has a long name. The default is
-password_changing_service
. In effect,
+password_changing_service
sets the
KRB5_KDB_PWCHANGE_SERVICE flag on principals in the database.
shell% kdb5_ldap_util -D cn=admin,o=org -H ldaps://ldap-server1.mit.edu create -sscope -subtree ou=users,o=org -r ATHENA.MIT.EDU Password for "cn=admin,o=org": Initializing database for realm 'ATHENA.MIT.EDU' You will be prompted for the database Master Password. It is important that you NOT FORGET this password. Enter KDC database master key: Re-enter KDC database master key to verify: shell%
shell% kdb5_ldap_util -D cn=admin,o=org -H ldaps://ldap-server1.mit.edu create -sscope -subtree ou=users,o=org -kdcdn cn=krbkdc,o=org -admindn cn=krbadmin,o=org -r ATHENA.MIT.EDU Password for "cn=admin,o=org": Initializing database for realm 'ATHENA.MIT.EDU' You will be prompted for the database Master Password. It is important that you NOT FORGET this password. Enter KDC database master key: Re-enter KDC database master key to verify: shell%
If you need to modify a realm, use the command as follows:
modify [-r realm] [-subtrees subtree_dn] [-sscope search_scope][-containerref container_reference_dn] [-maxtktlifemax_ticket_life][-maxrenewlife max_renewable_ticket_life] [-ticket_flags]
Options to modify realm in directory are as follows:
-allow_postdated
prohibits principals from obtaining postdated tickets. (Sets the KRB5_KDB_DISALLOW_POSTDATED flag.).+allow_postdated
clears this flag.
-allow_forwardable
prohibits principals from obtaining forwardable tickets.
(Sets the KRB5_KDB_DISALLOW_FORWARDABLE flag.) +allow_forwardable
clears this flag.
-allow_renewable
prohibits principals from obtaining renewable tickets. (Sets the KRB5_KDB_DISALLOW_RENEWABLE flag.) +allow_renewable
clears this flag.
-allow_proxiable
prohibits principals from obtaining proxiable tickets. (Sets the KRB5_KDB_DISALLOW_PROXABLE flag.) +allow_proxiable
clears this flag.
-allow_dup_skey
Disables user-to-user authentication for principals by prohibiting principals from obtaining a sessions key for another user. (Sets the KRB5_KDB_DISALLOW_DUP_SKEY flag.). +allow_dup_skey
clears This flag.
+requires_preauth
requires principals to preauthenticate before being allowed to kinit. Sets the
KRB5_KDB_REQURES_PRE_AUTH flag.-requires_preauth
clears this flag.
+requires_hwauth
requires principals to preauthenticate using a hardware device before being allowed to kinit. (Sets the
KRB5_KDB_REQURES_HW_AUTH flag.)-requires_hwauth
clears this flag.
-allow_svr
prohibits the issuance of service tickets for principals. (Sets the KRB5_KDB_DISALLOW_SVR flag.) +allow_svr
clears This flag.
-allow_tgs_req
specifies that a Ticket-Granting Service (TGS) request for a service ticket for principals is not permitted. This option is useless for most things.+allow_tgs_req
clears this flag.
The default is. +allow_tgs_req
. In effect,
-allow_tgs_req
sets the KRB5_KDB_DISALLOW_TGT_BASED flag
on principals in the database.
-allow_tix
forbids the issuance of any tickets for
principals. +allow_tix
clears this flag. The default is
+allow_tix
. In effect, -allow_tix
sets the
KRB5_KDB_DISALLOW_ALL_TIX flag on principals in the database.
+needchange
sets a flag in attributes field to force a password change; -needchange
clears it.
The default is -needchange
. In effect,+needchange
sets
the KRB5_KDB_REQURES_PWCHANGE flag on principals in the
database.
+password_changing_service
sets a flag in the attributes field marking principal as a password change service principal (useless for most things).-password_changing_service
clears the flag. This flag intentionally has a long name. The default is -password_changing_service
In effect, +password_changing_service
sets the KRB5_KDB_PWCHANGE_SERVICE flag on principals in the database.
For example:
shell% kdb5_ldap_util -D cn=admin,o=org -H ldaps://ldap-server1.mit.edu modify -r ATHENA.MIT.EDU +requires_preauth Password for "cn=admin,o=org": shell%
shell% kdb5_ldap_util -D cn=admin,o=org -H ldaps://ldap-server1.mit.edu view -r ATHENA.MIT.EDU Password for "cn=admin,o=org": Realm Name: ATHENA.MIT.EDU Subtree: ou=users,o=org Subtree: ou=servers,o=org SearchScope: ONE Maximum ticket life: 0 days 01:00:00 Maximum renewable life: 0 days 10:00:00 Ticket flags: DISALLOW_FORWARDABLE shell%
shell% kdb5_ldap_util -D cn=admin,o=org -H ldap-server1.mit.edu destroy -r ATHENA.MIT.EDU Password for "cn=admin,o=org": Deleting KDC database of 'ATHENA.MIT.EDU', are you sure? type 'yes' to confirm)? Yes OK, deleting database of 'ATHENA.MIT.EDU'... shell%
shell% kdb5_ldap_util -D cn=admin,o=org -H ldaps://ldap-server1.mit.edu list Password for "cn=admin,o=org": ATHENA.MIT.EDU OPENLDAP.MIT.EDU MEDIA-LAB.MIT.EDU shell%
stashsrvpw [-f filename] servicedn
This command allows an administrator to store the password of service object in a file. The KDC and Administration server uses this password to authenticate to the LDAP server. Options are as follows:
/usr/local/var/service_passwd
is used.
shell% kdb5_ldap_util stashsrvpw -f /home/andrew/conf_keyle cn=service-kdc,o=org Password for "cn=service-kdc,o=org": Re-enter password for "cn=service-kdc,o=org": shell%
This command creates a ticket policy in directory.
create_policy [-r realm] [-maxrenewlife max_renewable_ticket_life] [ticket_flags] policy_name
Ticket policy objects are created under the realm container.
This command modifies a ticket policy in directory.
modify_policy [-r realm] [-maxrenewlife max_renewable_ticket_life] [ticket_flags] policy_name
Options are as follows:
The various flags are:
-allow_postdated
prohibits principals from obtaining postdated tickets. (Sets the KRB5_KDB_DISALLOW_POSTDATED flag.).+allow_postdated
clears this flag.
-allow_forwardable
prohibits principals from obtaining forwardable tickets. (Sets the
KRB5_KDB_DISALLOW_FORWARDABLE flag.) +allow_forwardable
clears this flag.
-allow_renewable
prohibits principals from obtaining renewable tickets. (Sets the KRB5_KDB_DISALLOW_RENEWABLE flag.) +allow_renewable
clears this flag.
-allow_proxiable
prohibits principals from obtaining proxiable tickets. (Sets the KRB5_KDB_DISALLOW_PROXABLE flag.) +allow_proxiable
clears this flag.
-allow_dup_skey
Disables user-to-user authentication for principals by prohibiting principals from obtaining a sessions key for another user. (Sets the KRB5_KDB_DISALLOW_DUP_SKEY flag.). +allow_dup_skey
clears This flag.
+requires_preauth
requires principals to preauthenticate before being allowed to kinit. (Sets the KRB5_KDB_REQURES_PRE_AUTH flag.)
-requires_preauth
clears this flag.
+requires_hwauth
requires principals to preauthenticate using a
hardware device before being allowed to kinit. (Sets the
KRB5_KDB_REQURES_HW_AUTH flag.) -requires_hwauth
clears
this flag.
-allow_svr
prohibits the issuance of service tickets for principals. (Sets the KRB5_KDB_DISALLOW_SVR flag.) +allow_svr
clears This flag.
-allow_tgs_req
specifies that a Ticket-Granting Service (TGS) request for a service ticket for principals is not permitted. This option is useless for most things.+allow_tgs_req
clears this flag.
The default is +allow_tgs_req
. In effect,
-allow_tgs_req
sets the KRB5_KDB_DISALLOW_TGT_BASED flag
on principals in the database.
-allow_tix
forbids the issuance of any tickets for
principals. +allow_tix
clears this flag. The default is
+allow_tix
. In effect, -allow_tix
sets the
KRB5_KDB_DISALLOW_ALL_TIX flag on principals in the database.
+needchange
sets a flag in attributes field to force a password change;
-needchange
clears it. The default is -needchange
. In
effect, +needchange
sets the KRB5_KDB_REQURES_PWCHANGE
flag on principals in the database.
+password_changing_service
sets a flag in the attributes field
marking principal as a password change service principal (useless for
most things). -password_changing_service
clears the flag.
This flag intentionally has a long name. The default is
-password_changing_service
. In effect,
+password_changing_service
sets the
KRB5_KDB_PWCHANGE_SERVICE flag on principals in the database.
shell% kdb5_ldap_util -D cn=admin,o=org -H ldaps://ldap-server1.mit.edu create_policy -r ATHENA.MIT.EDU -maxtktlife "1 day" -maxrenewlife "1 week" -allow_forwardable usertktpolicy Password for "cn=admin,o=org": shell%
For example:
shell% kdb5_ldap_util -D cn=admin,o=org -H ldaps://ldap-server1.mit.edu view_policy -r ATHENA.MIT.EDU usertktpolicy Password for "cn=admin,o=org": Ticket policy: usertktpolicy Maxmum ticket life: 0 days 01:00:00 Maxmum renewable life: 0 days 10:00:00 Ticket flags: DISALLOW_FORWARDABLE REQUIRES_PWCHANGE shell%
shell% kdb5_ldap_util -D cn=admin,o=org -H ldaps://ldap-server1.mit.edu destroy_policy -r ATHENA.MIT.EDU usertktpolicy Password for "cn=admin,o=org": This will delete the policy object 'usertktpolicy', are you sure? (type 'yes' to confirm)? Yes ** policy object 'usertktpolicy' deleted. shell%
Option are as follows:
For example:
shell% kdb5_ldap_util -D cn=admin,o=org -H ldaps://ldap-server1.mit.edu list_policy -r ATHENA.MIT.EDU Password for "cn=admin,o=org": usertktpolicy tempusertktpolicy krbtktpolicy shell%
create_service -kdc|-admin|-pwd [-servicehost service_host_list] [-realm realm_list] [-randpw| -fileonly] [-filename] service_dn
Creates a service object in directory and assigns appropriate rights on the container holding kerberos data.
Options are as follows:
server1#tcp#88:server2#udp#89.
-fileonly
option cannot be used with -randpw
option.
-randpw
option can not be used when -fileonly
option is specified.
For example:
shell% kdb5_ldap_util -D cn=admin,o=org -H ldaps://ldap-server1.mit.edu create_service -kdc -randpw -f /home/andrew/service_passwd cn=service-kdc,o=org Password for "cn=admin,o=org": File does not exist. Creating the file /home/andrew/service_passwd... shell%
modify_service [-servicehost service_host_list |[-clearservicehost service_host_list] [-addservicehost service_host_list]] [-realm realm_list | [-clearrealm realm_list] [-addrealm realm_list]] service_dn
Modifies the attributes of a service and assigns appropriate rights, if realm associations are changed.
Options are as follows:
server1#tcp#88:server2#udp#89
For example:
shell% kdb5_ldap_util -D cn=admin,o=org -H ldaps://ldap-server1.mit.edu modify_service -realm ATHENA.MIT.EDU cn=service-kdc,o=org Password for "cn=admin,o=org": Changing rights for the service object. Please wait ... done shell%
For example:
shell% kdb5_ldap_util -D cn=admin,o=org -H ldaps://ldap-server1.mit.edu view_service cn=service-kdc,o=org Password for "cn=admin,o=org": Service dn: cn=service-kdc,o=org Service type: kdc Service host list: Realm DN list: cn=ATHENA.MIT.EDU,cn=Kerberos,o=org shell%
destroy_service [-force] [-f stashfilename] service_dn
Destroys an existing service. Options are as follows :
shell% kdb5_ldap_util -D cn=admin,o=org -H ldaps://ldap-server1.mit.edu destroy_service cn=service-kdc,o=org Password for "cn=admin,o=org": This will delete the service object 'cn=service-kdc,o=org', are you sure? (type 'yes' to confirm)? Yes ** service object 'cn=service-kdc,o=org' deleted. shell%
defaultsearchbase
from slapd.conf file will be used, where as in the case of eDirectory, the default value for the base DN is Root.
For example:
shell% kdb5_ldap_util -D cn=admin,o=org -H ldaps://ldap-server1.mit.edu list_service Password for "cn=admin,o=org": cn=service-kdc,o=org cn=service-adm,o=org cn=service-pwd,o=org shell%
setsrvpw [-randpw|-fileonly][-f filename] service_dn
Allows an administrator to set password for service objects such as KDC and Administration server in eDirectory and store them in a file. The
-fileonly
command stores the password in a file and not in the eDirectory object.
Options are as follows:
-fileonly
option can not be used if -randpw
option is already specified.
-randpw
option can not be used when -fileonly
option is specified.
For example:
shell% kdb5_ldap_util setsrvpw -D cn=admin,o=org -H ldaps://ldap-server1.mit.edu setsrvpw -f /home/andrew/conf_keyfile cn=service-kdc,o=org Password for "cn=admin,o=org": Password for "cn=service-kdc,o=org": Re-enter password for "cn=service-kdc,o=org": shell%
In order for a KDC in one realm to authenticate Kerberos users in a different realm, it must share a key with the KDC in the other realm. In both databases, there must be krbtgt service principals for realms. These principals should all have the same passwords, key version numbers, and encryption types. For example, if the administrators of ATHENA.MIT.EDU and EXAMPLE.COM wanted to authenticate across the realms, they would run the following commands on the KDCs in both realms:
shell%: kadmin.local -e "des3-hmac-sha1:normal des-cbc-crc:v4" kadmin: add_princ -requires_preauth krbtgt/ATHENA.MIT.EDU@EXAMPLE.COM Enter password for principal krbtgt/ATHENA.MIT.EDU@EXAMPLE.COM: Re-enter password for principal krbtgt/ATHENA.MIT.EDU@EXAMPLE.COM: kadmin: add_princ -requires_preauth krbtgt/EXAMPLE.COM@ATHENA.MIT.EDU Enter password for principal krbtgt/EXAMPLE.COM@ATHENA.MIT.EDU: Enter password for principal krbtgt/EXAMPLE.COM@ATHENA.MIT.EDU: kadmin:
Even if most principals in a realm are generally created with the requires_preauth flag enabled, this flag is not desirable on cross-realm authentication keys because doing so makes it impossible to disable preauthentication on a service-by-service basis. Disabling it as in the example above is recommended.
It is also very important that these principals have good passwords. MIT recommends that TGT principal passwords be at least 26 characters of random ASCII text.
A Kerberos Ticket Granting Ticket (TGT) is a service ticket for the principal krbtgt/REALM. The key for this principal is created when the Kerberos database is initialized and need not be changed. However, it will only have the encryption types supported by the KDC at the time of the initial database creation. To allow use of newer encryption types for the TGT, this key has to be changed.
Changing this key using the normal kadmin change_password
command
would invalidate any previously issued TGTs. Therefore, when changing
this key, normally one should use the -keepold flag to
change_password
to retain the previous key in the database as
well as the new key. For example:
kadmin: change_password -randkey -keepold krbtgt/ATHENA.MIT.EDU@ATHENA.MIT.EDU
There is currently no way to remove the old key without running
change_password
without the -keepold flag (and thereby
invalidating all existing TGTs). After issuing this command, the old
key is still valid and is still vulnerable to (for instance) brute force
attacks. To completely retire an old key or encryption type, it's
therefore currently necessary to declare a flag day, run
change_password
without the -keepold flag, and force all
users to acquire new tickets.
ldapi://
can be used if the LDAP server and KDC
service are running on the same machine.
For the latter, you need to specify the location of CA certificate location in slapd.conf file.
Refer to the following link for more information:
For example,
TLS_CACERT /etc/openldap/certs/cacert.pem
include /etc/openldap/schema/kerberos.schema
Sample access control information
access to dn.base="" by * read access to dn.base="cn=Subschema" by * read access to attrs=userPassword,userPKCS12 by self write by * auth access to attrs=shadowLastChange by self write by * read # Providing access to realm subtree access todn.subtree
= "o=mit" bydn.exact
="cn=kdc-service,o=mit" read bydn.exact
="cn=adm-service,o=mit" write by * none # Providing access to realm container access todn.subtree
= "cn=MIT.EDU,cn=Kerberos,o=mit" bydn.exact
="cn=kdc-service,o=mit" read bydn.exact
="cn=adm-service,o=mit" write by * none access to * by * read
The above list provides the access control information for the KDC and Admin service object for the realm container and the realm subtree. Thus if the realm subtree or the service objects for a realm are changed then this information should be updated.
slapd -h "ldapi:/// ldaps:///"
realms database_module dbmodules db_library db_module_dir ldap_kdc_dn ldap_kadmind_dn ldap_service_password_file ldap_servers ldap_conns_per_server
For the sample krb5.conf file, refer to Sample krb5.conf File. For more details, refer to the section krb5.conf
kdb5_ldap_util -D cn=admin,o=mit create -subtrees o=mit -r MIT.EDU -s
Before executing the command, make sure that the subtree mentioned above (o=mit) exists.
For more information, refer to the section Global Operations on the Kerberos LDAP Database.
The realm object is created under the ldap_kerberos_container_dn specified in the configuration file. This operation will also create the Kerberos container, if not present already. This will be used to store information related to all realms.
kdb5_ldap_util -D cn=admin,o=mit stashsrvpw -f /etc/kerberos/service.keyfile
cn=krbadmin,o=mit
If you need to install the Kerberos V5 programs on an application server, please refer to the Kerberos V5 Installation Guide. Once you have installed the software, you need to add that host to the Kerberos database (see Adding or Modifying Principals), and generate a keytab for that host, that contains the host's key. You also need to make sure the host's clock is within your maximum clock skew of the KDCs.
A keytab is a host's copy of its own keylist, which is analogous
to a user's password. An application server that needs to authenticate
itself to the KDC has to have a keytab that contains its own principal
and key. Just as it is important for users to protect their passwords,
it is equally important for hosts to protect their keytabs. You should
always store keytab files on local disk, and make them readable only by
root, and you should never send a keytab file over a network in the
clear. Ideally, you should run the kadmin
command to extract a
keytab on the host on which the keytab is to reside.
To generate a keytab, or to add a principal to an existing keytab, use
the ktadd
command from kadmin
, which requires the
“inquire” administrative privilege. (If you use the -glob
princ_exp option, it also requires the “list” administrative
privilege.) The syntax is:
ktadd [-k[eytab] keytab] [-q] [-e key:salt_list] [principal | -glob princ_exp] [...]
The ktadd
command takes the following switches:
ktadd
will use the
default keytab file (/etc/krb5.keytab
).
ktadd
to display less verbose
information.
list_principals
(see Retrieving a List of Principals) command.
Here is a sample session, using configuration files that enable only des-cbc-crc encryption. (The line beginning with => is a continuation of the previous line.)
kadmin: ktadd host/daffodil.mit.edu@ATHENA.MIT.EDU kadmin: Entry for principal host/daffodil.mit.edu@ATHENA.MIT.EDU with kvno 2, encryption type DES-CBC-CRC added to keytab WRFILE:/etc/krb5.keytab. kadmin:
kadmin: ktadd -k /usr/local/var/krb5kdc/kadmind.keytab => kadmin/admin kadmin/changepw kadmin: Entry for principal kadmin/admin@ATHENA.MIT.EDU with kvno 3, encryption type DES-CBC-CRC added to keytab WRFILE:/usr/local/var/krb5kdc/kadmind.keytab. kadmin:
To remove a principal from an existing keytab, use the kadmin
ktremove
command. The syntax is:
ktremove [-k[eytab] keytab] [-q] principal [kvno | all | old]
The ktremove
command takes the following switches:
ktremove
will use
the default keytab file (/etc/krb5.keytab
).
ktremove
to display less verbose
information.
For example:
kadmin: ktremove -k /usr/local/var/krb5kdc/kadmind.keytab kadmin/admin kadmin: Entry for principal kadmin/admin with kvno 3 removed from keytab WRFILE:/usr/local/var/krb5kdc/kadmind.keytab. kadmin:
In order to prevent intruders from resetting their system clocks in
order to continue to use expired tickets, Kerberos V5 is set up to
reject ticket requests from any host whose clock is not within the
specified maximum clock skew of the KDC (as specified in the
kdc.conf
file). Similarly, hosts are configured to reject
responses from any KDC whose clock is not within the specified maximum
clock skew of the host (as specified in the krb5.conf
file). The
default value for maximum clock skew is 300 seconds, or five minutes.
MIT suggests that you add a line to client machines'
/etc/rc
files to synchronize the machine's clock to your KDC at
boot time. On UNIX hosts, assuming you had a kdc called
kerberos
in your realm, this would be:
gettime -s kerberos
If the host is not likely to be rebooted frequently, you may also want to set up a cron job that adjusts the time on a regular basis.
Several aspects of Kerberos rely on name service. In order for Kerberos to provide its high level of security, it is less forgiving of name service problems than some other parts of your network. It is important that your Domain Name System (DNS) entries and your hosts have the correct information.
Each host's canonical name must be the fully-qualified host name (including the domain), and each host's IP address must reverse-resolve to the canonical name.
Other than the localhost
entry, make all entries in each
machine's /etc/hosts
file in the following form:
IP address fully-qualified hostname aliases
Here is a sample /etc/hosts
file:
# this is a comment 127.0.0.1 localhost localhost@mit.edu 10.0.0.6 daffodil.mit.edu trillium wake-robin
Additionally, on Solaris machines, you need to be sure the “hosts”
entry in the file
/etc/nsswitch.conf
includes the source
“dns” as well as “file”.
Finally, each host's keytab file must include a host/key pair for the
host's canonical name. You can list the keys in a keytab file by
issuing the command klist -k
. For example:
viola# klist -k Keytab name: /etc/krb5.keytab KVNO Principal ---- ------------------------------------------------------------ 1 host/daffodil.mit.edu@ATHENA.MIT.EDU
If you telnet to the host with a fresh credentials cache (ticket file),
and then klist
, the host's service principal should be
host/fully-qualified-hostname@REALM_NAME.
If you need off-site users to be able to get Kerberos tickets in your realm, they must be able to get to your KDC. This requires either that you have a slave KDC outside your firewall, or you configure your firewall to allow UDP requests into at least one of your KDCs, on whichever port the KDC is running. (The default is port 88; other ports may be specified in the KDC's kdc.conf file.) Similarly, if you need off-site users to be able to change their passwords in your realm, they must be able to get to your Kerberos admin server. The default port for the admin server is 749.
If your on-site users inside your firewall will need to get to KDCs in other realms, you will also need to configure your firewall to allow outgoing TCP and UDP requests to port 88. Additionally, if they will need to get to any Kerberos V4 KDCs, you may also need to allow TCP and UDP requests to port 750. If your on-site users inside your firewall will need to get to Kerberos admin servers in other realms, you will also need to allow outgoing TCP and UDP requests to port 749.
If any of your KDCs are outside your firewall, you will need to allow
kprop
requests to get through to the remote KDC. Kprop
uses the krb5_prop service on port 754 (tcp).
If you need your off-site users to have access to machines inside your
firewall, you need to allow TCP connections from their off-site hosts on
the appropriate ports for the programs they will be using. The
following lines from /etc/services
show the default port numbers
for the Kerberos V5 programs:
ftp 21/tcp # Kerberos ftp and telnet use the telnet 23/tcp # default ports kerberos 88/udp kdc # Kerberos V5 KDC kerberos 88/tcp kdc # Kerberos V5 KDC klogin 543/tcp # Kerberos authenticated rlogin kshell 544/tcp cmd # and remote shell kerberos-adm 749/tcp # Kerberos 5 admin/changepw kerberos-adm 749/udp # Kerberos 5 admin/changepw krb5_prop 754/tcp # Kerberos slave propagation eklogin 2105/tcp # Kerberos auth. & encrypted rlogin krb524 4444/tcp # Kerberos 5 to 4 ticket translator
By default, Kerberos V5 telnet
and ftp
use the same
ports as the standard telnet
and ftp
programs, so if you
already allow telnet and ftp connections through your firewall, the
Kerberos V5 versions will get through as well. If you do not
already allow telnet and ftp connections through your firewall, but need
your users to be able to use Kerberos V5 telnet and ftp, you can
either allow ftp and telnet connections on the standard ports, or switch
these programs to non-default port numbers and allow ftp and telnet
connections on those ports to get through.
Kerberos V5 rlogin
uses the klogin
service, which by
default uses port 543. Encrypted Kerberos V5
rlogin uses the eklogin
service, which by default uses port
2105.
Kerberos V5 rsh
uses the kshell
service, which by
default uses port 544. However, the server must
be able to make a TCP connection from the kshell port to an arbitrary
port on the client, so if your users are to be able to use rsh
from outside your firewall, the server they connect to must be able to
send outgoing packets to arbitrary port numbers. Similarly, if your
users need to run rsh
from inside your firewall to hosts outside
your firewall, the outside server needs to be able to connect to an
arbitrary port on the machine inside your firewall. Because
Kerberos V5 rcp
uses rsh
, the same issues apply. If
you need to use rsh
(or rcp
) through your firewall and
are concerned with the security implications of allowing connections to
arbitrary ports, MIT suggests that you have rules that
specifically name these applications and, if possible, list the allowed
hosts.
The book UNIX System Security, by David Curry, is a good starting point for learning to configure firewalls.
When you back up a secure host, you should exclude the host's keytab file from the backup. If someone obtained a copy of the keytab from a backup, that person could make any host masquerade as the host whose keytab was compromised. This could be particularly dangerous if the compromised keytab was from one of your KDCs. If the machine has a disk crash and the keytab file is lost, it is easy to generate another keytab file. (See Adding Principals to Keytabs.) If you are unable to exclude particular files from backups, you should ensure that the backups are kept as secure as the host's root password.
As with any file, it is possible that your Kerberos database could become corrupted. If this happens on one of the slave KDCs, you might never notice, since the next automatic propagation of the database would install a fresh copy. However, if it happens to the master KDC, the corrupted database would be propagated to all of the slaves during the next propagation. For this reason, MIT recommends that you back up your Kerberos database regularly. Because the master KDC is continuously dumping the database to a file in order to propagate it to the slave KDCs, it is a simple matter to have a cron job periodically copy the dump file to a secure machine elsewhere on your network. (Of course, it is important to make the host where these backups are stored as secure as your KDCs, and to encrypt its transmission across your network.) Then if your database becomes corrupted, you can load the most recent dump onto the master KDC. (See Restoring a Kerberos Database from a Dump File.)
In any complex software, there will be bugs. If you have successfully
built and installed Kerberos V5, please use the krb5-send-pr
program to fill out a Problem Report should you encounter any errors in
our software.
Bug reports that include proposed fixes are especially welcome. If you do include fixes, please send them using either context diffs or unified diffs (using diff -c or diff -u, respectively). Please be careful when using “cut and paste” or other such means to copy a patch into a bug report; depending on the system being used, that can result in converting TAB characters into spaces, which makes applying the patches more difficult.
The krb5-send-pr
program is installed in the directory
/usr/local/sbin
.
The krb5-send-pr
program enters the problem report into our
Problem Report Management System (PRMS), which automatically assigns it
to the engineer best able to help you with problems in the assigned
category.
The krb5-send-pr
program will try to intelligently fill in as
many fields as it can. You need to choose the category,
class, severity, and priority of the problem, as well
as giving us as much information as you can about its exact nature.
The PR category will be one of:
krb5-admin krb5-appl krb5-build krb5-clients krb5-doc krb5-kdc krb5-libs krb5-misc pty telnet test
Choose the category that best describes the area under which your problem falls.
The class can be sw-bug, doc-bug, change-request, or support. The first two are exactly as their names imply. Use change-request when the software is behaving according to specifications, but you want to request changes in some feature or behavior. The support class is intended for more general questions about building or using Kerberos V5.
The severity of the problem indicates the problem's impact on the usability of Kerberos V5. If a problem is critical, that means the product, component or concept is completely non-operational, or some essential functionality is missing, and no workaround is known. A serious problem is one in which the product, component or concept is not working properly or significant functionality is missing. Problems that would otherwise be considered critical are rated serious when a workaround is known. A non-critical problem is one that is indeed a problem, but one that is having a minimal effect on your ability to use Kerberos V5. E.g., The product, component or concept is working in general, but lacks features, has irritating behavior, does something wrong, or doesn't match its documentation. The default severity is serious.
The priority indicates how urgent this particular problem is in relation to your work. Note that low priority does not imply low importance. A priority of high means a solution is needed as soon as possible. A priority of medium means the problem should be solved no later than the next release. A priority of low means the problem should be solved in a future release, but it is not important to your work how soon this happens. The default priority is medium.
Note that a given severity does not necessarily imply a given priority. For example, a non-critical problem might still have a high priority if you are faced with a hard deadline. Conversely, a serious problem might have a low priority if the feature it is disabling is one that you do not need.
It is important that you fill in the release field and tell us what changes you have made, if any.
A sample filled-out form from a company named “Toasters, Inc.” might look like this:
To: krb5-bugs@mit.edu Subject: misspelled "Kerberos" in title of installation guide From: jcb Reply-To: jcb Cc: X-send-pr-version: 3.99 >Submitter-Id: mit >Originator: Jeffrey C. Gilman Bigler >Organization: mit >Confidential: no >Synopsis: Misspelled "Kerberos" in title of installation guide >Severity: non-critical >Priority: low >Category: krb5-doc >Class: doc-bug >Release: 1.0-development >Environment: <machine, os, target, libraries (multiple lines)> System: ULTRIX imbrium 4.2 0 RISC Machine: mips >Description: Misspelled "Kerberos" in title of "Kerboros V5 Installation Guide" >How-To-Repeat: N/A >Fix: Correct the spelling.
If the krb5-send-pr
program does not work for you, or if you did
not get far enough in the process to have an installed and working
krb5-send-pr
, you can generate your own form, using the above as
an example.
This is the Kerberos v5 library error code table. Protocol error codes
are
ERROR_TABLE_BASE_krb5 + the protocol error code number; other
error codes start at ERROR_TABLE_BASE_krb5 + 128.
This is the Kerberos v5 database library error code table.
This is the Kerberos v5 magic numbers error code table.
Generic GSSAPI Errors:
Kerberos 5 GSSAPI Errors:
This is a complete listing of the time zones recognized by the
kadmin
command.