This is krb5-install.info, produced by makeinfo version 4.5 from
install.texinfo.

Copyright (C) 1985-2010 by the Massachusetts Institute of Technology.
INFO-DIR-SECTION Kerberos
START-INFO-DIR-ENTRY
* krb5-install: (krb5-install).         Kerberos V5 Installation Guide
END-INFO-DIR-ENTRY


File: krb5-install.info,  Node: HPUX,  Next: Solaris versions 2.0 through 2.3,  Prev: BSDI,  Up: OS Incompatibilities

HPUX
----

The native (bundled) compiler for HPUX currently will not work, because
it is not a full ANSI C compiler.  The optional ANSI C compiler should
work as long as you give it the `-Ae' flag (i.e. `./configure CC='cc
-Ae'').  This is equivalent to `./configure CC='c89 -D_HPUX_SOURCE'',
which was the previous recommendation.  This has only been tested
recently for HPUX 10.20.

You will need to configure with `--disable-shared --enable-static',
because as of 1.4 we don't have support for HPUX shared library
finalization routines, nor the option (yet) to ignore that lack of
support (which means repeated `dlopen'/`dlclose' cycles on the Kerberos
libraries may not be safe) and build the shared libraries anyways.

You will also need to configure the build tree with
`--disable-thread-support' if you are on HPUX 10 and do not have the
DCE development package installed, because that's where the `pthread.h'
header file is found.  (We don't know if our code will work with such a
package installed, because according to some HP documentation, their
`pthread.h' has to be included before any other header files, and our
code doesn't do that.)

If you use GCC, it may work, but some versions of GCC have omitted
certain important preprocessor defines, like `__STDC_EXT__' and
`__hpux'.


File: krb5-install.info,  Node: Solaris versions 2.0 through 2.3,  Next: Solaris 2.X,  Prev: HPUX,  Up: OS Incompatibilities

Solaris versions 2.0 through 2.3
--------------------------------

The `gethostbyname()' routine is broken; it does not return a fully
qualified domain name, even if you are using the Domain Name Service
routines.  Since Kerberos V5 uses the fully qualified domain name as the
second component of a service principal (i.e,
`host/tsx-11.mit.edu@ATHENA.MIT.EDU'), this causes problems for servers
who try to figure out their own fully qualified domain name.

Workarounds:

  1.    Supply your own resolver library. (such as bind-4.9.3pl1
     available from ftp.vix.com)

  2.    Upgrade to Solaris 2.4

  3.    Make sure your /etc/nsswitch.conf has `files' before `dns' like:

          hosts:      files dns

     and then in /etc/hosts, make sure there is a line with your
     workstation's IP address and hostname, with the fully qualified
     domain name first.  Example:

          18.172.1.4      dcl.mit.edu dcl

     Note that making this change may cause other programs in your
     environment to break or behave differently.



File: krb5-install.info,  Node: Solaris 2.X,  Next: Solaris 9,  Prev: Solaris versions 2.0 through 2.3,  Up: OS Incompatibilities

Solaris 2.X
-----------

You must compile Kerberos V5 without the UCB compatibility libraries.
This means that `/usr/ucblib' must not be in the LD_LIBRARY_PATH
environment variable when you compile it.  Alternatively you can use
the `-i' option to `cc', by using the specifying `CFLAGS=-i' option to
`configure'.

If you are compiling for a 64-bit execution environment, you may need
to configure with the option `CFLAGS="-D_XOPEN_SOURCE=500
-D__EXTENSIONS__"'.  This is not well tested; at MIT we work primarily
with the 32-bit execution environment.


File: krb5-install.info,  Node: Solaris 9,  Next: SGI Irix 5.X,  Prev: Solaris 2.X,  Up: OS Incompatibilities

Solaris 9
---------

Solaris 9 has a kernel race condition which causes the final output
written to the slave side of a pty to be lost upon the final close() of
the slave device.  This causes the dejagnu-based tests to fail
intermittently.  A workaround exists, but requires some help from the
scheduler, and the "make check" must be executed from a shell with
elevated priority limits.

Run something like

`priocntl -s -c FX -m 30 -p 30 -i pid nnnn'

as root, where `nnnn' is the pid of the shell whose priority limit you
wish to raise.

Sun has released kernel patches for this race condition.  Apply patch
117171-11 for sparc, or patch 117172-11 for x86.  Later revisions of
the patches should also work.  It is not necessary to run "make check"
from a shell with elevated priority limits once the patch has been
applied.


File: krb5-install.info,  Node: SGI Irix 5.X,  Next: Ultrix 4.2/3,  Prev: Solaris 9,  Up: OS Incompatibilities

SGI Irix 5.X
------------

If you are building in a tree separate from the source tree, the vendors
version of make does not work properly with regards to `VPATH'. It also
has problems with standard inference rules in 5.2 (not tested yet in
5.3) so one needs to use GNU's make.

Under 5.2, there is a bug in the optional System V `-lsocket' library
in which the routine `gethostbyname()' is broken. The system supplied
version in `-lc' appears to work though so one may simply specify
`--with-netlib' option to `configure'.

In 5.3, `gethostbyname()' is no longer present in `-lsocket' and is no
longer an issue.


File: krb5-install.info,  Node: Ultrix 4.2/3,  Prev: SGI Irix 5.X,  Up: OS Incompatibilities

Ultrix 4.2/3
------------

The DEC MIPS platform currently will not support the native compiler,
since the Ultrix compiler is not a full ANSI C compiler.  You should use
GCC instead.


File: krb5-install.info,  Node: Using Autoconf,  Prev: OS Incompatibilities,  Up: Building Kerberos V5

Using `Autoconf'
================

(If you are not a developer, you can skip this section.)

In most of the Kerberos V5 source directories, there is a `configure'
script which automatically determines the compilation environment and
creates the proper Makefiles for a particular platform.  These
`configure' files are generated using `autoconf', which can be found in
the `src/util/autoconf' directory in the distribution.

Normal users will not need to worry about running `autoconf'; the
distribution comes with the `configure' files already prebuilt.
Developers who wish to modify the `configure.in' files should see *Note
Overview: (autoconf)Top.

Note that in order to run `autoconf', you must have GNU `m4' in your
path.  Before you use the `autoconf' in the Kerberos V5 source tree,
you may also need to run `configure', and then run `make' in the
`src/util/autoconf' directory in order to properly set up `autoconf'.

One tool which is provided for the convenience of developers can be
found in `src/util/reconf'.  This program should be run while the
current directory is the top source directory.  It will automatically
rebuild any `configure' files which need rebuilding.  If you know that
you have made a change that will require that all the `configure' files
need to be rebuilt from scratch, specify the `--force' option:

     % cd /u1/krb5-1.9/src
     % ./util/reconf --force

The developmental sources are a raw source tree (before it's been
packaged for public release), without the pre-built `configure' files.
In order to build from such a source tree, you must do:

     % cd krb5/util/autoconf
     % ./configure
     % make
     % cd ../..
     % util/reconf

Then follow the instructions for building packaged source trees (above).
To install the binaries into a binary tree, do:

     % cd /u1/krb5-1.9/src
     % make all
     % make install DESTDIR=somewhere-else


File: krb5-install.info,  Node: Installing Kerberos V5,  Next: Upgrading Existing Kerberos V5 Installations,  Prev: Building Kerberos V5,  Up: Top

Installing Kerberos V5
**********************

The sections of this chapter describe procedures for installing
Kerberos V5 on:

  1. The KDCs

  2. UNIX client machines

  3. UNIX Application Servers

* Menu:

* Installing KDCs::
* Installing and Configuring UNIX Client Machines::
* UNIX Application Servers::


File: krb5-install.info,  Node: Installing KDCs,  Next: Installing and Configuring UNIX Client Machines,  Prev: Installing Kerberos V5,  Up: Installing Kerberos V5

Installing KDCs
===============

The Key Distribution Centers (KDCs) issue Kerberos tickets.  Each KDC
contains a copy of the Kerberos database.  The master KDC contains the
master copy of the database, which it propagates to the slave KDCs at
regular intervals.  All database changes (such as password changes) are
made on the master KDC.

Slave KDCs provide Kerberos ticket-granting services, but not database
administration.  This allows clients to continue to obtain tickets when
the master KDC is unavailable.

MIT recommends that you install all of your KDCs to be able to function
as either the master or one of the slaves.  This will enable you to
easily switch your master KDC with one of the slaves if necessary.
(*Note Switching Master and Slave KDCs::.)  This installation procedure
is based on that recommendation.

* Menu:

* Install the Master KDC::
* Install the Slave KDCs::
* Back on the Master KDC::
* Finish Installing the Slave KDCs::
* Add Kerberos Principals to the Database::
* Limit Access to the KDCs::
* Switching Master and Slave KDCs::
* Incremental Database Propagation::


File: krb5-install.info,  Node: Install the Master KDC,  Next: Install the Slave KDCs,  Prev: Installing KDCs,  Up: Installing KDCs

Install the Master KDC
----------------------

This installation procedure will require you to go back and forth a
couple of times between the master KDC and each of the slave KDCs.  The
first few steps must be done on the master KDC.

* Menu:

* Edit the Configuration Files::
* krb5.conf::
* kdc.conf::
* Create the Database::
* Add Administrators to the Acl File::
* Add Administrators to the Kerberos Database::
* Create a kadmind Keytab (optional)::
* Start the Kerberos Daemons::


File: krb5-install.info,  Node: Edit the Configuration Files,  Next: krb5.conf,  Prev: Install the Master KDC,  Up: Install the Master KDC

Edit the Configuration Files
............................

Modify the configuration files, `/etc/krb5.conf' and
`/usr/local/var/krb5kdc/kdc.conf' to reflect the correct information
(such as the hostnames and realm name) for your realm.  MIT recommends
that you keep `krb5.conf' in `/etc'.

Most of the tags in the configuration have default values that will
work well for most sites.  There are some tags in the `krb5.conf' file
whose values must be specified, and this section will explain those as
well as give an overview of all of the sections in both configuration
files.  For more information on changing defaults with the
configuration files, see the Kerberos V5 System Administrator's Guide
sections on configuration files.


File: krb5-install.info,  Node: krb5.conf,  Next: kdc.conf,  Prev: Edit the Configuration Files,  Up: Install the Master KDC

krb5.conf
.........

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 can include other files using either of the
following directives at the beginning of a line:

     include FILENAME
     includedir DIRNAME

FILENAME or DIRNAME should be an absolute path.  The named file or
directory must exist and be readable.  Including a directory includes
all files within the directory whose names consist solely of
alphanumeric characters, dashes, or underscores.  Included profile files
are syntactically independent of their parents, so each included file
must begin with a section header.

The `krb5.conf' file may contain any or all of the following sections:

libdefaults
     Contains default values used by the Kerberos V5 library.

login
     Contains default values used by the Kerberos V5 login program.

appdefaults
     Contains default values that can be used by Kerberos V5
     applications.

realms
     Contains subsections keyed by Kerberos realm names.  Each
     subsection describes realm-specific information, including where
     to find the Kerberos servers for that realm.

domain_realm
     Contains relations which map domain names and subdomains onto
     Kerberos realm names.  This is used by programs to determine what
     realm a host should be in, given its fully qualified domain name.

logging
     Contains relations which determine how Kerberos programs are to
     perform logging.

capaths
     Contains the authentication paths used with direct
     (nonhierarchical) cross-realm authentication.  Entries in this
     section are used by the client to determine the intermediate
     realms which may be used in cross-realm authentication.  It is
     also used by the end-service when checking the transited field for
     trusted intermediate realms.

plugins
     Contains tags to register dynamic plugin modules and to turn
     modules on and off.


If you are not using DNS TXT records, you must specify the
`default_realm' in the `libdefaults' section.  If you are not using DNS
SRV records, you must include the `kdc' tag for each realm in the
`realms' section.  To communicate with the kadmin server in each realm,
the `admin_server' tag must be set in the `realms' section.  If your
domain name and realm name are not the same, you must provide a
translation in `domain_realm'.  It is also higly recommeneded that you
create a `[logging]' stanza if the computer will be functioning as a
KDC so that the KDC and kadmind will generate logging output.

An example `krb5.conf' file:

     [libdefaults]
         default_realm = ATHENA.MIT.EDU
     
     [realms]
         ATHENA.MIT.EDU = {
         	kdc = kerberos.mit.edu
         	kdc = kerberos-1.mit.edu
         	kdc = kerberos-2.mit.edu
         	admin_server = kerberos.mit.edu
         {
     
     [logging]
         kdc = FILE:/var/log/krb5kdc.log
         admin_server = FILE:/var/log/kadmin.log
         default = FILE:/var/log/krb5lib.log


File: krb5-install.info,  Node: kdc.conf,  Next: Create the Database,  Prev: krb5.conf,  Up: Install the Master KDC

kdc.conf
........

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.  (*Note krb5.conf::.)  The `kdc.conf' file may contain any or all
of the following three sections:

kdcdefaults
     Contains default values for overall behavior of the KDC.

realms
     Contains subsections keyed by Kerberos realm names.  Each
     subsection describes realm-specific information, including where
     to find the Kerberos servers for that realm.

logging
     Contains relations which determine how Kerberos programs are to
     perform logging.


File: krb5-install.info,  Node: Create the Database,  Next: Add Administrators to the Acl File,  Prev: kdc.conf,  Up: Install the Master KDC

Create the Database
...................

You will use the `kdb5_util' command _on the Master KDC_ to create the
Kerberos database and the optional stash file.  The "stash file" is a
local copy of the master key that resides in encrypted form on the
KDC's local disk.  The stash file is used to authenticate the KDC to
itself automatically before starting the `kadmind' and `krb5kdc'
daemons (e.g., as part of the machine's boot sequence).  The stash
file, like the keytab file (see *Note The Keytab File::, for more
information) is a potential point-of-entry for a break-in, and if
compromised, would allow unrestricted access to the Kerberos database.
If you choose to install a stash file, it should be readable only by
root, and should exist only on the KDC's local disk.  The file should
not be part of any backup of the machine, unless access to the backup
data is secured as tightly as access to the master password itself.

If you choose not to install a stash file, the KDC will prompt you for
the master key each time it starts up.  This means that the KDC will
not be able to start automatically, such as after a system reboot.

Note that `kdb5_util' will prompt you for the master key for the
Kerberos database.  This key can be any string.  A good key is one you
can remember, but that no one else can guess.  Examples of bad keys are
words that can be found in a dictionary, any common or popular name,
especially a famous person (or cartoon character), your username in any
form (e.g., forward, backward, repeated twice, etc.), and any of the
sample keys that appear in this manual.  One example of a key which
might be good if it did not appear in this manual is "MITiys4K5!",
which represents the sentence "MIT is your source for Kerberos 5!"
(It's the first letter of each word, substituting the numeral "4" for
the word "for", and includes the punctuation mark at the end.)

The following is an example of how to create a Kerberos database and
stash file on the master KDC, using the `kdb5_util' command.  (The line
that begins with => is a continuation of the previous line.)  Replace
ATHENA.MIT.EDU with the name of your Kerberos realm.

     shell% /usr/local/sbin/kdb5_util create -r ATHENA.MIT.EDU -s
     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%

This will create five files in the directory specified in your
`kdc.conf' file:  two Kerberos database files, `principal.db', and
`principal.ok'; the Kerberos administrative database file,
`principal.kadm5'; the administrative database lock file,
`principal.kadm5.lock'; and the stash file, `.k5stash'.  (The default
directory is `/usr/local/var/krb5kdc'.)  If you do not want a stash
file, run the above command without the `-s' option.


File: krb5-install.info,  Node: Add Administrators to the Acl File,  Next: Add Administrators to the Kerberos Database,  Prev: Create the Database,  Up: Install the Master KDC

Add Administrators to the Acl File
..................................

Next, you need create an Access Control List (acl) file, and put the
Kerberos principal of at least one of the administrators into it.  This
file is used by the `kadmind' daemon to control which principals may
view and make privileged modifications to the Kerberos database files.
The filename should match the value you have set for "acl_file" in your
`kdc.conf' file.  The default file name is
`/usr/local/var/krb5kdc/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:

a
     allows the addition of principals or policies in the database.

A
     disallows the addition of principals or policies in the database.

d
     allows the deletion of principals or policies in the database.

D
     disallows the deletion of principals or policies in the database.

m
     allows the modification of principals or policies in the database.

M
     disallows the modification of principals or policies in the
     database.

c
     allows the changing of passwords for principals in the database.

C
     disallows the changing of passwords for principals in the database.

i
     allows inquiries to the database.

I
     disallows inquiries to the database.

l
     allows the listing of principals or policies in the database.

L
     disallows the listing of principals or policies in the database.

s
     allows the explicit setting of the key for a principal

S
     disallows the explicit setting of the key for a principal

*
     All privileges (admcil).

x
     All privileges (admcil); identical to "*".

The restrictions are a string of flags.  Allowed restrictions are:

[+ -]flagname
     flag is forced to indicated value.  The permissible flags are the
     same as the `+' and `-' flags for the `kadmin addprinc' and
     `modprinc' commands.

-clearpolicy
     policy is forced to clear

-policy pol
     policy is forced to be pol

expire time
pwexpire time
maxlife time
maxrenewlife time
     associated value will be forced to MIN(time, requested value)

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.


File: krb5-install.info,  Node: Add Administrators to the Kerberos Database,  Next: Create a kadmind Keytab (optional),  Prev: Add Administrators to the Acl File,  Up: Install the Master KDC

Add Administrators to the Kerberos Database
...........................................

Next you need to add administrative principals to the Kerberos database.
(You must add at least one now.)  To do this, use `kadmin.local' _on
the master KDC_.  The administrative principals you create should be
the ones you added to the ACL file.  (See *Note Add Administrators to
the Acl File::.)  In the following example, the administration
principal `admin/admin' is created:

     shell% /usr/local/sbin/kadmin.local
     kadmin.local: addprinc admin/admin@ATHENA.MIT.EDU
     NOTICE: no policy specified for "admin/admin@ATHENA.MIT.EDU";
     assigning "default".
     Enter password for principal admin/admin@ATHENA.MIT.EDU:  <= Enter a password.
     Re-enter password for principal admin/admin@ATHENA.MIT.EDU:  <= Type it again.
     Principal "admin/admin@ATHENA.MIT.EDU" created.
     kadmin.local:


File: krb5-install.info,  Node: Create a kadmind Keytab (optional),  Next: Start the Kerberos Daemons,  Prev: Add Administrators to the Kerberos Database,  Up: Install the Master KDC

Create a kadmind Keytab (optional)
..................................

The kadmind keytab is the key that the legacy admininstration daemons
`kadmind4' and `v5passwdd' will use to decrypt administrators' or
clients' Kerberos tickets to determine whether or not they should have
access to the database.  You need to create the kadmin keytab with
entries for the principals `kadmin/admin' and `kadmin/changepw'.
(These principals are placed in the Kerberos database automatically
when you create it.)  To create the kadmin keytab, run `kadmin.local'
and use the `ktadd' command, as in the following example.  (The line
beginning with => is a continuation of the previous line.):

     shell% /usr/local/sbin/kadmin.local
     kadmin.local: ktadd -k /usr/local/var/krb5kdc/kadm5.keytab
     => kadmin/admin kadmin/changepw
      Entry for principal kadmin/admin with kvno 5, encryption
     	type Triple DES cbc mode with HMAC/sha1 added to keytab
     	WRFILE:/usr/local/var/krb5kdc/kadm5.keytab.
     Entry for principal kadmin/admin with kvno 5, encryption type DES cbc mode
     	with CRC-32 added to keytab
     	WRFILE:/usr/local/var/krb5kdc/kadm5.keytab.
     Entry for principal kadmin/changepw with kvno 5, encryption
     	type Triple DES cbc mode with HMAC/sha1 added to keytab
     	WRFILE:/usr/local/var/krb5kdc/kadm5.keytab.
     Entry for principal kadmin/changepw with kvno 5,
     	encryption type DES cbc mode with CRC-32 added to keytab
     	WRFILE:/usr/local/var/krb5kdc/kadm5.keytab.
     kadmin.local: quit
     shell%

As specified in the `-k' argument, `ktadd' will save the extracted
keytab as
`/usr/local/var/krb5kdc/kadm5.keytab'.  The filename you use must be
the one specified in your `kdc.conf' file.


File: krb5-install.info,  Node: Start the Kerberos Daemons,  Prev: Create a kadmind Keytab (optional),  Up: Install the Master KDC

Start the Kerberos Daemons on the Master KDC
............................................

At this point, you are ready to start the Kerberos daemons on the Master
KDC.  To do so, type:

     shell% /usr/local/sbin/krb5kdc
     shell% /usr/local/sbin/kadmind

Each daemon will fork and run in the background.  Assuming you want
these daemons to start up automatically at boot time, you can add them
to the KDC's `/etc/rc' or `/etc/inittab' file.  You need to have a
stash file in order to do this.

You can verify that they started properly by checking for their startup
messages in the logging locations you defined in `/etc/krb5.conf'.
(*Note Edit the Configuration Files::.)  For example:

     shell% tail /var/log/krb5kdc.log
     Dec 02 12:35:47 beeblebrox krb5kdc[3187](info): commencing operation
     shell% tail /var/log/kadmin.log
     Dec 02 12:35:52 beeblebrox kadmind[3189](info): starting

Any errors the daemons encounter while starting will also be listed in
the logging output.


File: krb5-install.info,  Node: Install the Slave KDCs,  Next: Back on the Master KDC,  Prev: Install the Master KDC,  Up: Installing KDCs

Install the Slave KDCs
----------------------

You are now ready to start configuring the slave KDCs.  Assuming you are
setting the KDCs up so that you can easily switch the master KDC with
one of the slaves, you should perform each of these steps on the master
KDC as well as the slave KDCs, unless these instructions specify
otherwise.

* Menu:

* Create Host Keys for the Slave KDCs::
* Extract Host Keytabs for the KDCs::
* Set Up the Slave KDCs for Database Propagation::


File: krb5-install.info,  Node: Create Host Keys for the Slave KDCs,  Next: Extract Host Keytabs for the KDCs,  Prev: Install the Slave KDCs,  Up: Install the Slave KDCs

Create Host Keys for the Slave KDCs
...................................

Each KDC needs a host principal in the Kerberos database.  You can enter
these from any host, once the `kadmind' daemon is running.  For
example, if your master KDC were called kerberos.mit.edu, and you had
two KDC slaves named kerberos-1.mit.edu and kerberos-2.mit.edu, you
would type the following:

     shell% /usr/local/sbin/kadmin
     kadmin: addprinc -randkey host/kerberos.mit.edu
     NOTICE: no policy specified for "host/kerberos.mit.edu@ATHENA.MIT.EDU";
     assigning "default"
     Principal "host/kerberos.mit.edu@ATHENA.MIT.EDU" created.
     kadmin: addprinc -randkey host/kerberos-1.mit.edu
     NOTICE: no policy specified for "host/kerberos-1.mit.edu@ATHENA.MIT.EDU";
     assigning "default"
     Principal "host/kerberos-1.mit.edu@ATHENA.MIT.EDU" created.
     kadmin: addprinc -randkey host/kerberos-2.mit.edu
     NOTICE: no policy specified for "host/kerberos-2.mit.edu@ATHENA.MIT.EDU";
     assigning "default"
     Principal "host/kerberos-2.mit.edu@ATHENA.MIT.EDU" created.
     kadmin:

It is not actually necessary to have the master KDC server in the
Kerberos database, but it can be handy if:

   * anyone will be logging into the machine as something other than
     root

   * you want to be able to swap the master KDC with one of the slaves
     if necessary.


File: krb5-install.info,  Node: Extract Host Keytabs for the KDCs,  Next: Set Up the Slave KDCs for Database Propagation,  Prev: Create Host Keys for the Slave KDCs,  Up: Install the Slave KDCs

Extract Host Keytabs for the KDCs
.................................

Each KDC (including the master) needs a keytab to decrypt tickets.
Ideally, you should extract each keytab locally on its own KDC.  If this
is not feasible, you should use an encrypted session to send them across
the network.  To extract a keytab on a KDC called kerberos.mit.edu, you
would execute the following command:

     kadmin: ktadd host/kerberos.mit.edu
     kadmin: Entry for principal host/kerberos.mit.edu@ATHENA.MIT.EDU with
          kvno 1, encryption type DES-CBC-CRC added to keytab
          WRFILE:/etc/krb5.keytab.
     kadmin:

Note that the principal must exist in the Kerberos database in order to
extract the keytab.


File: krb5-install.info,  Node: Set Up the Slave KDCs for Database Propagation,  Prev: Extract Host Keytabs for the KDCs,  Up: Install the Slave KDCs

Set Up the Slave KDCs for Database Propagation
..............................................

The database is propagated from the master KDC to the slave KDCs via the
`kpropd' daemon.  To set up propagation, create a file on each KDC,
named `/usr/local/var/krb5kdc/kpropd.acl', containing the principals
for each of the KDCs.  For example, if the master KDC were
`kerberos.mit.edu', the slave KDCs were `kerberos-1.mit.edu' and
`kerberos-2.mit.edu', and the realm were `ATHENA.MIT.EDU', then the
file's contents would be:

     host/kerberos.mit.edu@ATHENA.MIT.EDU
     host/kerberos-1.mit.edu@ATHENA.MIT.EDU
     host/kerberos-2.mit.edu@ATHENA.MIT.EDU

Then, add the following line to `/etc/inetd.conf' file on each KDC:

     krb5_prop stream tcp nowait root /usr/local/sbin/kpropd kpropd

You also need to add the following lines to `/etc/services' on each KDC:

     kerberos        88/udp      kdc       # Kerberos authentication (udp)
     kerberos        88/tcp      kdc       # Kerberos authentication (tcp)
     krb5_prop       754/tcp               # Kerberos slave propagation
     kerberos-adm    749/tcp               # Kerberos 5 admin/changepw (tcp)
     kerberos-adm    749/udp               # Kerberos 5 admin/changepw (udp)


File: krb5-install.info,  Node: Back on the Master KDC,  Next: Finish Installing the Slave KDCs,  Prev: Install the Slave KDCs,  Up: Installing KDCs

Back on the Master KDC
----------------------

Now that the slave KDCs are able to accept database propagation, you'll
need to propagate the database to each of them.

* Menu:

* Propagate the Database to Each Slave KDC::


File: krb5-install.info,  Node: Propagate the Database to Each Slave KDC,  Prev: Back on the Master KDC,  Up: Back on the Master KDC

Propagate the Database to Each Slave KDC
........................................

First, create a dump of the database on the master KDC, as follows:

     shell% /usr/local/sbin/kdb5_util dump /usr/local/var/krb5kdc/slave_datatrans
     shell%

Next, you need to manually propagate the database to each slave KDC, as
in the following example.  (The lines beginning with => are
continuations of the previous line.):

     /usr/local/sbin/kprop -f /usr/local/var/krb5kdc/slave_datatrans
     => kerberos-1.mit.edu
     /usr/local/sbin/kprop -f /usr/local/var/krb5kdc/slave_datatrans
     => kerberos-2.mit.edu

You will need a script to dump and propagate the database.  The
following is an example of a bourne shell script that will do this.
(Note that the line that begins with => is a continuation of the
previous line.  Remember that you need to replace /usr/local with the
name of the directory in which you installed Kerberos V5.)

     #!/bin/sh
     
     kdclist = "kerberos-1.mit.edu kerberos-2.mit.edu"
     
     /usr/local/sbin/kdb5_util "dump
     => /usr/local/var/krb5kdc/slave_datatrans"
     
     for kdc in $kdclist
     do
     /usr/local/sbin/kprop -f /usr/local/var/krb5kdc/slave_datatrans $kdc
     done

You will need to set up a cron job to run this script at the intervals
you decided on earlier (*Note Database Propagation::.)


File: krb5-install.info,  Node: Finish Installing the Slave KDCs,  Next: Add Kerberos Principals to the Database,  Prev: Back on the Master KDC,  Up: Installing KDCs

Finish Installing the Slave KDCs
--------------------------------

Now that the slave KDCs have copies of the Kerberos database, you can
create stash files for them and start the `krb5kdc' daemon.

* Menu:

* Create Stash Files on the Slave KDCs::
* Start the krb5kdc Daemon on Each KDC::


File: krb5-install.info,  Node: Create Stash Files on the Slave KDCs,  Next: Start the krb5kdc Daemon on Each KDC,  Prev: Finish Installing the Slave KDCs,  Up: Finish Installing the Slave KDCs

Create Stash Files on the Slave KDCs
....................................

Create stash files, by issuing the following commands on each slave KDC:

     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:  <= Enter the database master key.
     shell%

As mentioned above, the stash file is necessary for your KDCs to be able
authenticate to themselves, such as when they reboot.  You could run
your KDCs without stash files, but you would then need to type in the
Kerberos database master key by hand every time you start a KDC daemon.


File: krb5-install.info,  Node: Start the krb5kdc Daemon on Each KDC,  Prev: Create Stash Files on the Slave KDCs,  Up: Finish Installing the Slave KDCs

Start the krb5kdc Daemon on Each KDC
....................................

The final step in configuing your slave KDCs is to run the KDC daemon:

     shell% /usr/local/sbin/krb5kdc

As with the master KDC, you will probably want to add this command to
the KDCs' `/etc/rc' or `/etc/inittab' files, so they will start the
krb5kdc daemon automatically at boot time.


File: krb5-install.info,  Node: Add Kerberos Principals to the Database,  Next: Limit Access to the KDCs,  Prev: Finish Installing the Slave KDCs,  Up: Installing KDCs

Add Kerberos Principals to the Database
---------------------------------------

Once your KDCs are set up and running, you are ready to use `kadmin' to
load principals for your users, hosts, and other services into the
Kerberos database.  This procedure is described fully in the "Adding or
Modifying Principals" section of the Kerberos V5 System Administrator's
Guide.  (*Note Create Host Keys for the Slave KDCs::, for a brief
description.)  The keytab is generated by running `kadmin' and issuing
the `ktadd' command.


File: krb5-install.info,  Node: Limit Access to the KDCs,  Next: Switching Master and Slave KDCs,  Prev: Add Kerberos Principals to the Database,  Up: Installing KDCs

Limit Access to the KDCs
------------------------

To limit the possibility that your Kerberos database could be
compromised, MIT recommends that each KDC be a dedicated host, with
limited access.  If your KDC is also a file server, FTP server, Web
server, or even just a client machine, someone who obtained root access
through a security hole in any of those areas could gain access to the
Kerberos database.


File: krb5-install.info,  Node: Switching Master and Slave KDCs,  Next: Incremental Database Propagation,  Prev: Limit Access to the KDCs,  Up: Installing KDCs

Switching Master and Slave KDCs
-------------------------------

You may occasionally want to use one of your slave KDCs as the master.
This might happen if you are upgrading the master KDC, or if your master
KDC has a disk crash.

Assuming you have configured all of your KDCs to be able to function as
either the master KDC or a slave KDC (as this document recommends), all
you need to do to make the changeover is:

If the master KDC is still running, do the following on the _old_
master KDC:

  1. Kill the `kadmind' process.

  2. Disable the cron job that propagates the database.

  3. Run your database propagation script manually, to ensure that the
     slaves all have the latest copy of the database.  (*Note Propagate
     the Database to Each Slave KDC::.)  If there is a need to preserve
     per-principal policy information from the database, you should do
     a "kdb5_util dump -ov" in order to preserve that information and
     propogate that dump file securely by some means to the slave so
     that its database has the correct state of the per-principal
     policy information.

On the _new_ master KDC:

  1. Create a database keytab.  (*Note Create a kadmind Keytab
     (optional)::.)

  2. Start the `kadmind' daemon.  (*Note Start the Kerberos Daemons::.)

  3. Set up the cron job to propagate the database.  (*Note Propagate
     the Database to Each Slave KDC::.)

  4. Switch the CNAMEs of the old and new master KDCs.  (If you don't do
     this, you'll need to change the `krb5.conf' file on every client
     machine in your Kerberos realm.)



File: krb5-install.info,  Node: Incremental Database Propagation,  Prev: Switching Master and Slave KDCs,  Up: Installing KDCs

Incremental Database Propagation
--------------------------------

At some very large sites, dumping and transmitting the database can
take more time than is desirable for changes to propagate from the
master KDC to the slave KDCs.  The incremental propagation support
added in the 1.7 release is intended to address this.

With incremental propagation enabled, all programs on the master KDC
that change the database also write information about the changes to an
"update log" file, maintained as a circular buffer of a certain size.
A process on each slave KDC connects to a service on the master KDC
(currently implmented in the `kadmind' server) and periodically
requests the changes that have been made since the last check.  By
default, this check is done every two minutes.  If the database has
just been modified in the previous several seconds (currently the
threshold is hard-coded at 10 seconds), the slave will not retrieve
updates, but instead will pause and try again soon after.  This reduces
the likelihood that incremental update queries will cause delays for an
administrator trying to make a bunch of changes to the database at the
same time.

Incremental propagation uses the following entries in the per-realm
data in the KDC config file:

`iprop_enable' (boolean)
     If this is set to `true', then incremental propagation is enabled,
     and (as noted below) normal `kprop' propagation is disabled.  The
     default is `false'.

`iprop_master_ulogsize' (integer)
     This indicates the number of entries that should be retained in the
     update log.  The default is 1000; the maximum number is 2500.

`iprop_slave_poll' (time interval)
     This indicates how often the slave should poll the master KDC for
     changes to the database.  The default is two minutes.

`iprop_port' (integer)
     This specifies the port number to be used for incremental
     propagation.  This is required in both master and slave
     configuration files.

`iprop_logfile' (file name)
     This specifies where the update log file for the realm database is
     to be stored.  The default is to use the `database_name' entry from
     the `realms' section of the config file, with `.ulog' appended.
     (NOTE: If `database_name' isn't specified in the `realms' section,
     perhaps because the LDAP database back end is being used, or the
     file name is specified in the `dbmodules' section, then the
     hard-coded default for `database_name' is used.  Determination of
     the `iprop_logfile' default value will not use values from the
     `dbmodules' section.)

Both master and slave sides must have principals named
`kiprop/HOSTNAME' (where HOSTNAME is, as usual, the lower-case,
fully-qualified, canonical name for the host) registered and keys
stored in the default keytab file (`/etc/krb5.keytab').

On the master KDC side, the `kiprop/HOSTNAME' principal must be listed
in the `kadmind' ACL file `kadm5.acl', and given the `p' privilege.

On the slave KDC side, `kpropd' should be run.  When incremental
propagation is enabled, it will connect to the `kadmind' on the master
KDC and start requesting updates.

The normal `kprop' mechanism is disabled by the incremental propagation
support.  However, if the slave has been unable to fetch changes from
the master KDC for too long (network problems, perhaps), the log on the
master may wrap around and overwrite some of the updates that the slave
has not yet retrieved.  In this case, the slave will instruct the
master KDC to dump the current database out to a file and invoke a
one-time `kprop' propagation, with special options to also convey the
point in the update log at which the slave should resume fetching
incremental updates.  Thus, all the keytab and ACL setup previously
described for `kprop' propagation is still needed.

There are several known bugs and restrictions in the current
implementation:
   * The "call out to `kprop'" mechanism is a bit fragile; if the
     `kprop' propagation fails to connect for some reason, the process
     on the slave may hang waiting for it, and will need to be
     restarted.

   * The master and slave must be able to initiate TCP connections in
     both directions, without an intervening NAT.  They must also be
     able to communicate over IPv4, since MIT's kprop and RPC code does
     not currently support IPv6.

* Menu:

* Sun/MIT Incremental Propagation Differences::


File: krb5-install.info,  Node: Sun/MIT Incremental Propagation Differences,  Prev: Incremental Database Propagation,  Up: Incremental Database Propagation

Sun/MIT Incremental Propagation Differences
...........................................

Sun donated the original code for supporting incremental database
propagation to MIT.  Some changes have been made in the MIT source tree
that will be visible to administrators.  (These notes are based on
Sun's patches.  Changes to Sun's implementation since then may not be
reflected here.)

The Sun config file support looks for `sunw_dbprop_enable',
`sunw_dbprop_master_ulogsize', and `sunw_dbprop_slave_poll'.

The incremental propagation service is implemented as an ONC RPC
service.  In the Sun implementation, the service is registered with
`rpcbind' (also known as `portmapper') and the client looks up the port
number to contact.  In the MIT implementation, where interaction with
some modern versions of `rpcbind' doesn't always work well, the port
number must be specified in the config file on both the master and
slave sides.

The Sun implementation hard-codes pathnames in `/var/krb5' for the
update log and the per-slave `kprop' dump files.  In the MIT
implementation, the pathname for the update log is specified in the
config file, and the per-slave dump files are stored in
`/usr/local/var/krb5kdc/slave_datatrans_HOSTNAME'.


File: krb5-install.info,  Node: Installing and Configuring UNIX Client Machines,  Next: UNIX Application Servers,  Prev: Installing KDCs,  Up: Installing Kerberos V5

Installing and Configuring UNIX Client Machines
===============================================

Client machine installation is much more straightforward than
installation of the KDCs.

* Menu:

* Client Programs::
* Client Machine Configuration Files::


File: krb5-install.info,  Node: Client Programs,  Next: Client Machine Configuration Files,  Prev: Installing and Configuring UNIX Client Machines,  Up: Installing and Configuring UNIX Client Machines

Client Programs
---------------

The Kerberized client programs are `kinit', `klist', `kdestroy',
`kpasswd', and `ksu'.  All of these programs are in the directory
`/usr/local/bin'.

MIT recommends that you use `login.krb5' in place of `/bin/login' to
give your users a single-sign-on system.  You will need to make sure
your users know to use their Kerberos passwords when they log in.

You will also need to educate your users to use the ticket management
programs `kinit', `klist', `kdestroy', and to use the Kerberos programs
`ksu' and `kpasswd' in place of their non-Kerberos counterparts `su'
and `passwd'.


File: krb5-install.info,  Node: Client Machine Configuration Files,  Prev: Client Programs,  Up: Installing and Configuring UNIX Client Machines

Client Machine Configuration Files
----------------------------------

Each machine running Kerberos must have a `/etc/krb5.conf' file.
(*Note krb5.conf::.)

Also, for most UNIX systems, you must add the appropriate Kerberos
services to each client machine's `/etc/services' file.  If you are
using the default configuration for Kerberos V5, you should be able to
just insert the following code:

     kerberos      88/udp    kdc    # Kerberos V5 KDC
     kerberos      88/tcp    kdc    # Kerberos V5 KDC
     kerberos-adm  749/tcp          # Kerberos 5 admin/changepw
     kerberos-adm  749/udp          # Kerberos 5 admin/changepw
     krb5_prop     754/tcp          # Kerberos slave propagation
     krb524        4444/tcp         # Kerberos 5 to 4 ticket translator

* Menu:

* Mac OS X Configuration::

