<?Pub EntList bull rArr sect?><?Pub CX solbook(book(title()bookinfo()part(5)part(title()partintro()chapter()?><chapter id="setup-8"><?Pub Tag atict:info tracking="on" ref="0"?><?Pub Tag atict:user
user="sharonr" fullname="Sharon Veach"?><?Pub Tag atict:user user="kathys"
fullname="Kathy Slattery"?><title>Configuring the Kerberos Service (Tasks)</title><indexterm><primary>configuring</primary><secondary>Kerberos</secondary><tertiary>overview</tertiary>
</indexterm><highlights><para>This chapter provides configuration procedures for KDC servers, network
application servers, NFS servers, and Kerberos clients. Many of these procedures
require superuser access, so they should be used by system administrators
or advanced users. Cross-realm configuration procedures and other topics related
to KDC servers are also covered.</para><para>The following topics are covered.</para><itemizedlist><listitem><para><olink targetptr="setup-306" remap="internal">Configuring the Kerberos Service
(Task Map)</olink></para>
</listitem><listitem><para><olink targetptr="setup-9" remap="internal">Configuring KDC Servers</olink></para>
</listitem><listitem><para><olink targetptr="setup-148" remap="internal">Configuring Kerberos Clients</olink></para>
</listitem><listitem><para><olink targetptr="setup-87" remap="internal">Configuring Cross-Realm Authentication</olink></para>
</listitem><listitem><para><olink targetptr="setup-119" remap="internal">Configuring Kerberos Network
Application Servers</olink></para>
</listitem><listitem><para><olink targetptr="setup-97" remap="internal">Configuring Kerberos NFS Servers</olink></para>
</listitem><listitem><para><olink targetptr="setup-192" remap="internal">Synchronizing Clocks Between
KDCs and Kerberos Clients</olink></para>
</listitem><listitem><para><olink targetptr="aadmin-2" remap="internal">Swapping a Master KDC and a Slave
KDC</olink></para>
</listitem><listitem><para><olink targetptr="aadmin-3" remap="internal">Administering the Kerberos Database</olink></para>
</listitem><listitem><para><olink targetptr="setup-280" remap="internal">Increasing Security on Kerberos
Servers</olink></para>
</listitem>
</itemizedlist>
</highlights><sect1 id="setup-306"><title>Configuring the Kerberos Service (Task Map)</title><indexterm><primary>configuring</primary><secondary>Kerberos</secondary><tertiary>task map</tertiary>
</indexterm><indexterm><primary>task maps</primary><secondary>Kerberos configuration</secondary>
</indexterm><para>Parts of the configuration process depend on other parts and must be
done in a specific order. These procedures often establish services that are
required to use the Kerberos service. Other procedures are not dependent on
any order, and can be done when appropriate. The following task map shows
a suggested order for a Kerberos installation.</para><informaltable frame="all" pgwide="1" id="seamtask-tbl-1"><tgroup cols="3" colsep="1" rowsep="1"><colspec colwidth="110*"/><colspec colname="col2" colwidth="167*"/><colspec colwidth="119*"/><thead><row><entry><para>Task</para>
</entry><entry><para>Description</para>
</entry><entry><para>For Instructions</para>
</entry>
</row>
</thead><tbody><row><entry><para>1. Plan for your Kerberos installation.</para>
</entry><entry><para>Lets you resolve configuration issues before you start the software
configuration process. Planning ahead saves you time and other resources in
the long run.</para>
</entry><entry><para><olink targetptr="seamplan-1" remap="internal">Chapter&nbsp;22, Planning for the Kerberos
Service</olink></para>
</entry>
</row><row><entry><para>2. (Optional) Install NTP.</para>
</entry><entry><para>Configures the Network Time Protocol (NTP) software, or another clock
synchronization protocol. In order for the Kerberos service to work properly,
the clocks on all systems in the realm must be synchronized.</para>
</entry><entry><para><olink targetptr="setup-192" remap="internal">Synchronizing Clocks Between KDCs and Kerberos
Clients</olink></para>
</entry>
</row><row><entry><para>3. Configure the KDC servers.</para>
</entry><entry><para>Configures and builds the master KDC and the slave KDC servers and the
KDC database for a realm.</para>
</entry><entry><para><olink targetptr="setup-9" remap="internal">Configuring KDC Servers</olink></para>
</entry>
</row><row><entry><para>4. (Optional) Increase security on the KDC servers.</para>
</entry><entry><para>Prevents security breaches on the KDC servers.</para>
</entry><entry><para><olink targetptr="setup-246" remap="internal">How to Restrict Access to KDC Servers</olink></para>
</entry>
</row><row><entry><para>5. (Optional) Configure swappable KDC servers.</para>
</entry><entry><para>Makes the task of swapping the master KDC and a slave KDC easier.</para>
</entry><entry><para><olink targetptr="setup-289" remap="internal">How to Configure a Swappable Slave KDC</olink></para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</sect1><sect1 id="ezecs"><title>Configuring Additional Kerberos Services (Task Map)</title><para><indexterm><primary>task maps</primary><secondary>Kerberos maintenance</secondary></indexterm>Once the required steps have been completed, the following procedures
can be used, when appropriate.</para><informaltable frame="all" pgwide="1" id="ezecv"><tgroup cols="3" colsep="1" rowsep="1"><colspec colwidth="110*"/><colspec colname="col2" colwidth="167*"/><colspec colwidth="119*"/><thead><row><entry><para>Task</para>
</entry><entry><para>Description</para>
</entry><entry><para>For Instructions</para>
</entry>
</row>
</thead><tbody><row><entry><para>Configure cross-realm authentication.</para>
</entry><entry><para>Enables communications from one realm to another realm.</para>
</entry><entry><para><olink targetptr="setup-87" remap="internal">Configuring Cross-Realm Authentication</olink></para>
</entry>
</row><row><entry><para>Configure Kerberos application servers.</para>
</entry><entry><para>Enables a server to support services such as <command>ftp</command>, <literal>telnet</literal>, and <literal>rsh</literal> using Kerberos authentication.</para>
</entry><entry><para><olink targetptr="setup-119" remap="internal">Configuring Kerberos Network Application
Servers</olink></para>
</entry>
</row><row><entry><para>Configure Kerberos clients.</para>
</entry><entry><para>Enables a client to use Kerberos services.</para>
</entry><entry><para><olink targetptr="setup-148" remap="internal">Configuring Kerberos Clients</olink></para>
</entry>
</row><row><entry><para>Configure Kerberos NFS server.</para>
</entry><entry><para>Enables a server to share a file system that requires Kerberos authentication.</para>
</entry><entry><para><olink targetptr="setup-97" remap="internal">Configuring Kerberos NFS Servers</olink></para>
</entry>
</row><row><entry><para>Increase security on an application server.</para>
</entry><entry><para>Increases security on an application server by restricting access to
authenticated transactions only.</para>
</entry><entry><para><olink targetptr="setup-281" remap="internal">How to Enable Only Kerberized Applications</olink></para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</sect1><sect1 id="setup-9"><title>Configuring KDC Servers</title><indexterm><primary>Kerberos</primary><secondary>configuring KDC servers</secondary>
</indexterm><para>After you install the Kerberos software, you must configure the KDC
servers. Configuring a master KDC and at least one slave KDC provides the
service that issues credentials. These credentials are the basis for the Kerberos
service, so the KDCs must be installed before you attempt other tasks.</para><para><indexterm><primary>KDC</primary><secondary>slave or master</secondary></indexterm><indexterm><primary>slave KDCs</primary><secondary>or master</secondary></indexterm><indexterm><primary>master KDC</primary><secondary>slave KDCs and</secondary></indexterm>The most significant difference between a master
KDC and a slave KDC is that only the master KDC can handle database administration
requests. For instance, changing a password or adding a new principal must
be done on the master KDC. These changes can then be propagated to the slave
KDCs. Both the slave KDC and master KDC generate credentials. This feature
provides redundancy in case the master KDC cannot respond. </para><table frame="topbot" id="ggdxl"><title>Configuring KDC Servers (Task Map)</title><tgroup cols="3" colsep="1" rowsep="1"><colspec colwidth="110*"/><colspec colname="col2" colwidth="167*"/><colspec colwidth="119*"/><thead><row><entry><para>Task</para>
</entry><entry><para>Description</para>
</entry><entry><para>For Instructions</para>
</entry>
</row>
</thead><tbody><row rowsep="0"><entry><para>Configuring a Master KDC</para>
</entry><entry><para>Configures and builds the master KDC server and database for a realm
using an automatic process, which is good for scripts.</para>
</entry><entry><para><olink targetptr="ggdrn" remap="internal">How to Automatically Configure a Master KDC</olink></para>
</entry>
</row><row rowsep="0"><entry>
</entry><entry><para>Configures and builds the master KDC server and database for a realm
using an interactive process, which is sufficient for most installations</para>
</entry><entry><para><olink targetptr="ggdsn" remap="internal">How to Interactively Configure a Master KDC</olink></para>
</entry>
</row><row rowsep="0"><entry>
</entry><entry><para>Configures and builds the master KDC server and database for a realm
using a manual process, which is needed for more complex installations</para>
</entry><entry><para><olink targetptr="setup-1" remap="internal">How to Configure a Master KDC</olink></para>
</entry>
</row><row><entry>
</entry><entry><para>Configures and builds the master KDC server and database for a realm
using a manual process and using LDAP for the KDC</para>
</entry><entry><para><olink targetptr="ggdqi" remap="internal">How to Configure a KDC to Use an LDAP Data
Server</olink></para>
</entry>
</row><row rowsep="0"><entry><para>Configure a slave KDC server.</para>
</entry><entry><para>Configures and builds a slave KDC server for a realm using an automatic
process, which is good for scripts</para>
</entry><entry><para><olink targetptr="ggdvb" remap="internal">How to Automatically Configure a Slave KDC</olink></para>
</entry>
</row><row rowsep="0"><entry>
</entry><entry><para>Configures and builds a slave KDC server for a realm using an interactive
process, which is sufficient for most installations</para>
</entry><entry><para><olink targetptr="ggdua" remap="internal">How to Interactively Configure a Slave KDC</olink></para>
</entry>
</row><row><entry>
</entry><entry><para>Configures and builds a slave KDC server for a realm using the manual
process, which is needed for more complex installations</para>
</entry><entry><para><olink targetptr="setup-74" remap="internal">How to Configure a Slave KDC</olink></para>
</entry>
</row>
</tbody>
</tgroup>
</table><task id="ggdrn"><title>How to Automatically Configure a Master KDC</title><indexterm><primary>KDC</primary><secondary>configuring master</secondary><tertiary>automatic</tertiary>
</indexterm><indexterm><primary>configuring</primary><secondary>Kerberos</secondary><tertiary>master KDC server</tertiary>
</indexterm><indexterm><primary>automatically configuring</primary><secondary>Kerberos</secondary><tertiary>master KDC server</tertiary>
</indexterm><indexterm><primary>master KDC</primary><secondary>automatically configuring</secondary>
</indexterm><tasksummary><para>Starting with the Solaris 10 5/08 and the Solaris Express Developer Edition 1/08 releases, a master KDC
can be automatically configured by using the following procedure.</para>
</tasksummary><procedure><step><para>Become superuser.</para>
</step><step><para>Create the KDC.</para><para>Run the <command>kdcmgr</command> utility
to create the KDC. You need to provide both the master key password and the
password for the administrative principal.<indexterm><primary><command>kdcmgr</command> command</primary><secondary>configuring master</secondary><tertiary>automatic</tertiary></indexterm></para><screen>kdc1# <userinput>kdcmgr -a kws/admin -r EXAMPLE.COM create master</userinput>

Starting server setup
---------------------------------------

Setting up /etc/krb5/kdc.conf

Setting up /etc/krb5/krb5.conf

Initializing database '/var/krb5/principal' for realm 'EXAMPLE.COM', 
master key name 'K/M@EXAMPLE.COM' 
You will be prompted for the database Master Password. 
It is important that you NOT FORGET this password. 
Enter KDC database master key: <lineannotation>&lt;Type the password&gt;</lineannotation>
Re-enter KDC database master key to verify: <lineannotation>&lt;Type it again&gt;</lineannotation>

Authenticating as principal root/admin@EXAMPLE.COM with password. 
WARNING: no policy specified for kws/admin@EXAMPLE.COM; defaulting to no policy 
Enter password for principal "kws/admin@EXAMPLE.COM": <lineannotation>&lt;Type the password&gt;</lineannotation>
Re-enter password for principal "kws/admin@EXAMPLE.COM": <lineannotation>&lt;Type it again&gt;</lineannotation>
Principal "kws/admin@EXAMPLE.COM" created. 

Setting up /etc/krb5/kadm5.acl. 

--------------------------------------------------- 
Setup COMPLETE. 

kdc1#</screen>
</step>
</procedure>
</task><task id="ggdsn"><title>How to Interactively Configure a Master KDC</title><indexterm><primary>KDC</primary><secondary>configuring master</secondary><tertiary>interactive</tertiary>
</indexterm><indexterm><primary>configuring</primary><secondary>Kerberos</secondary><tertiary>master KDC server</tertiary>
</indexterm><indexterm><primary>interactively configuring</primary><secondary>Kerberos</secondary><tertiary>master KDC server</tertiary>
</indexterm><indexterm><primary>master KDC</primary><secondary>interactively configuring</secondary>
</indexterm><tasksummary><para>Starting with the Solaris 10 5/08 and the Solaris Express Developer Edition 1/08 releases, a master KDC
can be interactively configured by using the following procedure.</para>
</tasksummary><procedure><step><para>Become superuser.</para>
</step><step><para>Create the KDC.</para><para><indexterm><primary><command>kdcmgr</command> command</primary><secondary>configuring master</secondary><tertiary>interactive</tertiary></indexterm>Run the <command>kdcmgr</command> utility to create the KDC. You
need to provide both the master key password and the password for the administrative
principal.</para><screen>kdc1# <userinput>kdcmgr create master</userinput>

Starting server setup
---------------------------------------

Enter the Kerberos realm: <userinput>EXAMPLE.COM</userinput>

Setting up /etc/krb5/kdc.conf

Setting up /etc/krb5/krb5.conf

Initializing database '/var/krb5/principal' for realm 'EXAMPLE.COM', 
master key name 'K/M@EXAMPLE.COM' 
You will be prompted for the database Master Password. 
It is important that you NOT FORGET this password. 
Enter KDC database master key: <lineannotation>&lt;Type the password&gt;</lineannotation>
Re-enter KDC database master key to verify: <lineannotation>&lt;Type it again&gt;</lineannotation>

Enter the krb5 administrative principal to be created: <userinput>kws/admin</userinput>

Authenticating as principal root/admin@EXAMPLE.COM with password. 
WARNING: no policy specified for kws/admin@EXAMPLE.COM; defaulting to no policy 
Enter password for principal "kws/admin@EXAMPLE.COM": <lineannotation>&lt;Type the password&gt;</lineannotation>
Re-enter password for principal "kws/admin@EXAMPLE.COM": <lineannotation>&lt;Type it again&gt;</lineannotation>
Principal "kws/admin@EXAMPLE.COM" created. 

Setting up /etc/krb5/kadm5.acl. 

--------------------------------------------------- 
Setup COMPLETE. 

kdc1#</screen>
</step>
</procedure><example id="ggdwr"><title>Displaying the Status of a KDC Server</title><indexterm><primary><command>kdcmgr</command> command</primary><secondary>server status</secondary>
</indexterm><para>The <command>kdcmgr</command> <option role="nodash">status</option> command
can be used to display information about either a master or a slave KDC server.</para>
</example>
</task><task id="setup-1"><title>How to Configure a Master KDC</title><indexterm><primary>KDC</primary><secondary>configuring master</secondary><tertiary>manual</tertiary>
</indexterm><indexterm><primary>configuring</primary><secondary>Kerberos</secondary><tertiary>master KDC server</tertiary>
</indexterm><indexterm><primary>manually configuring</primary><secondary>Kerberos</secondary><tertiary>master KDC server</tertiary>
</indexterm><indexterm><primary>master KDC</primary><secondary>manually configuring</secondary>
</indexterm><tasksummary><itemizedlist mark="bullet"><para>In this procedure, incremental propagation is configured. In addition,
the following configuration parameters are used: </para><listitem><para>Realm name = <literal>EXAMPLE.COM</literal></para>
</listitem><listitem><para>DNS domain name = <literal>example.com</literal></para>
</listitem><listitem><para>Master KDC = <literal>kdc1.example.com</literal></para>
</listitem><listitem><para><literal>admin</literal> principal = <literal>kws/admin</literal></para>
</listitem><listitem><para>Online help URL = <literal>http://denver:8888/ab2/coll.384.1/SEAM/@AB2PageView/6956</literal></para><note><para>Adjust the URL to point to the &ldquo;Graphical Kerberos Administration
Tool&rdquo; section, as described in <olink targetptr="seamplan-3" remap="internal">Online
Help URL in the Graphical Kerberos Administration Tool</olink>.</para>
</note>
</listitem>
</itemizedlist>
</tasksummary><taskprerequisites><para>This procedure requires that the host is configured to use DNS. For
specific naming instructions if this master is to be swappable, see <olink targetptr="aadmin-2" remap="internal">Swapping a Master KDC and a Slave KDC</olink>.</para>
</taskprerequisites><procedure><step id="ggdrw"><para>Become superuser on the master KDC.</para>
</step><step id="ggdsh"><para><indexterm><primary><filename>krb5.conf</filename> file</primary><secondary>editing</secondary></indexterm>Edit the Kerberos configuration
file (<filename>krb5.conf</filename>).</para><para>You need to change the
realm names and the names of the servers. See the <olink targetdoc="group-refman" targetptr="krb5.conf-4" remap="external"><citerefentry><refentrytitle>krb5.conf</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink> man page for a full description
of this file.</para><screen>kdc1 # <userinput>cat /etc/krb5/krb5.conf</userinput>
[libdefaults]
        default_realm = <userinput>EXAMPLE.COM</userinput>

[realms]
        <userinput>EXAMPLE.COM</userinput> = {
        kdc = <userinput>kdc1.example.com</userinput>
        admin_server = <userinput>kdc1.example.com</userinput>
        }

[domain_realm]
        <userinput>.example.com = EXAMPLE.COM</userinput>
#
# if the domain name and realm name are equivalent, 
# this entry is not needed
#
[logging]
        default = FILE:/var/krb5/kdc.log
        kdc = FILE:/var/krb5/kdc.log

[appdefaults]
    gkadmin = {
        help_url = <userinput>http://denver:8888/ab2/coll.384.1/SEAM/@AB2PageView/6956</userinput>
        }</screen><para><indexterm><primary><literal>default_realm</literal> section</primary><secondary><filename>krb5.conf</filename> file</secondary></indexterm><indexterm><primary><literal>admin_server</literal> section</primary><secondary><filename>krb5.conf</filename> file</secondary></indexterm><indexterm><primary><literal>domain_realm</literal> section</primary><secondary><filename>krb5.conf</filename> file</secondary></indexterm>In this example, the lines for <literal>default_realm</literal>, <literal>kdc</literal>, <literal>admin_server</literal>, and all <literal>domain_realm</literal> entries
were changed. In addition, the line that defines the <literal>help_url</literal> was
edited.</para><note><para>If you want to restrict the encryption types, you can set the <literal>default_tkt_enctypes</literal> or <literal>default_tgs_enctypes</literal> lines.
Refer to <olink targetptr="egric" remap="internal">Using Kerberos Encryption Types</olink> for
a description of the issues involved with restricting the encryption types.</para>
</note>
</step><step id="ggdqa"><para>Edit the KDC configuration file (<filename>kdc.conf</filename>).</para><para>You need to change the realm name. See the <olink targetdoc="group-refman" targetptr="kdc.conf-4" remap="external"><citerefentry><refentrytitle>kdc.conf</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink> man page for
a full description of this file. </para><screen>kdc1 # <userinput>cat /etc/krb5/kdc.conf</userinput>
[kdcdefaults]
        kdc_ports = 88,750

[realms]
        <userinput>EXAMPLE.COM</userinput> = {
                profile = /etc/krb5/krb5.conf
                database_name = /var/krb5/principal
                admin_keytab = /etc/krb5/kadm5.keytab
                acl_file = /etc/krb5/kadm5.acl
                kadmind_port = 749
                max_life = 8h 0m 0s
                max_renewable_life = 7d 0h 0m 0s
                <userinput>sunw_dbprop_enable = true</userinput>
                <userinput>sunw_dbprop_master_ulogsize = 1000</userinput>
                }</screen><para>In this example, the realm name definition in the <literal>realms</literal> section
was changed. Also, in the <literal>realms</literal> section, lines to enable
incremental propagation and to select the number of updates the KDC master
keeps in the log were added.</para><note><para>If you want to restrict the encryption types, you can set the <literal>permitted_enctypes</literal>, <literal>supported_enctypes</literal>, or <literal>master_key_type</literal> lines. Refer to <olink targetptr="egric" remap="internal">Using Kerberos
Encryption Types</olink> for a description of the issues involved with restricting
the encryption types.</para>
</note>
</step><step id="ggdrl"><para><indexterm><primary><command>kdb5_util</command> command</primary><secondary>creating KDC database</secondary></indexterm><indexterm><primary>KDC</primary><secondary>creating database</secondary></indexterm><indexterm><primary>databases</primary><secondary>creating KDC</secondary></indexterm>Create the KDC database
by using the <command>kdb5_util</command> command.</para><para>The <command>kdb5_util</command> command creates the KDC database. Also, when used with the <option>s</option> option,
this command creates a stash file that is used to authenticate the KDC to
itself before the <command>kadmind</command> and <command>krb5kdc</command> daemons
are started.</para><screen>kdc1 # <userinput>/usr/sbin/kdb5_util create -s</userinput>
Initializing database '/var/krb5/principal' for realm 'EXAMPLE.COM'
master key name 'K/M@EXAMPLE.COM'
You will be prompted for the database Master Password.
It is important that you NOT FORGET this password.
Enter KDC database master key: <lineannotation>&lt;Type the key&gt;</lineannotation>
Re-enter KDC database master key to verify: <lineannotation>&lt;Type it again&gt;</lineannotation></screen>
</step><step id="ggdsg"><para><indexterm><primary>access control list</primary><see>ACL</see></indexterm><indexterm><primary><filename>kadm5.acl</filename> file</primary><secondary>master KDC entry</secondary></indexterm>Edit the Kerberos access
control list file (<filename>kadm5.acl</filename>).</para><para>Once populated,
the <filename>/etc/krb5/kadm5.acl</filename> file should contain all principal
names that are allowed to administer the KDC.</para><screen>kws/admin@EXAMPLE.COM   *</screen><para>The entry gives the <literal>kws/admin</literal> principal in the <literal>EXAMPLE.COM</literal> realm the ability to modify principals or policies in
the KDC. The default installation includes an asterisk (*) to match all <literal>admin</literal> principals. This default could be a security risk, so it is
more secure to include a list of all of the <literal>admin</literal> principals.
See the <olink targetdoc="group-refman" targetptr="kadm5.acl-4" remap="external"><citerefentry><refentrytitle>kadm5.acl</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink> man
page for more information.</para>
</step><step id="ggdpy"><para>Start the <command>kadmin.local</command> command and
add principals.</para><para>The next substeps create principals that are used
by the Kerberos service.</para><screen>kdc1 # <userinput>/usr/sbin/kadmin.local</userinput>
kadmin.local: </screen><substeps><step id="ggdqc"><para><indexterm><primary><command>kadmin.local</command> command</primary><secondary>adding administration principals</secondary></indexterm><indexterm><primary>configuring</primary><secondary>Kerberos</secondary><tertiary>adding administration principals</tertiary></indexterm><indexterm><primary>adding</primary><secondary>administration principals (Kerberos)</secondary></indexterm><indexterm><primary>principal</primary><secondary>adding administration</secondary></indexterm>Add administration principals to the database.</para><para>You
can add as many <literal>admin</literal> principals as you need. You must
add at least one <literal>admin</literal> principal to complete the KDC configuration
process. For this example, a <literal>kws/admin</literal> principal is added.
You can substitute an appropriate principal name instead of &ldquo;<literal>kws</literal>.&rdquo;</para><screen>kadmin.local: <userinput>addprinc kws/admin</userinput>
Enter password for principal kws/admin@EXAMPLE.COM:<lineannotation>&lt;Type the password&gt;</lineannotation>
Re-enter password for principal kws/admin@EXAMPLE.COM: <lineannotation>&lt;Type it again&gt;</lineannotation>
Principal "kws/admin@EXAMPLE.COM" created.
kadmin.local: </screen>
</step><step><para>Create the <literal>kiprop</literal> principals.</para><para>The <literal>kiprop</literal> principal is used to authorize updates from the master KDC.</para><screen>kadmin.local: <userinput>addprinc -randkey kiprop/kdc1.example.com</userinput>
Principal "kiprop/kdc1.example.com@EXAMPLE.COM" created.
kadmin.local:</screen>
</step><step id="ggdsd"><para><indexterm><primary>keytab file</primary><secondary>creating</secondary></indexterm><indexterm><primary>creating</primary><secondary>keytab file</secondary></indexterm><indexterm><primary><command>kadmin.local</command> command</primary><secondary>creating keytab file</secondary></indexterm>Create a keytab file for the <command>kadmind</command> service.</para><para>This command sequence creates a special keytab file with principal entries
for <literal>kadmin/&lt;FQDN&gt;</literal> and <literal>changepw/&lt;FQDN&gt;</literal>.
These principals are needed for the <command>kadmind</command> service and
for passwords to be changed. Note that when the principal instance is a host
name, the FQDN must be specified in lowercase letters, regardless of the case
of the domain name in the <filename>/etc/resolv.conf</filename> file. The <literal>kadmin/changepw</literal> principal is used to change passwords from clients
that are not running a Solaris release.</para><screen remap="wide">kadmin.local: <userinput>ktadd -k /etc/krb5/kadm5.keytab kadmin/kdc1.example.com</userinput>
Entry for principal kadmin/kdc1.example.com with kvno 3, encryption type AES-256 CTS mode
          with 96-bit SHA-1 HMAC added to keytab WRFILE:/etc/krb5/kadm5.keytab.
Entry for principal kadmin/kdc1.example.com with kvno 3, encryption type AES-128 CTS mode
          with 96-bit SHA-1 HMAC added to keytab WRFILE:/etc/krb5/kadm5.keytab.
Entry for principal kadmin/kdc1.example.com with kvno 3, encryption type Triple DES cbc
          mode with HMAC/sha1 added to keytab WRFILE:/etc/krb5/kadm5.keytab.
Entry for principal kadmin/kdc1.example.com with kvno 3, encryption type ArcFour
          with HMAC/md5 added to keytab WRFILE:/etc/krb5/kadm5.keytab.
Entry for principal kadmin/kdc1.example.com with kvno 3, encryption type DES cbc mode
          with RSA-MD5 added to keytab WRFILE:/etc/krb5/kadm5.keytab.
kadmin.local: <userinput>ktadd -k /etc/krb5/kadm5.keytab changepw/kdc1.example.com</userinput>
Entry for principal changepw/kdc1.example.com with kvno 3, encryption type AES-256 CTS mode
          with 96-bit SHA-1 HMAC added to keytab WRFILE:/etc/krb5/kadm5.keytab.
Entry for principal changepw/kdc1.example.com with kvno 3, encryption type AES-128 CTS mode
          with 96-bit SHA-1 HMAC added to keytab WRFILE:/etc/krb5/kadm5.keytab.
Entry for principal changepw/kdc1.example.com with kvno 3, encryption type Triple DES cbc
          mode with HMAC/sha1 added to keytab WRFILE:/etc/krb5/kadm5.keytab.
Entry for principal changepw/kdc1.example.com with kvno 3, encryption type ArcFour
          with HMAC/md5 added to keytab WRFILE:/etc/krb5/kadm5.keytab.
Entry for principal changepw/kdc1.example.com with kvno 3, encryption type DES cbc mode
          with RSA-MD5 added to keytab WRFILE:/etc/krb5/kadm5.keytab.
kadmin.local: <userinput>ktadd -k /etc/krb5/kadm5.keytab kadmin/changepw</userinput>
Entry for principal kadmin/changepw with kvno 3, encryption type AES-256 CTS mode
          with 96-bit SHA-1 HMAC added to keytab WRFILE:/etc/krb5/kadm5.keytab.
Entry for principal kadmin/changepw with kvno 3, encryption type AES-128 CTS mode
          with 96-bit SHA-1 HMAC added to keytab WRFILE:/etc/krb5/kadm5.keytab.
Entry for principal kadmin/changepw with kvno 3, encryption type Triple DES cbc
          mode with HMAC/sha1 added to keytab WRFILE:/etc/krb5/kadm5.keytab.
Entry for principal kadmin/changepw with kvno 3, encryption type ArcFour
          with HMAC/md5 added to keytab WRFILE:/etc/krb5/kadm5.keytab.
Entry for principal kadmin/changepw with kvno 3, encryption type DES cbc mode
          with RSA-MD5 added to keytab WRFILE:/etc/krb5/kadm5.keytab.
kadmin.local:</screen>
</step><step><para>Add the <literal>kiprop</literal> principal
for the master KDC server to the <command>kadmind</command> keytab file.</para><para>Adding the <literal>kiprop</literal> principal to the <filename>kadm5.keytab</filename> file allows the <command>kadmind</command> command to authenticate
itself when incremental propagation is started.</para><screen>kadmin.local: <userinput>ktadd -k /etc/krb5/kadm5.keytab kiprop/kdc1.example.com</userinput>
Entry for principal kiprop/kdc1.example.com with kvno 3, encryption type AES-256 CTS mode
          with 96-bit SHA-1 HMAC added to keytab WRFILE:/etc/krb5/kadm5.keytab.
Entry for principal kiprop/kdc1.example.com with kvno 3, encryption type AES-128 CTS mode
          with 96-bit SHA-1 HMAC added to keytab WRFILE:/etc/krb5/kadm5.keytab.
Entry for principal kiprop/kdc1.example.com with kvno 3, encryption type Triple DES cbc
          mode with HMAC/sha1 added to keytab WRFILE:/etc/krb5/kadm5.keytab.
Entry for principal kiprop/kdc1.example.com with kvno 3, encryption type ArcFour
          with HMAC/md5 added to keytab WRFILE:/etc/krb5/kadm5.keytab.
Entry for principal kiprop/kdc1.example.com with kvno 3, encryption type DES cbc mode
          with RSA-MD5 added to keytab WRFILE:/etc/krb5/kadm5.keytab.
kadmin.local: </screen>
</step><step id="ggdss"><para>Quit <command>kadmin.local</command>.</para><para>You
have added all of the required principals for the next steps.</para><screen>kadmin.local: <userinput>quit</userinput></screen>
</step>
</substeps>
</step><step id="ggdsq"><para>Start the Kerberos daemons.</para><screen>kdc1 # <userinput>svcadm enable -r network/security/krb5kdc</userinput>
kdc1 # <userinput>svcadm enable -r network/security/kadmin</userinput></screen>
</step><step id="ggdqm"><para>Start <command>kadmin</command> and add more principals.</para><para>At this point, you can add principals by using the Graphical Kerberos
Administration Tool. To do so, you must log in with one of the <literal>admin</literal> principal
names that you created earlier in this procedure. However, the following command-line
example is shown for simplicity. </para><screen>kdc1 # <userinput>/usr/sbin/kadmin -p kws/admin</userinput>
Enter password: <lineannotation>&lt;Type kws/admin password&gt;</lineannotation>
kadmin: </screen><substeps><step id="ggdso"><para><indexterm><primary>KDC</primary><secondary>creating <literal>host</literal> principal</secondary></indexterm><indexterm><primary><literal>host</literal> principal</primary><secondary>creating</secondary></indexterm><indexterm><primary>principal</primary><secondary>creating <literal>host</literal></secondary></indexterm><indexterm><primary><command>kadmin</command> command</primary><secondary>creating <literal>host</literal> principal</secondary></indexterm>Create
the master KDC <literal>host</literal> principal.</para><para>The host principal
is used by Kerberized applications, such as <command>kprop</command> to propagate
changes to the slave KDCs. This principal is also used to provide secure remote
access to the KDC server using applications, like <command>ssh</command>.
Note that when the principal instance is a host name, the FQDN must be specified
in lowercase letters, regardless of the case of the domain name in the <filename>/etc/resolv.conf</filename> file.</para><screen>kadmin: <userinput>addprinc -randkey host/kdc1.example.com</userinput>
Principal "host/kdc1.example.com@EXAMPLE.COM" created.
kadmin: </screen>
</step><step performance="optional" id="ggdpr"><para><indexterm><primary><literal>clntconfig</literal> principal</primary><secondary>creating</secondary></indexterm><indexterm><primary>principal</primary><secondary>creating  <literal>clntconfig</literal></secondary></indexterm>Create the <literal>kclient</literal> principal.</para><para>This
principal is used by the <command>kclient</command> utility during the installation
of a Kerberos client. If you do not plan on using this utility, then you do
not need to add the principal. The users of the <command>kclient</command> utility
need to use this password.</para><screen>kadmin: <userinput>addprinc clntconfig/admin</userinput>
Enter password for principal clntconfig/admin@EXAMPLE.COM:<lineannotation>&lt;Type the password&gt;</lineannotation>
Re-enter password for principal clntconfig/admin@EXAMPLE.COM: <lineannotation>&lt;Type it again&gt;</lineannotation>
Principal "clntconfig/admin@EXAMPLE.COM" created.
kadmin: </screen>
</step><step id="ggdqq"><para><indexterm><primary>keytab file</primary><secondary>adding master KDC's host principal to</secondary></indexterm>Add the master KDC's <literal>host</literal> principal to the master KDC's keytab file.</para><para>Adding
the host principal to the keytab file allows this principal to be used by
application servers, like <command>sshd</command>, automatically.</para><screen remap="wide">kadmin: <userinput>ktadd host/kdc1.example.com</userinput>
Entry for principal host/kdc1.example.com with kvno 3, encryption type AES-256 CTS mode
          with 96-bit SHA-1 HMAC added to keytab WRFILE:/etc/krb5/krb5.keytab.
Entry for principal host/kdc1.example.com with kvno 3, encryption type AES-128 CTS mode
          with 96-bit SHA-1 HMAC added to keytab WRFILE:/etc/krb5/krb5.keytab.
Entry for principal host/kdc1.example.com with kvno 3, encryption type Triple DES cbc
          mode with HMAC/sha1 added to keytab WRFILE:/etc/krb5/krb5.keytab.
Entry for principal host/kdc1.example.com with kvno 3, encryption type ArcFour
          with HMAC/md5 added to keytab WRFILE:/etc/krb5/krb5.keytab.
Entry for principal host/kdc1.example.com with kvno 3, encryption type DES cbc mode
          with RSA-MD5 added to keytab WRFILE:/etc/krb5/krb5.keytab.
kadmin: </screen>
</step><step id="ggdro"><para>Quit <command>kadmin</command>.</para><screen>kadmin: <userinput>quit</userinput></screen>
</step>
</substeps>
</step><step performance="optional" id="ggdrj"><para><indexterm><primary>KDC</primary><secondary>synchronizing clocks</secondary><tertiary>master KDC</tertiary></indexterm><indexterm><primary>clock synchronizing</primary><secondary>Kerberos master KDC and</secondary></indexterm><indexterm><primary>NTP</primary><secondary>master KDC and</secondary></indexterm><indexterm><primary>synchronizing clocks</primary><secondary>master KDC</secondary></indexterm>Synchronize the
master KDCs clock by using NTP or another clock synchronization mechanism.</para><para>Installing and using the Network Time Protocol (NTP) is not required.
However, every clock must be within the default time that is defined in the <literal>libdefaults</literal> section of the <filename>krb5.conf</filename> file for
authentication to succeed. See <olink targetptr="setup-192" remap="internal">Synchronizing
Clocks Between KDCs and Kerberos Clients</olink> for information about NTP.</para>
</step><step><para>Configure Slave KDCs.</para><para>To provide redundancy, make
sure to install at least one slave KDC. See <olink targetptr="setup-74" remap="internal">How
to Configure a Slave KDC</olink> for specific instructions.</para>
</step>
</procedure>
</task><task id="ggdqi"><title>How to Configure a KDC to Use an LDAP Data Server</title><indexterm><primary>KDC</primary><secondary>configuring master</secondary><tertiary>with LDAP</tertiary>
</indexterm><indexterm><primary>configuring</primary><secondary>Kerberos</secondary><tertiary>master KDC server using LDAP</tertiary>
</indexterm><indexterm><primary>manually configuring</primary><secondary>Kerberos</secondary><tertiary>master KDC server using LDAP</tertiary>
</indexterm><indexterm><primary>master KDC</primary><secondary>configuring with LDAP</secondary>
</indexterm><indexterm><primary>LDAP</primary><secondary>configuring master KDC using</secondary>
</indexterm><tasksummary><para>Starting with the Solaris 10 5/08 and the Solaris Express Developer Edition 1/08 releases, a KDC can
be configured to use an LDAP data server by using the following procedure.</para><itemizedlist mark="bullet"><para>In this procedure, the following configuration parameters are used: </para><listitem><para>Realm name = <literal>EXAMPLE.COM</literal></para>
</listitem><listitem><para>DNS domain name = <literal>example.com</literal></para>
</listitem><listitem><para>Master KDC = <literal>kdc1.example.com</literal></para>
</listitem><listitem><para>Directory Server = <literal>dsserver.example.com</literal></para>
</listitem><listitem><para><literal>admin</literal> principal = <literal>kws/admin</literal></para>
</listitem><listitem><para>Online help URL = <literal>http://denver:8888/ab2/coll.384.1/SEAM/@AB2PageView/6956</literal></para><note><para>Adjust the URL to point to the &ldquo;Graphical Kerberos Administration
Tool&rdquo; section, as described in <olink targetptr="seamplan-3" remap="internal">Online
Help URL in the Graphical Kerberos Administration Tool</olink>.</para>
</note>
</listitem>
</itemizedlist>
</tasksummary><taskprerequisites><para>This procedure also requires that  the host is configured to use DNS.
For better performance, install the KDC and the LDAP Directory Service on
the same server. In addition, a directory server should be running. The procedure
below works with servers using the Sun <trademark>Java</trademark> Directory
Server Enterprise Edition release.</para>
</taskprerequisites><procedure><step><para>Become superuser on the KDC.</para>
</step><step><para>Configure
the master KDC to use SSL to reach the directory server.</para><para>The following
steps configure a Solaris Express Developer Release KDC to use the Directory
Server 6.1 self-signed certificate. If the certificate has expired, follow
the instructions for renewing a certificate in <olink targetdoc="sunwdseeag" targetptr="fwaxk" remap="external"><citetitle remap="section">To Manage Self-Signed Certificates</citetitle> in <citetitle remap="book">Sun Java System Directory Server Enterprise Edition 6.3 Administration Guide</citetitle></olink>.</para><substeps><step><para>On the directory server, export the self-signed directory server
certificate.</para><screen><userinput># /export/sun-ds6.1/ds6/bin/dsadm show-cert -F der /export/sun-ds6.1/directory2 \
        defaultCert &gt; /tmp/defaultCert.cert.der</userinput></screen>
</step><step><para>On the master KDC, import the directory server certificate.</para><screen remap="wide"># <userinput>pktool setpin keystore=nss dir=/var/ldap</userinput>
# <userinput>chmod a+r /var/ldap/*.db</userinput>
# <userinput>pktool import keystore=nss objtype=cert trust="CT" infile=/tmp/defaultCert.certutil.der</userinput> \
        <userinput>label=defaultCert dir=/var/ldap</userinput></screen>
</step><step><para>On the master KDC, test that SSL is working.</para><para>This
example assumes that the <literal>cn=directory manager</literal>entry has
administration privileges.</para><screen><userinput>/usr/bin/ldapsearch -Z -P /var/ldap -D "cn=directory manager" \
        -h dsserver.example.com -b "" -s base objectclass='*'</userinput>
Subject:
    "CN=dsserver.example.com,CN=636,CN=Directory Server,O=Example Corporation</screen><para>Note that the <literal>CN=dsserver.example.com</literal> entry should
include the fully qualified host name, not a short version.</para>
</step>
</substeps>
</step><step><para>Populate the LDAP directory, if necessary.</para>
</step><step><para>Add the Solaris Kerberos schema to the existing schema.</para><screen remap="wide"># <userinput>ldapmodify -h dsserver.example.com -D "cn=directory manager" -f /usr/share/lib/ldif/kerberos.ldif</userinput></screen>
</step><step><para>Create the Kerberos container in the LDAP directory.</para><para>Add
the following entries to the <filename>krb5.conf</filename> file.</para><substeps><step><para>Define the database type.</para><para>Add an entry to define the <literal>database_module</literal>to the <literal>realms</literal> section.</para><screen><userinput>database_module = LDAP</userinput></screen>
</step><step><para>Define the database module.</para><screen><userinput>[dbmodules]
    LDAP = {
        ldap_kerberos_container_dn = "cn=krbcontainer,dc=example,dc=com"
        db_library = kldap
        ldap_kdc_dn = "cn=kdc service,ou=profile,dc=example,dc=com"
        ldap_kadmind_dn = "cn=kadmin service,ou=profile,dc=example,dc=com"
        ldap_cert_path = /var/ldap
        ldap_servers = ldaps://dsserver.example.com
    }</userinput></screen>
</step><step><para>Create the KDC in the LDAP directory.</para><para>This command
creates <literal>krbcontainer</literal> and several other objects. It also
creates a <literal>/var/krb5/.k5.EXAMPLE.COM</literal> master key stash file.</para><screen remap="wide"># <userinput>kdb5_ldap_util -D "cn=directory manager" create -P abcd1234 -r EXAMPLE.COM</userinput> -s</screen>
</step>
</substeps>
</step><step><para>Stash the KDC bind Distinguished Name (DN) passwords.</para><para>These
passwords are used by the KDC when it binds to the DS. The KDC uses different
roles depending on the type of access the KDC is using.</para><screen># <userinput>kdb5_ldap_util stashsrvpw "cn=kdc service,ou=profile,dc=example,dc=com"</userinput>
# <userinput>kdb5_ldap_util stashsrvpw "cn=kadmin service,ou=profile,dc=example,dc=com"</userinput></screen>
</step><step><para>Add KDC service roles.</para><substeps><step><para>Create a <filename>kdc_roles.ldif</filename> file with contents
like this:</para><screen>dn: cn=kdc service,ou=profile,dc=example,dc=com
cn: kdc service
sn: kdc service
objectclass: top
objectclass: person
userpassword: test123

dn: cn=kadmin service,ou=profile,dc=example,dc=com
cn: kadmin service
sn: kadmin service
objectclass: top
objectclass: person
userpassword: test123</screen>
</step><step><para>Create the role entries in the LDAP directory</para><screen># <userinput>ldapmodify -a -h dsserver.example.com -D "cn=directory manager" -f kdc_roles.ldif</userinput></screen>
</step>
</substeps>
</step><step><para>Set the ACLs for the KDC-related roles.</para><screen remap="wide"># cat &lt;&lt; EOF | ldapmodify -h dsserver.example.com -D "cn=directory manager" 
# Set kadmin ACL for everything under krbcontainer.
dn: cn=krbcontainer,dc=example,dc=com
changetype: modify
add: aci
aci: (target="ldap:///cn=krbcontainer,dc=example,dc=com")(targetattr="krb*")(version 3.0;\
      acl kadmin_ACL; allow (all)\
      userdn = "ldap:///cn=kadmin service,ou=profile,dc=example,dc=com";)

# Set kadmin ACL for everything under the people subtree if there are
# mix-in entries for krb princs:
dn: ou=people,dc=example,dc=com
changetype: modify
add: aci
aci: (target="ldap:///ou=people,dc=example,dc=com")(targetattr="krb*")(version 3.0;\
      acl kadmin_ACL; allow (all)\
      userdn = "ldap:///cn=kadmin service,ou=profile,dc=example,dc=com";)
EOF</screen>
</step><step><para><indexterm><primary><filename>krb5.conf</filename> file</primary><secondary>editing</secondary></indexterm>Edit the Kerberos configuration
file (<filename>krb5.conf</filename>).</para><para>You need to change the
realm names and the names of the servers. See the <olink targetdoc="group-refman" targetptr="krb5.conf-4" remap="external"><citerefentry><refentrytitle>krb5.conf</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink> man page for a full description
of this file.</para><screen>kdc1 # <userinput>cat /etc/krb5/krb5.conf</userinput>
[libdefaults]
        default_realm = <userinput>EXAMPLE.COM</userinput>

[realms]
        <userinput>EXAMPLE.COM</userinput> = {
        kdc = <userinput>kdc1.example.com</userinput>
        admin_server = <userinput>kdc1.example.com</userinput>
        }

[domain_realm]
        <userinput>.example.com = EXAMPLE.COM</userinput>
#
# if the domain name and realm name are equivalent, 
# this entry is not needed
#
[logging]
        default = FILE:/var/krb5/kdc.log
        kdc = FILE:/var/krb5/kdc.log

[appdefaults]
    gkadmin = {
        help_url = <userinput>http://denver:8888/ab2/coll.384.1/SEAM/@AB2PageView/6956</userinput>
        }</screen><para><indexterm><primary><literal>default_realm</literal> section</primary><secondary><filename>krb5.conf</filename> file</secondary></indexterm><indexterm><primary><literal>admin_server</literal> section</primary><secondary><filename>krb5.conf</filename> file</secondary></indexterm><indexterm><primary><literal>domain_realm</literal> section</primary><secondary><filename>krb5.conf</filename> file</secondary></indexterm>In this example, the lines for <literal>default_realm</literal>, <literal>kdc</literal>, <literal>admin_server</literal>, and all <literal>domain_realm</literal> entries
were changed. In addition, the line that defines the <literal>help_url</literal> was
edited.</para><note><para>If you want to restrict the encryption types, you can set the <literal>default_tkt_enctypes</literal> or <literal>default_tgs_enctypes</literal> lines.
Refer to <olink targetptr="egric" remap="internal">Using Kerberos Encryption Types</olink> for
a description of the issues involved with restricting the encryption types.</para>
</note>
</step><step><para>Edit the KDC configuration file (<filename>kdc.conf</filename>).</para><para>You need to change the realm name. See the <olink targetdoc="group-refman" targetptr="kdc.conf-4" remap="external"><citerefentry><refentrytitle>kdc.conf</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink> man page for a full description
of this file. </para><screen>kdc1 # <userinput>cat /etc/krb5/kdc.conf</userinput>
[kdcdefaults]
        kdc_ports = 88,750

[realms]
        <userinput>EXAMPLE.COM</userinput> = {
                profile = /etc/krb5/krb5.conf
                database_name = /var/krb5/principal
                admin_keytab = /etc/krb5/kadm5.keytab
                acl_file = /etc/krb5/kadm5.acl
                kadmind_port = 749
                max_life = 8h 0m 0s
                max_renewable_life = 7d 0h 0m 0s
                <userinput>sunw_dbprop_enable = true</userinput>
                <userinput>sunw_dbprop_master_ulogsize = 1000</userinput>
                }</screen><para>In this example, the realm name definition in the <literal>realms</literal> section
was changed. Also, in the <literal>realms</literal> section, lines to enable
incremental propagation and to select the number of updates the KDC master
keeps in the log were added.</para><note><para>If you want to restrict the encryption types, you can set the <literal>permitted_enctypes</literal>, <literal>supported_enctypes</literal>, or <literal>master_key_type</literal> lines. Refer to <olink targetptr="egric" remap="internal">Using Kerberos
Encryption Types</olink> for a description of the issues involved with restricting
the encryption types.</para>
</note>
</step><step><para><indexterm><primary>access control list</primary><see>ACL</see></indexterm><indexterm><primary><filename>kadm5.acl</filename> file</primary><secondary>master KDC entry</secondary></indexterm>Edit the Kerberos access
control list file (<filename>kadm5.acl</filename>).</para><para>Once populated,
the <filename>/etc/krb5/kadm5.acl</filename> file should contain all principal
names that are allowed to administer the KDC. </para><screen>kws/admin@EXAMPLE.COM   *</screen><para>The entry gives the <literal>kws/admin</literal> principal in the <literal>EXAMPLE.COM</literal> realm the ability to modify principals or policies in
the KDC. The default installation includes an asterisk (*) to match all <literal>admin</literal> principals. This default could be a security risk, so it is
more secure to include a list of all of the <literal>admin</literal> principals.
See the <olink targetdoc="group-refman" targetptr="kadm5.acl-4" remap="external"><citerefentry><refentrytitle>kadm5.acl</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink> man
page for more information.</para>
</step><step><para>Start the <command>kadmin.local</command> command and add principals.</para><para>The next substeps create principals that are used by the Kerberos
service.</para><screen>kdc1 # <userinput>/usr/sbin/kadmin.local</userinput>
kadmin.local: </screen><substeps><step id="ggdpw"><para><indexterm><primary><command>kadmin.local</command> command</primary><secondary>adding administration principals</secondary></indexterm><indexterm><primary>configuring</primary><secondary>Kerberos</secondary><tertiary>adding administration principals</tertiary></indexterm><indexterm><primary>adding</primary><secondary>administration principals (Kerberos)</secondary></indexterm><indexterm><primary>principal</primary><secondary>adding administration</secondary></indexterm>Add administration principals to the database.</para><para>You
can add as many <literal>admin</literal> principals as you need. You must
add at least one <literal>admin</literal> principal to complete the KDC configuration
process. For this example, a <literal>kws/admin</literal> principal is added.
You can substitute an appropriate principal name instead of &ldquo;<literal>kws</literal>.&rdquo;</para><screen>kadmin.local: <userinput>addprinc kws/admin</userinput>
Enter password for principal kws/admin@EXAMPLE.COM:<lineannotation>&lt;Type the password&gt;</lineannotation>
Re-enter password for principal kws/admin@EXAMPLE.COM: <lineannotation>&lt;Type it again&gt;</lineannotation>
Principal "kws/admin@EXAMPLE.COM" created.
kadmin.local: </screen>
</step><step id="ggdpt"><para><indexterm><primary>keytab file</primary><secondary>creating</secondary></indexterm><indexterm><primary>creating</primary><secondary>keytab file</secondary></indexterm><indexterm><primary><command>kadmin.local</command> command</primary><secondary>creating keytab file</secondary></indexterm>Create a keytab file for the <command>kadmind</command> service.</para><para>This command sequence creates a special keytab file with principal entries
for <literal>kadmin</literal> and <literal>changepw</literal>. These principals
are needed for the <command>kadmind</command> service. Note that when the
principal instance is a host name, the FQDN must be specified in lowercase
letters, regardless of the case of the domain name in the <filename>/etc/resolv.conf</filename> file.</para><screen remap="wide">kadmin.local: <userinput>ktadd -k /etc/krb5/kadm5.keytab kadmin/kdc1.example.com</userinput>
Entry for principal kadmin/kdc1.example.com with kvno 3, encryption type AES-256 CTS mode
          with 96-bit SHA-1 HMAC added to keytab WRFILE:/etc/krb5/kadm5.keytab.
Entry for principal kadmin/kdc1.example.com with kvno 3, encryption type AES-128 CTS mode
          with 96-bit SHA-1 HMAC added to keytab WRFILE:/etc/krb5/kadm5.keytab.
Entry for principal kadmin/kdc1.example.com with kvno 3, encryption type Triple DES cbc
          mode with HMAC/sha1 added to keytab WRFILE:/etc/krb5/kadm5.keytab.
Entry for principal kadmin/kdc1.example.com with kvno 3, encryption type ArcFour
          with HMAC/md5 added to keytab WRFILE:/etc/krb5/kadm5.keytab.
Entry for principal kadmin/kdc1.example.com with kvno 3, encryption type DES cbc mode
          with RSA-MD5 added to keytab WRFILE:/etc/krb5/kadm5.keytab.
kadmin.local: <userinput>ktadd -k /etc/krb5/kadm5.keytab changepw/kdc1.example.com</userinput>
Entry for principal changepw/kdc1.example.com with kvno 3, encryption type AES-256 CTS mode
          with 96-bit SHA-1 HMAC added to keytab WRFILE:/etc/krb5/kadm5.keytab.
Entry for principal changepw/kdc1.example.com with kvno 3, encryption type AES-128 CTS mode
          with 96-bit SHA-1 HMAC added to keytab WRFILE:/etc/krb5/kadm5.keytab.
Entry for principal changepw/kdc1.example.com with kvno 3, encryption type Triple DES cbc
          mode with HMAC/sha1 added to keytab WRFILE:/etc/krb5/kadm5.keytab.
Entry for principal changepw/kdc1.example.com with kvno 3, encryption type ArcFour
          with HMAC/md5 added to keytab WRFILE:/etc/krb5/kadm5.keytab.
Entry for principal changepw/kdc1.example.com with kvno 3, encryption type DES cbc mode
          with RSA-MD5 added to keytab WRFILE:/etc/krb5/kadm5.keytab.
kadmin.local: <userinput>ktadd -k /etc/krb5/kadm5.keytab kadmin/changepw</userinput>
Entry for principal kadmin/changepw with kvno 3, encryption type AES-256 CTS mode
          with 96-bit SHA-1 HMAC added to keytab WRFILE:/etc/krb5/kadm5.keytab.
Entry for principal kadmin/changepw with kvno 3, encryption type AES-128 CTS mode
          with 96-bit SHA-1 HMAC added to keytab WRFILE:/etc/krb5/kadm5.keytab.
Entry for principal kadmin/changepw with kvno 3, encryption type Triple DES cbc
          mode with HMAC/sha1 added to keytab WRFILE:/etc/krb5/kadm5.keytab.
Entry for principal kadmin/changepw with kvno 3, encryption type ArcFour
          with HMAC/md5 added to keytab WRFILE:/etc/krb5/kadm5.keytab.
Entry for principal kadmin/changepw with kvno 3, encryption type DES cbc mode
          with RSA-MD5 added to keytab WRFILE:/etc/krb5/kadm5.keytab.
kadmin.local:</screen>
</step><step><para>Quit <command>kadmin.local</command>.</para><para>You have added
all of the required principals for the next steps.</para><screen>kadmin.local: <userinput>quit</userinput></screen>
</step>
</substeps>
</step><step><para>Start the Kerberos daemons.</para><screen>kdc1 # <userinput>svcadm enable -r network/security/krb5kdc</userinput>
kdc1 # <userinput>svcadm enable -r network/security/kadmin</userinput></screen>
</step><step><para>Start <command>kadmin</command> and add more principals.</para><para>At this point, you can add principals by using the Graphical Kerberos
Administration Tool. To do so, you must log in with one of the <literal>admin</literal> principal
names that you created earlier in this procedure. However, the following command-line
example is shown for simplicity. </para><screen>kdc1 # <userinput>/usr/sbin/kadmin -p kws/admin</userinput>
Enter password: <lineannotation>&lt;Type kws/admin password&gt;</lineannotation>
kadmin: </screen><substeps><step><para><indexterm><primary>KDC</primary><secondary>creating <literal>host</literal> principal</secondary></indexterm><indexterm><primary><literal>host</literal> principal</primary><secondary>creating</secondary></indexterm><indexterm><primary>principal</primary><secondary>creating <literal>host</literal></secondary></indexterm><indexterm><primary><command>kadmin</command> command</primary><secondary>creating <literal>host</literal> principal</secondary></indexterm>Create the master KDC <literal>host</literal> principal.</para><para>The host principal is used by Kerberized
applications, such as <command>klist</command> and <command>kprop</command>.
Solaris 10 clients use this principal when mounting an authenticated NFS file
system. Note that when the principal instance is a host name, the FQDN must
be specified in lowercase letters, regardless of the case of the domain name
in the <filename>/etc/resolv.conf</filename> file.</para><screen>kadmin: <userinput>addprinc -randkey host/kdc1.example.com</userinput>
Principal "host/kdc1.example.com@EXAMPLE.COM" created.
kadmin: </screen>
</step><step performance="optional"><para><indexterm><primary><literal>clntconfig</literal> principal</primary><secondary>creating</secondary></indexterm><indexterm><primary>principal</primary><secondary>creating  <literal>clntconfig</literal></secondary></indexterm>Create the <literal>kclient</literal> principal.</para><para>This
principal is used by the <command>kclient</command> utility during the installation
of a Kerberos client. If you do not plan on using this utility, then you do
not need to add the principal. The users of the <command>kclient</command> utility
need to use this password.</para><screen>kadmin: <userinput>addprinc clntconfig/admin</userinput>
Enter password for principal clntconfig/admin@EXAMPLE.COM:<lineannotation>&lt;Type the password&gt;</lineannotation>
Re-enter password for principal clntconfig/admin@EXAMPLE.COM: <lineannotation>&lt;Type it again&gt;</lineannotation>
Principal "clntconfig/admin@EXAMPLE.COM" created.
kadmin: </screen>
</step><step><para><indexterm><primary>keytab file</primary><secondary>adding master KDC's host principal to</secondary></indexterm>Add the master KDC's <literal>host</literal> principal to the master KDC's keytab file.</para><para>Adding the
host principal to the keytab file allows this principal to be used automatically.</para><screen>kadmin: <userinput>ktadd host/kdc1.example.com</userinput>
Entry for principal host/kdc1.example.com with kvno 3, encryption type AES-256 CTS mode
          with 96-bit SHA-1 HMAC added to keytab WRFILE:/etc/krb5/krb5.keytab.
Entry for principal host/kdc1.example.com with kvno 3, encryption type AES-128 CTS mode
          with 96-bit SHA-1 HMAC added to keytab WRFILE:/etc/krb5/krb5.keytab.
Entry for principal host/kdc1.example.com with kvno 3, encryption type Triple DES cbc
          mode with HMAC/sha1 added to keytab WRFILE:/etc/krb5/krb5.keytab.
Entry for principal host/kdc1.example.com with kvno 3, encryption type ArcFour
          with HMAC/md5 added to keytab WRFILE:/etc/krb5/krb5.keytab.
Entry for principal host/kdc1.example.com with kvno 3, encryption type DES cbc mode
          with RSA-MD5 added to keytab WRFILE:/etc/krb5/krb5.keytab.
kadmin: </screen>
</step><step><para>Quit <command>kadmin</command>.</para><screen>kadmin: <userinput>quit</userinput></screen>
</step>
</substeps>
</step><step performance="optional"><para><indexterm><primary>KDC</primary><secondary>synchronizing clocks</secondary><tertiary>master KDC</tertiary></indexterm><indexterm><primary>clock synchronizing</primary><secondary>Kerberos master KDC and</secondary></indexterm><indexterm><primary>NTP</primary><secondary>master KDC and</secondary></indexterm><indexterm><primary>synchronizing clocks</primary><secondary>master KDC</secondary></indexterm>Synchronize the master KDCs clock by using NTP
or another clock synchronization mechanism.</para><para>Installing and using
the Network Time Protocol (NTP) is not required. However, every clock must
be within the default time that is defined in the <literal>libdefaults</literal> section
of the <filename>krb5.conf</filename> file for authentication to succeed.
See <olink targetptr="setup-192" remap="internal">Synchronizing Clocks Between KDCs and Kerberos
Clients</olink> for information about NTP.</para>
</step><step><para>Configure Slave KDCs.</para><para>To provide redundancy, make
sure to install at least one slave KDC. See <olink targetptr="setup-74" remap="internal">How
to Configure a Slave KDC</olink> for specific instructions.</para>
</step>
</procedure>
</task><task id="ggdvb"><title>How to Automatically Configure a Slave KDC</title><indexterm><primary>automatically configuring</primary><secondary>Kerberos</secondary><tertiary>slave KDC server</tertiary>
</indexterm><indexterm><primary>slave KDCs</primary><secondary>automatically configuring</secondary>
</indexterm><indexterm><primary>KDC</primary><secondary>configuring slave</secondary><tertiary>automatic</tertiary>
</indexterm><indexterm><primary>configuring</primary><secondary>Kerberos</secondary><tertiary>slave KDC server</tertiary>
</indexterm><tasksummary><para>Starting with the Solaris 10 5/08 and the Solaris Express Developer Edition 1/08 releases, a slave KDC
can be automatically configured by using the following procedure.</para>
</tasksummary><procedure><step><para>Become superuser.</para>
</step><step><para>Create the KDC.</para><para>Run the <command>kdcmgr</command> utility
to create the KDC. You need to provide both the master key password and the
password for the administrative principal.<indexterm><primary><command>kdcmgr</command> command</primary><secondary>configuring slave</secondary><tertiary>automatic</tertiary></indexterm></para><screen>kdc2# <userinput>kdcmgr -a kws/admin -r EXAMPLE.COM create -m kdc1 slave</userinput>

Starting server setup
---------------------------------------

Setting up /etc/krb5/kdc.conf

Setting up /etc/krb5/krb5.conf
Obtaining TGT for kws/admin ... 
Password for kws/admin@EXAMPLE.COM: <lineannotation>&lt;Type the password&gt;</lineannotation>

Setting up /etc/krb5/kadm5.acl. 

Setting up /etc/krb5/kpropd.acl. 

Waiting for database from master... 
Waiting for database from master... 
Waiting for database from master... 
kdb5_util: Cannot find/read stored master key while reading master key 
kdb5_util: Warning: proceeding without master key 
Enter KDC database master key: <lineannotation>&lt;Type the password&gt;</lineannotation>

--------------------------------------------------- 
Setup COMPLETE. 

kdc2#</screen>
</step>
</procedure>
</task><task id="ggdua"><title>How to Interactively Configure a Slave KDC</title><indexterm><primary>interactively configuring</primary><secondary>Kerberos</secondary><tertiary>slave KDC server</tertiary>
</indexterm><indexterm><primary>slave KDCs</primary><secondary>interactively configuring</secondary>
</indexterm><indexterm><primary>KDC</primary><secondary>configuring slave</secondary><tertiary>interactive</tertiary>
</indexterm><indexterm><primary>configuring</primary><secondary>Kerberos</secondary><tertiary>slave KDC server</tertiary>
</indexterm><tasksummary><para>Starting with the Solaris 10 5/08 and the Solaris Express Developer Edition 1/08 releases, a slave KDC
can be interactively configured by using the following procedure.</para>
</tasksummary><procedure><step><para>Become superuser.</para>
</step><step><para>Create the KDC.</para><para>Run the <command>kdcmgr</command> utility
to create the KDC. You need to provide both the master key password and the
password for the administrative principal.<indexterm><primary><command>kdcmgr</command> command</primary><secondary>configuring slave</secondary><tertiary>interactive</tertiary></indexterm></para><screen>kdc1# <userinput>kdcmgr create slave</userinput>

Starting server setup
---------------------------------------

Enter the Kerberos realm: <userinput>EXAMPLE.COM</userinput>
What is the master KDC's host name?: <userinput>kdc1</userinput>

Setting up /etc/krb5/kdc.conf

Setting up /etc/krb5/krb5.conf
Obtaining TGT for kws/admin ... 
Password for kws/admin@EXAMPLE.COM: <lineannotation>&lt;Type the password&gt;</lineannotation>

Setting up /etc/krb5/kadm5.acl. 

Setting up /etc/krb5/kpropd.acl. 

Waiting for database from master... 
Waiting for database from master... 
Waiting for database from master... 
kdb5_util: Cannot find/read stored master key while reading master key 
kdb5_util: Warning: proceeding without master key 
Enter KDC database master key: <lineannotation>&lt;Type the password&gt;</lineannotation>

--------------------------------------------------- 
Setup COMPLETE. 

kdc2#</screen>
</step>
</procedure>
</task><task id="setup-74"><title>How to Configure a Slave KDC</title><indexterm><primary>slave KDCs</primary><secondary>configuring</secondary>
</indexterm><indexterm><primary>KDC</primary><secondary>configuring slave</secondary><tertiary>manual</tertiary>
</indexterm><indexterm><primary>manually configuring</primary><secondary>Kerberos</secondary><tertiary>slave KDC server</tertiary>
</indexterm><indexterm><primary>configuring</primary><secondary>Kerberos</secondary><tertiary>slave KDC server</tertiary>
</indexterm><tasksummary><itemizedlist mark="bullet"><para>In this procedure, a new slave KDC named <literal>kdc2</literal> is
configured. Also, incremental propagation is configured. This procedure uses
the following configuration parameters:</para><listitem><para>Realm name = <literal>EXAMPLE.COM</literal></para>
</listitem><listitem><para>DNS domain name = <literal>example.com</literal></para>
</listitem><listitem><para>Master KDC = <literal>kdc1.example.com</literal></para>
</listitem><listitem><para>Slave KDC = <literal>kdc2.example.com</literal></para>
</listitem><listitem><para><literal>admin</literal> principal = <literal>kws/admin</literal></para>
</listitem>
</itemizedlist>
</tasksummary><taskprerequisites><para>The master KDC must be configured. For specific instructions if this
slave is to be swappable, see <olink targetptr="aadmin-2" remap="internal">Swapping a Master
KDC and a Slave KDC</olink>.</para>
</taskprerequisites><procedure><step><para>On the master KDC, become superuser.</para>
</step><step><para>On the master KDC, start <command>kadmin</command>.</para><para>You
must log in with one of the <literal>admin</literal> principal names that
you created when you configured the master KDC.</para><screen>kdc1 # <userinput>/usr/sbin/kadmin -p kws/admin</userinput>
Enter password: <lineannotation>&lt;Type kws/admin password&gt;</lineannotation>
kadmin: </screen><substeps><step id="ggdsm"><para>On the master KDC, add slave host principals to the
database, if not already done.</para><para>For the slave to function, it must
have a host principal. Note that when the principal instance is a host name,
the FQDN must be specified in lowercase letters, regardless of the case of
the domain name in the <filename>/etc/resolv.conf</filename> file.</para><screen>kadmin: <userinput>addprinc -randkey host/kdc2.example.com</userinput>
Principal "host/kdc2.example.com@EXAMPLE.COM" created.
kadmin: </screen>
</step><step><para>On the master KDC, create the <literal>kiprop</literal> principal.</para><para>The <literal>kiprop</literal> principal is used to authorize incremental
propagation from the master KDC.</para><screen>kadmin: <userinput>addprinc -randkey kiprop/kdc2.example.com</userinput>
Principal "kiprop/kdc2.example.com@EXAMPLE.COM" created.
kadmin:</screen>
</step><step id="ggdqe"><para>Quit <command>kadmin</command>.</para><screen>kadmin: <userinput>quit</userinput></screen>
</step>
</substeps>
</step><step id="ggdqh"><para>On the master KDC, edit the Kerberos configuration
file (<filename>krb5.conf</filename>).</para><para>You need to add an entry
for each slave. See the <olink targetdoc="group-refman" targetptr="krb5.conf-4" remap="external"><citerefentry><refentrytitle>krb5.conf</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink> man
page for a full description of this file.</para><screen>kdc1 # <userinput>cat /etc/krb5/krb5.conf</userinput>
 .
 .
[realms]
                EXAMPLE.COM = {
                kdc = kdc1.example.com
                <userinput>kdc = kdc2.example.com</userinput>
                admin_server = kdc1.example.com
        }</screen>
</step><step><para>On the master KDC, add an <literal>kiprop</literal> entry to <filename>kadm5.acl</filename>.</para><para>This entry allows the master KDC to receive
requests for incremental propagation for the <literal>kdc2</literal> server.</para><screen>kdc1 # <userinput>cat /etc/krb5/kadm5.acl</userinput>
*/admin@EXAMPLE.COM *
<userinput>kiprop/kdc2.example.com@EXAMPLE.COM p</userinput></screen>
</step><step><para>On the master KDC, restart <command>kadmind</command> to use the
new entries in the <filename>kadm5.acl</filename> file.</para><screen>kdc1 # <userinput>svcadm restart network/security/kadmin</userinput></screen>
</step><step id="ggdqr"><para><indexterm><primary>KDC</primary><secondary>copying administration files from slave to master</secondary></indexterm>On all slave
KDCs, copy the KDC administration files from the master KDC server.</para><itemizedlist><para>This step needs to be followed on all slave KDCs, because the master
KDC server has updated information that each KDC server needs. You can use <command>ftp</command> or a similar transfer mechanism to grab copies of the following
files from the master KDC:</para><listitem><para><filename>/etc/krb5/krb5.conf</filename></para>
</listitem><listitem><para><filename>/etc/krb5/kdc.conf</filename></para>
</listitem>
</itemizedlist>
</step><step><para>On all slave KDCs, add an entry for the master KDC and each slave
KDC into the database propagation configuration file, <filename>kpropd.acl</filename>.</para><para>This information needs to be updated on all slave KDC servers.</para><screen>kdc2 # <userinput>cat /etc/krb5/kpropd.acl</userinput>
host/kdc1.example.com@EXAMPLE.COM
host/kdc2.example.com@EXAMPLE.COM</screen>
</step><step><para>On all slave KDCs, make sure that the Kerberos access control
list file, <filename>kadm5.acl</filename>, is not populated.</para><para>An
unmodified <filename>kadm5.acl</filename> file would look like:</para><screen>kdc2 # <userinput>cat /etc/krb5/kadm5.acl</userinput>
*/admin@___default_realm___ *</screen><para>If the file has <literal>kiprop</literal> entries, remove them.</para>
</step><step><para>On the new slave, change an entry in <filename>kdc.conf</filename>.</para><para>Replace the <literal>sunw_dbprop_master_ulogsize</literal> entry with
an entry defining <literal>sunw_dbprop_slave_poll</literal>. The entry sets
the poll time to 2 minutes.</para><screen>kdc1 # <userinput>cat /etc/krb5/kdc.conf</userinput>
[kdcdefaults]
        kdc_ports = 88,750

[realms]
        EXAMPLE.COM= {
                profile = /etc/krb5/krb5.conf
                database_name = /var/krb5/principal
                admin_keytab = /etc/krb5/kadm5.keytab
                acl_file = /etc/krb5/kadm5.acl
                kadmind_port = 749
                max_life = 8h 0m 0s
                max_renewable_life = 7d 0h 0m 0s
                sunw_dbprop_enable = true
                <userinput>sunw_dbprop_slave_poll = 2m</userinput>
        }</screen>
</step><step id="ggdqd"><para>On the new slave, start the <command>kadmin</command> command.</para><para>You must log in with one of the <literal>admin</literal> principal
names that you created when you configured the master KDC.</para><screen>kdc2 # <userinput>/usr/sbin/kadmin -p kws/admin</userinput>
Enter password: <lineannotation>&lt;Type kws/admin password&gt;</lineannotation>
kadmin: </screen><substeps><step><para>Add the slave's host principal to the slave's keytab file by using <command>kadmin</command>.</para><para>This entry allows <command>kprop</command> and
other Kerberized applications to function. Note that when the principal instance
is a host name, the FQDN must be specified in lowercase letters, regardless
of the case of the domain name in the <filename>/etc/resolv.conf</filename> file.</para><screen remap="wide">kadmin: <userinput>ktadd host/kdc2.example.com</userinput>
Entry for principal host/kdc2.example.com with kvno 3, encryption type AES-256 CTS mode
          with 96-bit SHA-1 HMAC added to keytab WRFILE:/etc/krb5/krb5.keytab.
Entry for principal host/kdc2.example.com with kvno 3, encryption type AES-128 CTS mode
          with 96-bit SHA-1 HMAC added to keytab WRFILE:/etc/krb5/krb5.keytab.
Entry for principal host/kdc2.example.com with kvno 3, encryption type Triple DES cbc
          mode with HMAC/sha1 added to keytab WRFILE:/etc/krb5/krb5.keytab.
Entry for principal host/kdc2.example.com with kvno 3, encryption type ArcFour
          with HMAC/md5 added to keytab WRFILE:/etc/krb5/krb5.keytab.
Entry for principal host/kdc2.example.com with kvno 3, encryption type DES cbc mode
          with RSA-MD5 added to keytab WRFILE:/etc/krb5/krb5.keytab.
kadmin: </screen>
</step><step><para>Add the <literal>kiprop</literal> principal to the slave KDC's
keytab file.</para><para>Adding the <literal>kiprop</literal> principal to
the <filename>krb5.keytab</filename> file allows the <command>kpropd</command> command
to authenticate itself when incremental propagation is started.</para><screen>kadmin: <userinput>ktadd kiprop/kdc2.example.com</userinput>
Entry for principal kiprop/kdc2.example.com with kvno 3, encryption type AES-256 CTS mode
          with 96-bit SHA-1 HMAC added to keytab WRFILE:/etc/krb5/krb5.keytab.
Entry for principal kiprop/kdc2.example.com with kvno 3, encryption type AES-128 CTS mode
          with 96-bit SHA-1 HMAC added to keytab WRFILE:/etc/krb5/krb5.keytab.
Entry for principal kiprop/kdc2.example.com with kvno 3, encryption type Triple DES cbc
          mode with HMAC/sha1 added to keytab WRFILE:/etc/krb5/krb5.keytab.
Entry for principal kiprop/kdc2.example.com with kvno 3, encryption type ArcFour
          with HMAC/md5 added to keytab WRFILE:/etc/krb5/krb5.keytab.
Entry for principal kiprop/kdc2.example.com with kvno 3, encryption type DES cbc mode
          with RSA-MD5 added to keytab WRFILE:/etc/krb5/krb5.keytab.
kadmin: </screen>
</step><step><para>Quit <command>kadmin</command>.</para><screen>kadmin: <command>quit</command></screen>
</step>
</substeps>
</step><step><para>On the new slave, start the Kerberos propagation daemon.</para><screen>kdc2 # <userinput>svcadm enable network/security/krb5_prop</userinput></screen>
</step><step id="ggdrz"><para><indexterm><primary>stash file</primary><secondary>creating</secondary></indexterm><indexterm><primary>creating</primary><secondary>stash file</secondary></indexterm><indexterm><primary><command>kdb5_util</command> command</primary><secondary>creating stash file</secondary></indexterm>On the new
slave, create a stash file by using <command>kdb5_util</command>.</para><screen>kdc2 # <userinput>/usr/sbin/kdb5_util stash</userinput>
kdb5_util: Cannot find/read stored master key while reading master key
kdb5_util: Warning: proceeding without master key

Enter KDC database master key: <lineannotation>&lt;Type the key&gt;</lineannotation></screen>
</step><step performance="optional" id="ggdqy"><para><indexterm><primary>KDC</primary><secondary>synchronizing clocks</secondary><tertiary>slave KDC</tertiary></indexterm><indexterm><primary>clock synchronizing</primary><secondary>Kerberos slave KDC and</secondary></indexterm><indexterm><primary>NTP</primary><secondary>slave KDC and</secondary></indexterm><indexterm><primary>synchronizing clocks</primary><secondary>slave KDC</secondary></indexterm>On the new slave
KDC, synchronize the master KDCs clock by using NTP or another clock synchronization
mechanism.</para><para>Installing and using the Network Time Protocol (NTP)
is not required. However, every clock must be within the default time that
is defined in the <literal>libdefaults</literal> section of the <filename>krb5.conf</filename> file for authentication to succeed. See <olink targetptr="setup-192" remap="internal">Synchronizing Clocks Between KDCs and Kerberos Clients</olink> for information
about NTP.</para>
</step><step id="ggdsj"><para><indexterm><primary><command>krb5kdc</command> daemon</primary><secondary>starting</secondary></indexterm><indexterm><primary>KDC</primary><secondary>starting daemon</secondary></indexterm><indexterm><primary>starting</primary><secondary>KDC daemon</secondary></indexterm>On the new slave, start the KDC
daemon (<command>krb5kdc</command>).</para><screen>kdc2 # <userinput>svcadm enable network/security/krb5kdc</userinput></screen>
</step>
</procedure>
</task>
</sect1><sect1 id="setup-87"><title>Configuring Cross-Realm Authentication</title><indexterm><primary>realms (Kerberos)</primary><secondary>configuring cross-realm authentication</secondary>
</indexterm><indexterm><primary>configuring</primary><secondary>Kerberos</secondary><tertiary>cross-realm authentication</tertiary>
</indexterm><indexterm><primary>authentication</primary><secondary>configuring cross-realm</secondary>
</indexterm><indexterm><primary>cross-realm authentication</primary><secondary>configuring</secondary>
</indexterm><para>You have several ways of linking realms together so that users in one
realm can be authenticated in another realm. Cross-realm authentication is
accomplished by establishing a secret key that is shared between the two realms.
The relationship of the realms can be either hierarchal or directional (see <olink targetptr="planning-29" remap="internal">Realm Hierarchy</olink>).</para><task id="setup-88"><title>How to Establish Hierarchical Cross-Realm Authentication</title><indexterm><primary>hierarchical realms</primary><secondary>configuring</secondary>
</indexterm><indexterm><primary>realms (Kerberos)</primary><secondary>hierarchical</secondary>
</indexterm><tasksummary><para>The example in this procedure uses two realms, <literal>ENG.EAST.EXAMPLE.COM</literal> and <literal>EAST.EXAMPLE.COM</literal>. Cross-realm authentication
will be established in both directions. This procedure must be completed on
the master KDC in both realms. </para>
</tasksummary><taskprerequisites><para>The master KDC for each realm must be configured. To fully test the
authentication process, several Kerberos clients must be configured.</para>
</taskprerequisites><procedure><step><para>Become superuser on the first master KDC.</para>
</step><step><para>Create ticket-granting ticket service principals for the two realms.</para><para>You must log in with one of the <literal>admin</literal> principal names
that was created when you configured the master KDC.</para><screen># <userinput>/usr/sbin/kadmin -p kws/admin</userinput>
Enter password: <lineannotation>&lt;Type kws/admin password&gt;</lineannotation>
kadmin: <userinput>addprinc krbtgt/ENG.EAST.EXAMPLE.COM@EAST.EXAMPLE.COM</userinput>
Enter password for principal krgtgt/ENG.EAST.EXAMPLE.COM@EAST.EXAMPLE.COM: <lineannotation>&lt;Type password&gt;</lineannotation>
kadmin: <userinput>addprinc krbtgt/EAST.EXAMPLE.COM@ENG.EAST.EXAMPLE.COM</userinput>
Enter password for principal krgtgt/EAST.EXAMPLE.COM@ENG.EAST.EXAMPLE.COM: <lineannotation>&lt;Type password&gt;</lineannotation>
kadmin: <userinput>quit</userinput></screen><note><para>The password that is specified for each service principal must
be identical in both KDCs. Thus, the password for the service principal <literal>krbtgt/ENG.EAST.EXAMPLE.COM@EAST.EXAMPLE.COM</literal> must be the same in
both realms.</para>
</note>
</step><step><para>Add entries to the Kerberos configuration file (<filename>krb5.conf</filename>)
to define domain names for every realm.</para><screen># <userinput>cat /etc/krb5/krb5.conf</userinput>
[libdefaults]
 .
 .
[domain_realm]
        <userinput>.eng.east.example.com = ENG.EAST.EXAMPLE.COM</userinput>
        <userinput>.east.example.com = EAST.EXAMPLE.COM</userinput></screen><para>In this example, domain names for the <literal>ENG.EAST.EXAMPLE.COM</literal> and <literal>EAST.EXAMPLE.COM</literal> realms are defined. It is important to include
the subdomain first, because the file is searched top down.</para>
</step><step><para>Copy the Kerberos configuration file to all clients in this realm.</para><para>For cross-realm authentication to work, all systems (including slave
KDCs and other servers) must have the new version of the Kerberos configuration
file (<filename>/etc/krb5/krb5.conf</filename>)  installed.</para>
</step><step><para>Repeat all of these steps in the second realm.</para>
</step>
</procedure>
</task><task id="setup-92"><title>How to Establish Direct Cross-Realm Authentication</title><indexterm><primary>realms (Kerberos)</primary><secondary>direct</secondary>
</indexterm><indexterm><primary>direct realms</primary>
</indexterm><tasksummary><para>The example in this procedure uses two realms, <literal>ENG.EAST.EXAMPLE.COM</literal> and <literal>SALES.WEST.EXAMPLE.COM</literal>. Cross-realm authentication
will be established in both directions. This procedure must be completed on
the master KDC in both realms. </para>
</tasksummary><taskprerequisites><para>The master KDC for each realm must be configured. To fully test the
authentication process, several Kerberos clients must be configured.</para>
</taskprerequisites><procedure><step><para>Become superuser on one of the master KDC servers.</para>
</step><step><para>Create ticket-granting ticket service principals for the two realms.</para><para>You must log in with one of the <literal>admin</literal> principal names
that was created when you configured the master KDC.</para><screen># <userinput>/usr/sbin/kadmin -p kws/admin</userinput>
Enter password: <lineannotation>&lt;Type kws/admin password&gt;</lineannotation>
kadmin: <userinput>addprinc krbtgt/ENG.EAST.EXAMPLE.COM@SALES.WEST.EXAMPLE.COM</userinput>
Enter password for principal 
  krgtgt/ENG.EAST.EXAMPLE.COM@SALES.WEST.EXAMPLE.COM: <lineannotation>&lt;Type the password&gt;</lineannotation>
kadmin: <userinput>addprinc krbtgt/SALES.WEST.EXAMPLE.COM@ENG.EAST.EXAMPLE.COM</userinput>
Enter password for principal 
  krgtgt/SALES.WEST.EXAMPLE.COM@ENG.EAST.EXAMPLE.COM: <lineannotation>&lt;Type the password&gt;</lineannotation>
kadmin: <userinput>quit</userinput></screen><note><para>The password that is specified for each service principal must
be identical in both KDCs. Thus, the password for the service principal <literal>krbtgt/ENG.EAST.EXAMPLE.COM@SALES.WEST.EXAMPLE.COM</literal> must be the same
in both realms.</para>
</note>
</step><step id="seamtask-step-383"><para>Add entries in the Kerberos configuration
file to define the direct path to the remote realm.</para><para>This example
shows the clients in the <literal>ENG.EAST.EXAMPLE.COM</literal> realm. You
would need to swap the realm names to get the appropriate definitions in the <literal>SALES.WEST.EXAMPLE.COM</literal> realm.</para><screen># <userinput>cat /etc/krb5/krb5.conf</userinput>
[libdefaults]
 .
 .
<userinput>[capaths]</userinput>
    <userinput>ENG.EAST.EXAMPLE.COM = {</userinput>
        <userinput>SALES.WEST.EXAMPLE.COM = .</userinput>
    <userinput>}</userinput>

    <userinput>SALES.WEST.EXAMPLE.COM = {</userinput>
         <userinput>ENG.EAST.EXAMPLE.COM = .</userinput>
    <userinput>}</userinput></screen>
</step><step id="seamtask-step-384"><para>Copy the Kerberos configuration file to
all clients in the current realm.</para><para>For cross-realm authentication
to work, all systems (including slave KDCs and other servers) must have the
new version of the Kerberos configuration file (<filename>/etc/krb5/krb5.conf</filename>)
installed.</para>
</step><step id="seamtask-step-385"><para>Repeat all of these steps for the second
realm.</para>
</step>
</procedure>
</task>
</sect1><sect1 id="setup-119"><title>Configuring Kerberos Network Application Servers</title><indexterm><primary>configuring application servers</primary>
</indexterm><indexterm><primary>application server</primary><secondary>configuring</secondary>
</indexterm><para>Network application servers are hosts that provide access using one
or more of the following network applications: <command>ftp</command>, <command>rcp</command>, <command>rlogin</command>, <command>rsh</command>, <command>ssh</command>,
and <command>telnet</command>. Only a few steps are required to enable the
Kerberos version of these commands on a server.</para><task id="setup-299"><title>How to Configure a Kerberos Network Application
Server</title><tasksummary><itemizedlist mark="bullet"><para>This procedure uses the following configuration parameters:</para><listitem><para>Application server = <literal>boston</literal></para>
</listitem><listitem><para><literal>admin</literal> principal = <literal>kws/admin</literal></para>
</listitem><listitem><para>DNS domain name = <literal>example.com</literal></para>
</listitem><listitem><para>Realm name = <literal>EXAMPLE.COM</literal></para>
</listitem>
</itemizedlist>
</tasksummary><taskprerequisites><para>This procedure requires that the master KDC has been configured. To
fully test the process, several Kerberos clients must be configured.</para>
</taskprerequisites><procedure><step performance="optional"><para>Install the NTP client or another clock
synchronization mechanism.</para><para>See <olink targetptr="setup-192" remap="internal">Synchronizing
Clocks Between KDCs and Kerberos Clients</olink> for information about NTP.</para>
</step><step><para>Add principals for the new server and update the server's keytab.</para><para>The following command reports the existence of the host principal:</para><screen>boston # <userinput>klist -k |grep host</userinput>
4 host/boston.example.com@EXAMPLE.COM
4 host/boston.example.com@EXAMPLE.COM
4 host/boston.example.com@EXAMPLE.COM
4 host/boston.example.com@EXAMPLE.COM</screen><para>If the command does not return a principal, then create new principals
using the following steps.</para><para>How to use the Graphical Kerberos Administration Tool to add a principal
is explained in <olink targetptr="aadmin-17" remap="internal">How to Create a New Kerberos
Principal</olink>. The example in the following steps shows how to add the
required principals using the command line. You must log in with one of the <literal>admin</literal> principal names that you created when configuring the master
KDC.</para><screen>boston # <userinput>/usr/sbin/kadmin -p kws/admin</userinput>
Enter password: <lineannotation>&lt;Type kws/admin password&gt;</lineannotation>
kadmin: </screen><substeps><step><para>Create the server's <literal>host</literal> principal.</para><screen>kadmin: <userinput>addprinc -randkey host/boston.example.com</userinput>
Principal "host/boston.example.com" created.
kadmin: </screen>
</step><step><para>Add the server's <literal>host</literal> principal to the server's
keytab.</para><para>If the <command>kadmin</command> command is not running,
restart it with a command similar to the following: <literal>/usr/sbin/kadmin
-p</literal> <replaceable>kws</replaceable><literal>/admin</literal></para><screen remap="wide">kadmin: <userinput>ktadd host/boston.example.com</userinput>
Entry for principal host/boston.example.com with kvno 3, encryption type AES-256 CTS mode
          with 96-bit SHA-1 HMAC added to keytab WRFILE:/etc/krb5/krb5.keytab.
Entry for principal host/boston.example.com with kvno 3, encryption type AES-128 CTS mode
          with 96-bit SHA-1 HMAC added to keytab WRFILE:/etc/krb5/krb5.keytab.
Entry for principal host/boston.example.com with kvno 3, encryption type Triple DES cbc
          mode with HMAC/sha1 added to keytab WRFILE:/etc/krb5/krb5.keytab.
Entry for principal host/boston.example.com with kvno 3, encryption type ArcFour
          with HMAC/md5 added to keytab WRFILE:/etc/krb5/krb5.keytab.
Entry for principal host/boston.example.com with kvno 3, encryption type DES cbc mode
          with RSA-MD5 added to keytab WRFILE:/etc/krb5/krb5.keytab.
kadmin:</screen>
</step><step><para>Quit <command>kadmin</command>.</para><screen>kadmin: <userinput>quit</userinput></screen>
</step>
</substeps>
</step>
</procedure>
</task>
</sect1><sect1 id="setup-97"><title>Configuring Kerberos NFS Servers</title><para><indexterm><primary>task maps</primary><secondary>configuring Kerberos NFS servers</secondary></indexterm>NFS services use UNIX user IDs (UIDs) to
identify a user and cannot directly use GSS credentials. To translate the
credential to a UID, a credential table that maps user credentials to UNIX
UIDs might need to be created. See <olink targetptr="ezlsz" remap="internal">Mapping GSS Credentials
to UNIX Credentials</olink> for more information on the default credential
mapping. The procedures in this section focus on the tasks that are necessary
to configure a Kerberos NFS server, to administer the credential table, and
to initiate Kerberos security modes for NFS-mounted file systems. The following
task map describes the tasks that are covered in this section.</para><table frame="all" pgwide="1" id="seamtask-tbl-12"><title>Configuring Kerberos
NFS Servers (Task Map)</title><tgroup cols="3" colsep="1" rowsep="1"><colspec colwidth="110*"/><colspec colname="col2" colwidth="167*"/><colspec colwidth="119*"/><thead><row><entry><para>Task</para>
</entry><entry><para>Description</para>
</entry><entry><para>For Instructions</para>
</entry>
</row>
</thead><tbody><row><entry><para>Configure a Kerberos NFS server.</para>
</entry><entry><para>Enables a server to share a file system that requires Kerberos authentication.</para>
</entry><entry><para><olink targetptr="setup-237" remap="internal">How to Configure Kerberos NFS Servers</olink></para>
</entry>
</row><row><entry><para>Create a credential table.</para>
</entry><entry><para>Generates a credential table which can be used to provide mapping from
GSS credentials to UNIX user IDs, if the default mapping is not sufficient.</para>
</entry><entry><para><olink targetptr="setup-133" remap="internal">How to Create a Credential Table</olink></para>
</entry>
</row><row><entry><para>Change the credential table that maps user credentials to UNIX UIDs.</para>
</entry><entry><para>Updates information in the credential table.</para>
</entry><entry><para><olink targetptr="setup-137" remap="internal">How to Add a Single Entry to the Credential
Table</olink></para>
</entry>
</row><row><entry><para>Create credential mappings between two like realms.</para>
</entry><entry><para>Provides instructions on how to map UIDs from one realm to another if
the realms share a password file.</para>
</entry><entry><para><olink targetptr="ezltf" remap="internal">How to Provide Credential Mapping Between Realms</olink></para>
</entry>
</row><row><entry><para>Share a file system with Kerberos authentication.</para>
</entry><entry><para>Shares a file system with security modes so that Kerberos authentication
is required.</para>
</entry><entry><para><olink targetptr="setup-275" remap="internal">How to Set Up a Secure NFS Environment
With Multiple Kerberos Security Modes</olink></para>
</entry>
</row>
</tbody>
</tgroup>
</table><task id="setup-237"><title>How to Configure Kerberos NFS Servers</title><indexterm><primary>configuring</primary><secondary>Kerberos</secondary><tertiary>NFS servers</tertiary>
</indexterm><indexterm><primary>NFS servers</primary><secondary>configuring for Kerberos</secondary>
</indexterm><tasksummary><itemizedlist mark="bullet"><para>In this procedure, the following configuration parameters are used: </para><listitem><para>Realm name = <literal>EXAMPLE.COM</literal></para>
</listitem><listitem><para>DNS domain name = <literal>example.com</literal></para>
</listitem><listitem><para>NFS server = <literal>denver.example.com</literal></para>
</listitem><listitem><para><literal>admin</literal> principal = <literal>kws/admin</literal></para>
</listitem>
</itemizedlist>
</tasksummary><procedure><step id="seamtask-step-386"><para>Complete the prerequisites for configuring
a Kerberos NFS server.</para><para>The master KDC must be configured. To fully
test the process, you need several clients. </para>
</step><step performance="optional" id="setup-step-270"><para>Install the NTP client
or another clock synchronization mechanism.</para><para>Installing and using
the Network Time Protocol (NTP) is not required. However, every clock must
be synchronized with the time on the KDC server within a maximum difference
defined by the <literal>clockskew</literal> relation in the <filename>krb5.conf</filename> file
for authentication to succeed. See <olink targetptr="setup-192" remap="internal">Synchronizing
Clocks Between KDCs and Kerberos Clients</olink> for information about NTP.</para>
</step><step><para>Configure the NFS server as a Kerberos client.</para><para>Follow
the instructions in <olink targetptr="setup-148" remap="internal">Configuring Kerberos Clients</olink>.</para>
</step><step id="seamtask-step-387"><para>Start <command>kadmin</command>.</para><para>You
can use the Graphical Kerberos Administration Tool to add a principal, as
explained in <olink targetptr="aadmin-17" remap="internal">How to Create a New Kerberos Principal</olink>.
To do so, you must log in with one of the <literal>admin</literal> principal
names that you created when you configured the master KDC. However, the following
example shows how to add the required principals by using the command line. </para><screen>denver # <userinput>/usr/sbin/kadmin -p kws/admin</userinput>
Enter password: <lineannotation>&lt;Type kws/admin password&gt;</lineannotation>
kadmin: </screen><substeps><step id="seamtask-step-388"><para>Create the server's NFS service principal.</para><para>Note that when the principal instance is a host name, the FQDN must
be specified in lowercase letters, regardless of the case of the domain name
in the <filename>/etc/resolv.conf</filename> file.</para><para>Repeat this step for each unique interface on the system that might
be used to access NFS data. If a host has multiple interfaces with unique
names, each unique name must have its own NFS service principal.</para><screen>kadmin: <userinput>addprinc -randkey nfs/denver.example.com</userinput>
Principal "nfs/denver.example.com" created.
kadmin:</screen>
</step><step id="seamtask-step-389"><para>Add the server's NFS service principal
to the server's keytab file.</para><para>Repeat this step for each unique
service principal created in <olink targetptr="seamtask-step-388" remap="internal">Step&nbsp;a</olink>.</para><screen remap="wide">kadmin: <userinput>ktadd nfs/denver.example.com</userinput>
Entry for principal nfs/denver.example.com with kvno 3, encryption type AES-256 CTS mode
          with 96-bit SHA-1 HMAC added to keytab WRFILE:/etc/krb5/krb5.keytab.
Entry for principal nfs/denver.example.com with kvno 3, encryption type AES-128 CTS mode
          with 96-bit SHA-1 HMAC added to keytab WRFILE:/etc/krb5/krb5.keytab.
Entry for principal nfs/denver.example.com with kvno 3, encryption type Triple DES cbc
          mode with HMAC/sha1 added to keytab WRFILE:/etc/krb5/krb5.keytab.
Entry for principal nfs denver.example.com with kvno 3, encryption type ArcFour
          with HMAC/md5 added to keytab WRFILE:/etc/krb5/krb5.keytab.
Entry for principal nfs/denver.example.com with kvno 3, encryption type DES cbc mode
          with RSA-MD5 added to keytab WRFILE:/etc/krb5/krb5.keytab.
kadmin:</screen>
</step><step id="seamtask-step-390"><para>Quit <command>kadmin</command>.</para><screen>kadmin: <userinput>quit</userinput></screen>
</step>
</substeps>
</step><step performance="optional" id="seamtask-step-391"><para>Create special GSS
credential maps, if needed.</para><para>Normally, the Kerberos service generates
appropriate maps between the GSS credentials and the UNIX UIDs. The default
mapping is described in <olink targetptr="ezlsz" remap="internal">Mapping GSS Credentials to
UNIX Credentials</olink>. If the default mapping is not sufficient, see <olink targetptr="setup-133" remap="internal">How to Create a Credential Table</olink> for more information.</para>
</step><step id="seamtask-step-392"><para>Share the NFS file system with Kerberos
security modes.</para><para>See <olink targetptr="setup-275" remap="internal">How to Set Up
a Secure NFS Environment With Multiple Kerberos Security Modes</olink> for
more information.</para>
</step>
</procedure>
</task><task id="setup-133"><title>How to Create a Credential Table</title><indexterm><primary>creating</primary><secondary>credential table</secondary>
</indexterm><indexterm><primary>user ID</primary><secondary> in NFS services</secondary>
</indexterm><indexterm><primary>principal</primary><secondary>user ID comparison</secondary>
</indexterm><tasksummary><para>The <command>gsscred</command> credential table is used by an NFS server
to map Kerberos credentials to a UID. By default, the primary part of the
principal name is matched to a UNIX login name. For NFS clients to mount file
systems from an NFS server with Kerberos authentication, this table must be
created if the default mapping is not sufficient.</para>
</tasksummary><procedure><step id="seamtask-step-394"><para>Edit <filename>/etc/gss/gsscred.conf</filename> and
change the security mechanism.</para><para>Change the mechanism to <literal>files</literal>.</para>
</step><step id="seamtask-step-395"><para>Create the credential table by using the <command>gsscred</command> command.</para><screen># <userinput>gsscred -m kerberos_v5 -a</userinput></screen><para>The <command>gsscred</command> command gathers information from all
sources that are listed with the <literal>passwd</literal> entry in the <filename>/etc/nsswitch.conf</filename> file. You might need to temporarily remove the <literal>files</literal> entry, if you do not want the local password entries included
in the credential table. See the <olink targetdoc="group-refman" targetptr="gsscred-1m" remap="external"><citerefentry><refentrytitle>gsscred</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man page for more information.</para>
</step>
</procedure>
</task><task id="setup-137"><title>How to Add a Single Entry to the Credential Table</title><indexterm><primary>credential table</primary><secondary>adding single entry to</secondary>
</indexterm><taskprerequisites><para>This procedure requires that the <command>gsscred</command> table has
already been created on the NFS server. See <olink targetptr="setup-133" remap="internal">How
to Create a Credential Table</olink> for instructions.</para>
</taskprerequisites><procedure><step id="seamtask-step-396"><para>Become superuser on the NFS server.</para>
</step><step id="seamtask-step-397"><para>Add an entry to the credential table by
using the <command>gsscred</command> command.</para><screen># <userinput>gsscred -m <replaceable>mech</replaceable> [ -n <replaceable>name</replaceable> [ -u <replaceable>uid</replaceable> ]] -a</userinput></screen><variablelist><varlistentry><term><replaceable>mech</replaceable></term><listitem><para>Defines the security mechanism to be used.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>name</replaceable></term><listitem><para>Defines the principal name for the user, as defined in the
KDC.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>uid</replaceable></term><listitem><para>Defines the UID for the user, as defined in the password database.</para>
</listitem>
</varlistentry><varlistentry><term><option>a</option></term><listitem><para>Adds the UID to principal name mapping.</para>
</listitem>
</varlistentry>
</variablelist>
</step>
</procedure><example id="ehgax"><title>Adding a Multiple Component Principal to the Credential Table</title><para>In the following example, an entry is added for a principal named <literal>sandy/admin</literal>, which is mapped to UID <literal>3736</literal>.</para><screen># <userinput>gsscred -m kerberos_v5 -n sandy/admin -u 3736 -a</userinput></screen>
</example><example id="fgonl"><title>Adding a Principal in a Different Domain to the Credential Table</title><para>In the following example, an entry is added for a principal named <literal>sandy/admin@EXAMPLE.COM</literal>, which is mapped to UID <literal>3736</literal>.</para><screen># <userinput>gsscred -m kerberos_v5 -n sandy/admin@EXAMPLE.COM -u 3736 -a</userinput></screen>
</example>
</task><task id="ezltf"><title>How to Provide Credential Mapping Between Realms</title><tasksummary><para>This procedure provides appropriate credential mapping between realms
that use the same password file. In this example, the realms <literal>CORP.EXAMPLE.COM</literal> and <literal>SALES.EXAMPLE.COM</literal> use the same password
file. The credentials for <literal>bob@CORP.EXAMPLE.COM</literal> and <literal>bob@SALES.EXAMPLE.COM</literal> are mapped to the same UID.</para>
</tasksummary><procedure><step><para>Become superuser.</para>
</step><step><para>On the client system, add entries to the <filename>krb5.conf</filename> file.</para><screen># <userinput>cat /etc/krb5/krb5.conf</userinput>
[libdefaults]
        <userinput>default_realm = CORP.EXAMPLE.COM</userinput>
 .
<userinput>[realms]</userinput>
    <userinput>CORP.EXAMPLE.COM = {</userinput>
        .
        <userinput>auth_to_local_realm = SALES.EXAMPLE.COM</userinput>
        .
    }</screen>
</step>
</procedure><example id="gfywy"><title>Mapping Credentials Between Realms Using the Same Password File</title><para>This example provides appropriate credential mapping between realms
that use the same password file. In this example, the realms <literal>CORP.EXAMPLE.COM</literal> and <literal>SALES.EXAMPLE.COM</literal> use the same password
file. The credentials for <literal>bob@CORP.EXAMPLE.COM</literal> and <literal>bob@SALES.EXAMPLE.COM</literal> are mapped to the same UID. On the client system, add entries to
the <filename>krb5.conf</filename> file.</para><screen># <userinput>cat /etc/krb5/krb5.conf</userinput>
[libdefaults]
        <userinput>default_realm = CORP.EXAMPLE.COM</userinput>
 .
<userinput>[realms]</userinput>
    <userinput>CORP.EXAMPLE.COM = {</userinput>
        .
        <userinput>auth_to_local_realm = SALES.EXAMPLE.COM</userinput>
        .
    }</screen>
</example><taskrelated role="troubleshooting"><para>See <olink targetptr="fabaf" remap="internal">Observing Mapping from GSS Credentials
to UNIX Credentials</olink> to help with the process of troubleshooting credential
mapping problems.</para>
</taskrelated>
</task><task id="setup-275"><title>How to Set Up a Secure NFS Environment With Multiple
Kerberos Security Modes</title><indexterm><primary>security modes</primary><secondary>setting up environment with multiple</secondary>
</indexterm><tasksummary><para>This procedure enables a NFS server to provide secure NFS access using
different security modes or flavors. When a client negotiates a security flavor
with the NFS server, the first flavor that is offered by the server that the
client has access to is used. This flavor is used for all subsequent client
requests of the file system shared by the NFS server.</para>
</tasksummary><procedure><step id="seamtask-step-398"><para>Become superuser on the NFS server.</para>
</step><step id="seamtask-step-399"><para>Verify that there is an NFS service principal
in the keytab file.</para><para>The <command>klist</command> command reports
if there is a keytab file and displays the principals. If the results show
that no keytab file exists or that no NFS service principal exists, you need
to verify the completion of all the steps in <olink targetptr="setup-237" remap="internal">How
to Configure Kerberos NFS Servers</olink>.</para><screen># <userinput>klist -k</userinput>
Keytab name: FILE:/etc/krb5/krb5.keytab
KVNO Principal
---- ---------------------------------------------------------
   3 nfs/denver.example.com@EXAMPLE.COM
   3 nfs/denver.example.com@EXAMPLE.COM
   3 nfs/denver.example.com@EXAMPLE.COM
   3 nfs/denver.example.com@EXAMPLE.COM</screen>
</step><step id="seamtask-step-400"><para>Enable Kerberos security modes in the <filename>/etc/nfssec.conf</filename> file.</para><para>Edit the <filename>/etc/nfssec.conf</filename> file and remove the &ldquo;#&rdquo; that is placed in front of
the Kerberos security modes.</para><screen># <userinput>cat /etc/nfssec.conf</userinput>
 .
 .
#
# Uncomment the following lines to use Kerberos V5 with NFS
#
krb5            390003  kerberos_v5     default -               # RPCSEC_GSS
krb5i           390004  kerberos_v5     default integrity       # RPCSEC_GSS
krb5p           390005  kerberos_v5     default privacy         # RPCSEC_GSS</screen>
</step><step id="seamtask-step-401"><para>Share the file systems with the appropriate security modes.</para><screen><userinput>sharemgr share -o sec=<replaceable>mode</replaceable> <replaceable>file-system</replaceable></userinput></screen><variablelist><varlistentry><term><replaceable>mode</replaceable></term><listitem><para>Specifies the security modes to be used when sharing the file
system. When using multiple security modes, the first mode in the list is
used as the default.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>file-system</replaceable></term><listitem><para>Defines the path to the file system to be shared.</para>
</listitem>
</varlistentry>
</variablelist><para>All clients that attempt to access files from the named file system
require Kerberos authentication. To access files, the user principal on the
NFS client should be authenticated.</para>
</step><step performance="optional" id="setup-step-278"><para>If the automounter
is being used, edit the <literal>auto_master</literal> database to select
a security mode other than the default.</para><para>You need not follow this
procedure if you are not using the automounter to access the file system or
if the default selection for the security mode is acceptable.</para><screen><replaceable>file-system</replaceable>  auto_home  -nosuid,sec=<replaceable>mode</replaceable></screen>
</step><step performance="optional" id="setup-step-241"><para>Manually issue the <command>mount</command> command to access the file system by using a non-default mode.</para><para>Alternatively, you could use the <command>mount</command> command to
specify the security mode, but this alternative does not take advantage of
the automounter.</para><screen># <userinput>mount -F nfs -o sec=<replaceable>mode</replaceable> <replaceable>file-system</replaceable></userinput></screen>
</step>
</procedure><example id="ehgaz"><title>Sharing a File System With One Kerberos Security Mode</title><para>In this example, Kerberos authentication must succeed before any files can
be accessed through the NFS service.</para><screen># <userinput>sharemgr share -F nfs -p -o sec=krb5 /export/hom</userinput>e</screen>
</example><example id="ehgbc"><title>Sharing a File System With Multiple Kerberos Security Modes</title><para>In this example, all three Kerberos security modes have been selected.
Which mode is used is negotiated between the client and the NFS server. If
the first mode in the command fails, then the next is tried. See the <olink targetdoc="group-refman" targetptr="nfssec-5" remap="external"><citerefentry><refentrytitle>nfssec</refentrytitle><manvolnum>5</manvolnum></citerefentry></olink> man page for
more information.</para><screen># <userinput>sharemgr share -F nfs -p -o sec=krb5:krb5i:krb5p /export/home</userinput></screen>
</example>
</task>
</sect1><sect1 id="setup-148"><title>Configuring Kerberos Clients</title><indexterm><primary>clients</primary><secondary>configuring Kerberos</secondary>
</indexterm><indexterm><primary>configuring</primary><secondary>Kerberos</secondary><tertiary>clients</tertiary>
</indexterm><para>Kerberos clients include any host, that is not a KDC server, on the
network that needs to use Kerberos services. This section provides procedures
for installing a Kerberos client, as well as specific information about using <filename>root</filename> authentication to mount NFS file systems.</para><sect2 id="seamtask-435"><title>Configuring Kerberos Clients (Task Map)</title><para>The following task map includes all of the procedures associated with
setting up Kerberos clients. Each row includes a task identifier, a description
of why you would want to do that task, followed by a link to the task.</para><informaltable frame="all" pgwide="1" id="setup-tbl-12"><tgroup cols="3" colsep="1" rowsep="1"><colspec colwidth="110*"/><colspec colname="col2" colwidth="167*"/><colspec colwidth="119*"/><thead><row><entry><para>Task</para>
</entry><entry><para>Description</para>
</entry><entry><para>For Instructions</para>
</entry>
</row>
</thead><tbody><row><entry><para>Establish a Kerberos client installation profile.</para>
</entry><entry><para>Generates a client installation profile that can be used to automatically
install a Kerberos client.</para>
</entry><entry><para><olink targetptr="seamtask-436" remap="internal">How to Create a Kerberos Client Installation
Profile</olink></para>
</entry>
</row><row rowsep="0"><entry><para>Configure a Kerberos client.</para>
</entry><entry><para>Manually installs a Kerberos client. Use this procedure if each client
installation requires unique installation parameters.</para>
</entry><entry><para><olink targetptr="setup-341" remap="internal">How to Manually Configure a Kerberos Client</olink></para>
</entry>
</row><row rowsep="0"><entry>
</entry><entry><para>Automatically installs a Kerberos client. Use this procedure if the
installation parameters for each client are the same.</para>
</entry><entry><para><olink targetptr="seamtask-439" remap="internal">How to Automatically Configure a Kerberos
Client</olink></para>
</entry>
</row><row rowsep="0"><entry>
</entry><entry><para>Interactively installs a Kerberos client. Use this procedure if only
a few of the installation parameters need to change.</para>
</entry><entry><para><olink targetptr="seamtask-443" remap="internal">How to Interactively Configure a Kerberos
Client</olink></para>
</entry>
</row><row><entry>
</entry><entry><para>Automatically installs a Kerberos client of an Active Directory server. </para>
</entry><entry><para><olink targetptr="ggtwg" remap="internal">How to Configure a Kerberos Client for an Active
Directory Server</olink></para>
</entry>
</row><row><entry><para>Allow a client to access a NFS file system as the <literal>root</literal> user</para>
</entry><entry><para>Creates a <literal>root</literal> principal on the client, so that the
client can mount a NFS file system shared with <literal>root</literal> access.
Also, allows for the client to set up non-interactive <literal>root</literal> access
to the NFS file system, so that cron jobs can run.</para>
</entry><entry><para><olink targetptr="fgohx" remap="internal">How to Access a Kerberos Protected NFS File
System as the root User</olink></para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</sect2><task id="seamtask-436"><title>How to Create a Kerberos Client Installation
Profile</title><tasksummary><para>This procedure creates a kclient profile that can be used when you install
a Kerberos client. By using the kclient profile, you reduce the likelihood
of typing errors. Also, using the profile reduces user intervention as compared
to the interactive process.</para>
</tasksummary><procedure><step><para>Become superuser.</para>
</step><step><para>Create a kclient installation profile.</para><para>A sample kclient
profile could look similar to the following:</para><screen>client# <userinput>cat /net/denver.example.com/export/install/profile</userinput>
REALM EXAMPLE.COM
KDC kdc1.example.com
ADMIN clntconfig
FILEPATH /net/denver.example.com/export/install/krb5.conf
NFS 1
DNSLOOKUP none</screen>
</step>
</procedure>
</task><task id="seamtask-439"><title>How to Automatically Configure a Kerberos Client</title><taskprerequisites><para>This procedure uses an installation profile. See <olink targetptr="seamtask-436" remap="internal">How to Create a Kerberos Client Installation Profile</olink>.</para>
</taskprerequisites><procedure><step><para>Become superuser.</para>
</step><step id="seamtask-step-441"><para>Run the <command>kclient</command> installation
script.</para><para>You need to provide the password for the <literal>clntconfig</literal> principal
to complete the process.</para><screen>client# <userinput>/usr/sbin/kclient -p /net/denver.example.com/export/install/profile</userinput>

Starting client setup
---------------------------------------------------

kdc1.example.com

Setting up /etc/krb5/krb5.conf.

Obtaining TGT for clntconfig/admin ...
Password for clntconfig/admin@EXAMPLE.COM: <lineannotation>&lt;Type the password&gt;</lineannotation>

nfs/client.example.com entry ADDED to KDC database.
nfs/client.example.com entry ADDED to keytab.

host/client.example.com entry ADDED to KDC database.
host/client.example.com entry ADDED to keytab.

Copied /net/denver.example.com/export/install/krb5.conf.

---------------------------------------------------
Setup COMPLETE.

client#</screen>
</step>
</procedure><example id="seamtask-ex-442"><title>Automatically Configuring a Kerberos Client With Command-Line Overrides</title><para>The following example overrides the <literal>DNSARG</literal> and the <literal>KDC</literal> parameters that are set in the installation profile.</para><screen># <userinput>/usr/sbin/kclient -p /net/denver.example.com/export/install/profile</userinput>\
<userinput>-d dns_fallback -k kdc2.example.com</userinput>

Starting client setup
---------------------------------------------------

kdc1.example.com

Setting up /etc/krb5/krb5.conf.

Obtaining TGT for clntconfig/admin ...
Password for clntconfig/admin@EXAMPLE.COM: <lineannotation>&lt;Type the password&gt;</lineannotation>

nfs/client.example.com entry ADDED to KDC database.
nfs/client.example.com entry ADDED to keytab.

host/client.example.com entry ADDED to KDC database.
host/client.example.com entry ADDED to keytab.

Copied /net/denver.example.com/export/install/krb5.conf.

---------------------------------------------------
Setup COMPLETE.

client#</screen>
</example>
</task><task id="seamtask-443"><title>How to Interactively Configure a Kerberos Client</title><tasksummary><para>This procedure uses the <command>kclient</command> installation utility
without a installation profile. In build 90 of the Solaris Express
Community Edition release, the <command>kclient</command> utility has been
expanded to improve ease of use and ability to work with Active Directory
servers. See <olink targetptr="ggtwg" remap="internal">How to Configure a Kerberos Client for
an Active Directory Server</olink> for more information. See <olink targetptr="ehgbb" remap="internal">Example&nbsp;23&ndash;9</olink> for an example of running <command>kclient</command> on a previous Solaris release.</para>
</tasksummary><procedure id="egyrl"><step><para>Become superuser.</para>
</step><step><para>Run the <command>kclient</command> installation script.</para><itemizedlist><para>You need to provide the following information:</para><listitem><para>Kerberos realm name</para>
</listitem><listitem><para>KDC master host name</para>
</listitem><listitem><para>KDC
slave host names</para>
</listitem><listitem><para>Domains to map to the local
realm</para>
</listitem><listitem><para>PAM service names and options to use
for Kerberos authentication</para>
</listitem>
</itemizedlist><substeps><step><para>Indicate if the KDC server is not running a Solaris release.</para><para>If this system is a client of a KDC server that is not running a Solaris
release, you need to define the type of server that is running the KDC. The
available servers are: Microsoft Active Directory, MIT KDC server, Heimdal
KDC server, and Shishi KDC server.</para>
</step><step><para>Select if DNS should be used for Kerberos lookups.</para><para>If
you use DNS for Kerberos lookups, you need to enter the DNS lookup option
that you want to use. Valid options are <option role="nodash">dns_lookup_kdc</option>, <option role="nodash">dns_lookup_realm</option>, and <option role="nodash">dns_fallback</option>.
See the <olink targetdoc="group-refman" targetptr="krb5.conf-4" remap="external"><citerefentry><refentrytitle>krb5.conf</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink> man
page for more information about these values.</para>
</step><step><para>Define the name of the Kerberos realm and the master KDC hostname.</para><para>This information is added to the <filename>/etc/krb5/krb5.conf</filename> configuration
file.</para>
</step><step><para>Select if slave KDCs exist.</para><para>If there are slave KDCs
in the realm, then you need to enter the slave KDC host names. This information
is used to create additional KDC entries in  the client's configuration file.</para>
</step><step><para>Indicate if service or host keys are required.</para><para>Normally,
service or host keys are not required unless the client system is hosting
Kerberized services.</para>
</step><step><para>Specify if the client is a member of a cluster.</para><para>If
the client is a member of a cluster, then you need to provide the logical
name of the cluster. The logical host name is used when creating service keys,
which is required when hosting Kerberos services from clusters.</para>
</step><step><para>Identify any domains or hosts to map to the current realm.</para><para>This mapping allows other domains to belong in the default realm of
the client.</para>
</step><step><para>Specify if the client will use Kerberized NFS.</para><para>NFS
service keys need to be created if the client will host NFS services using
Kerberos.</para>
</step><step><para>Indicate if the <filename>/etc/pam.conf</filename> file needs
to be updated.</para><itemizedlist><para>This allows you to set which PAM services use Kerberos for authentication.
You need to enter the service name and a flag indicating how Kerberos authentication
is to be used. The valid flag options are:</para><listitem><para><literal>first</literal> &ndash; use Kerberos authentication
first, and only use UNIX if Kerberos authentication fails</para>
</listitem><listitem><para><literal>only</literal> &ndash; use Kerberos authentication
only</para>
</listitem><listitem><para><literal>optional</literal> &ndash; use Kerberos authentication
optionally</para>
</listitem>
</itemizedlist>
</step><step><para>Select if the master <filename>/etc/krb5/krb5.conf</filename> file
should be copied.</para><para>This option allows for specific configuration
information to be used when the arguments to <command>kclient</command> are
not sufficient.</para>
</step>
</substeps>
</step>
</procedure><example id="ggtsk"><title>Running the <command>kclient</command> Installation Utility</title><screen>client# <userinput>/usr/sbin/kclient</userinput>

Starting client setup
---------------------------------------------------

Is this a client of a non-Solaris KDC ? [y/n]: <userinput>n</userinput>
        No action performed.
Do you want to use DNS for kerveros lookups ? [y/n]: <userinput>n</userinput>
        No action performed.
Enter the Kerberos realm: <userinput>EXAMPLE.COM</userinput>
Specify the KDC hostname for the above realm: <userinput>kdc1.example.com</userinput>

Note, this system and the KDC's time must be within 5 minutes of each other for
Kerberos to function. Both systems should run some form of time synchronization
system like Network Time Protocol (NTP).
Do you have any slave KDC(s) ? [y/n]: <userinput>y</userinput>
Enter a comma-separated list of slave KDC host names: <userinput>kdc2.example.com</userinput>

Will this client need service keys ? [y/n]: <userinput>n</userinput>
        No action performed.
Is this client a member of a cluster that uses a logical host name ? [y/n]: <userinput>n</userinput>
        No action performed.
Do you have multiple domains/hosts to map to realm ? [y/n]: <userinput>y</userinput>
Enter a comma-separated list of domain/hosts to map to the default realm: <userinput>engineering.example.com, \
        example.com</userinput>

Setting up /etc/krb5/krb5.conf.

Do you plan on doing Kerberized nfs ? [y/n]: <userinput>y</userinput>
Do you want to update /etc/pam.conf ? [y/n]: <userinput>y</userinput>
Enter a comma-separated list of PAM service names in the following format:
service:{first|only|optional}: <userinput>xscreensaver:first</userinput>
Configuring /etc/pam.conf.

Do you want to copy over the master krb5.conf file ? [y/n]: <userinput>n</userinput>
        No action performed.

---------------------------------------------------
Setup COMPLETE.</screen>
</example><example id="ehgbb"><title>Running the <command>kclient</command> Installation Utility on
the Solaris 10 Release</title><para>The following output shows the results of running the <command>kclient</command> command.</para><screen>client# <userinput>/usr/sbin/kclient</userinput>

Starting client setup
---------------------------------------------------

Do you want to use DNS for kerberos lookups ? [y/n]: <userinput>n</userinput>
        No action performed.
Enter the Kerberos realm: <userinput>EXAMPLE.COM</userinput>
Specify the KDC hostname for the above realm: <userinput>kdc1.example.com</userinput>

Setting up /etc/krb5/krb5.conf.

Enter the krb5 administrative principal to be used: <userinput>clntconfig/admin</userinput>
Obtaining TGT for clntconfig/admin ...
Password for clntconfig/admin@EXAMPLE.COM: <lineannotation>&lt;Type the password&gt;</lineannotation>
Do you plan on doing Kerberized nfs ? [y/n]: <userinput>n</userinput>

host/client.example.com entry ADDED to KDC database.
host/client.example.com entry ADDED to keytab.

Do you want to copy over the master krb5.conf file ? [y/n]: <userinput>y</userinput>
Enter the pathname of the file to be copied: \
<userinput>/net/denver.example.com/export/install/krb5.conf</userinput>

Copied /net/denver.example.com/export/install/krb5.conf.

---------------------------------------------------
Setup COMPLETE !
#</screen>
</example>
</task><task id="ggtwg"><title>How to Configure a Kerberos Client
for an Active Directory Server</title><tasksummary><para>This procedure uses the <command>kclient</command> installation utility
without a installation profile.</para>
</tasksummary><procedure id="ggttx"><step><para>Become superuser.</para>
</step><step performance="optional"><para>Enable DNS resource record creation for
the client.</para><para>This command causes DNS records to be created when
the client is joined to the Active Directory domain.</para><screen>client# <userinput>svccfg -s smb/server setprop smbd/ddns_enable=true</userinput></screen>
</step><step><para>Run the <command>kclient</command> installation script.</para><itemizedlist><para>You need to provide the following information:</para><listitem><para>Password for the administrative principal</para>
</listitem>
</itemizedlist>
</step>
</procedure><example id="ggtur"><title>Configuring a Kerberos Client for an Active Directory Server Using <command>kclient</command>.</title><para>The following output shows the results of running the <command>kclient</command> command
using the <option role="nodash">ms_ad</option> (Microsoft Active Directory)
server type argument. The client will be joined to the Active Directory domain
called EXAMPLE.COM.</para><screen>client# <userinput>/usr/sbin/kclient -T ms_ad</userinput>

Starting client setup
---------------------------------------------------

Attempting to join 'CLIENT' to the 'EXAMPLE.COM' domain.
Password for Administrator@EXAMPLE.COM: <lineannotation>&lt;Type the password&gt;</lineannotation>
Forest name found: example.com
Looking for local KDCs, DCs and global catalog servers (SVR RRs).

Setting up /etc/krb5/krb5.conf

Creating the machine account in AD via LDAP.
---------------------------------------------------
Setup COMPLETE.
#</screen>
</example>
</task><task id="setup-341"><title>How to Manually Configure a Kerberos Client</title><tasksummary><itemizedlist mark="bullet"><para>In this procedure, the following configuration parameters are used:</para><listitem><para>Realm name = <literal>EXAMPLE.COM</literal></para>
</listitem><listitem><para>DNS domain name = <literal>example.com</literal></para>
</listitem><listitem><para>Master KDC = <literal>kdc1.example.com</literal></para>
</listitem><listitem><para>Slave KDC = <literal>kdc2.example.com</literal></para>
</listitem><listitem><para>NFS server = <literal>denver.example.com</literal></para>
</listitem><listitem><para>Client = <literal>client.example.com</literal></para>
</listitem><listitem><para><literal>admin</literal> principal = <literal>kws/admin</literal></para>
</listitem><listitem><para>User principal = <literal>mre</literal></para>
</listitem><listitem><para>Online help URL = <literal>http://denver:8888/ab2/coll.384.1/SEAM/@AB2PageView/6956</literal></para><note><para>Adjust the URL to point to the &ldquo;Graphical Kerberos Administration
Tool&rdquo; section, as described in the <olink targetptr="seamplan-3" remap="internal">Online
Help URL in the Graphical Kerberos Administration Tool</olink>.</para>
</note>
</listitem>
</itemizedlist>
</tasksummary><procedure><step id="seamtask-step-403"><para>Become superuser.</para>
</step><step id="seamtask-step-404"><para>Edit the Kerberos configuration file (<filename>krb5.conf</filename>).</para><para>To change the file from the Kerberos default
version, you need to change the realm names and the server names. You also
need to identify the path to the help files for <command>gkadmin</command>.</para><screen>kdc1 # <userinput>cat /etc/krb5/krb5.conf</userinput>
[libdefaults]
        default_realm = <userinput>EXAMPLE.COM</userinput>

[realms]
        <userinput>EXAMPLE.COM</userinput> = {
        <userinput>kdc = kdc1.example.com</userinput>
        <userinput>kdc = kdc2.example.com</userinput>
        admin_server = <userinput>kdc1.example.com</userinput>
        }

[domain_realm]
        <userinput>.example.com = EXAMPLE.COM</userinput>
#
# if the domain name and realm name are equivalent, 
# this entry is not needed
#
[logging]
        default = FILE:/var/krb5/kdc.log
        kdc = FILE:/var/krb5/kdc.log

[appdefaults]
    gkadmin = {
        help_url = <userinput>http://denver:8888/ab2/coll.384.1/SEAM/@AB2PageView/6956</userinput></screen><note><para>If you want to restrict the encryption types, you can set the <literal>default_tkt_enctypes</literal> or <literal>default_tgs_enctypes</literal> lines.
Refer to <olink targetptr="egric" remap="internal">Using Kerberos Encryption Types</olink> for
a description of the issues involved with restricting the encryption types.</para>
</note>
</step><step performance="optional"><para>Change the process used to locate the KDCs.</para><itemizedlist><para>Starting with the Solaris 10 5/08 and Solaris Express Developer Edition 1/08 releases, by default the
Kerberos realm to KDC mapping is determined in the following order:</para><listitem><para>The definition in the <literal>realms</literal> section in <filename>krb5.conf</filename>.</para>
</listitem><listitem><para>By looking up SRV records in DNS.</para>
</listitem>
</itemizedlist><para>You can change this behavior by adding <literal>dns_lookup_kdc</literal> or <literal>dns_fallback</literal> to the <literal>libdefaults</literal> section of the <filename>krb5.conf</filename> file. See the <olink targetdoc="group-refman" targetptr="krb5.conf-4" remap="external"><citerefentry><refentrytitle>krb5.conf</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink> man page for more information.
Note that referrals are always tried first.</para>
</step><step performance="optional"><para>Change the process used to determine the
realm for a host.</para><itemizedlist><para>Starting with the Solaris 10 5/08 and Solaris Express Developer Edition 1/08 releases, by default the
host to realm mapping is determined in the following order:</para><listitem><para>If the KDC supports referrals, then the KDC may inform the
client which realm the host belongs to.</para>
</listitem><listitem><para>By the definition of <literal>domain_realm</literal> in the <filename>krb5.conf</filename> file.</para>
</listitem><listitem><para>The DNS domainname of the host.</para>
</listitem><listitem><para>The default realm.</para>
</listitem>
</itemizedlist><para>You can change this behavior by adding <literal>dns_lookup_kdc</literal> or <literal>dns_fallback</literal> to the <literal>libdefaults</literal> section of the <filename>krb5.conf</filename>file. See the <olink targetdoc="group-refman" targetptr="krb5.conf-4" remap="external"><citerefentry><refentrytitle>krb5.conf</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink> man page for more information.
Note that referrals will always be tried first.</para>
</step><step performance="optional" id="setup-step-220"><para>Synchronize the client's
clock with the master KDC's clock by using NTP or another clock synchronization
mechanism.</para><para>Installing and using the Network Time Protocol (NTP)
is not required. However, every clock must be synchronized with the time on
the KDC server within a maximum difference defined in the <literal>clockskew</literal> relation
in the <filename>krb5.conf</filename> file for authentication to succeed.
See <olink targetptr="setup-192" remap="internal">Synchronizing Clocks Between KDCs and Kerberos
Clients</olink> for information about NTP.</para>
</step><step id="ejurk"><para>Start <command>kadmin</command>.</para><para>You can
use the Graphical Kerberos Administration Tool to add a principal, as explained
in <olink targetptr="aadmin-17" remap="internal">How to Create a New Kerberos Principal</olink>.
To do so, you must log in with one of the <literal>admin</literal> principal
names that you created when you configured the master KDC. However, the following
example shows how to add the required principals by using the command line. </para><screen>denver # <userinput>/usr/sbin/kadmin -p kws/admin</userinput>
Enter password: <lineannotation>&lt;Type kws/admin password&gt;</lineannotation>
kadmin: </screen><substeps><step performance="optional" id="setup-step-221a"><para>Create a user principal
if a user principal does not already exist.</para><para>You need to create
a user principal only if the user associated with this host does not already
have a principal assigned to him or her.</para><screen>kadmin: <userinput>addprinc mre</userinput>
Enter password for principal mre@EXAMPLE.COM: <lineannotation>&lt;Type the password&gt;</lineannotation>
Re-enter password for principal mre@EXAMPLE.COM: <lineannotation>&lt;Type it again&gt;</lineannotation>
kadmin: </screen>
</step><step performance="optional" id="ejusb"><para>Create a <literal>root</literal> principal
and add the principal to the server's keytab file.</para><para>This step is
required so that the client can have <literal>root</literal> access to file
systems mounted using the NFS service. This step is also required if non-interactive <literal>root</literal> access is needed, such as running cron jobs as <literal>root</literal>.</para><para>If the client does not require <literal>root</literal> access to a remote
file system which is mounted using the NFS service, then you can skip this
step. The <literal>root</literal> principal should be a two component principal
with the second component the host name of the Kerberos client system to avoid
 the creation of a realm wide <literal>root</literal> principal. Note that
when the principal instance is a host name, the FQDN must be specified in
lowercase letters, regardless of the case of the domain name in the <filename>/etc/resolv.conf</filename> file.</para><screen remap="wide">kadmin: <userinput>addprinc -randkey root/client.example.com</userinput>
Principal "root/client.example.com" created.
kadmin: <userinput>ktadd root/client.example.com</userinput>
Entry for principal root/client.example.com with kvno 3, encryption type AES-256 CTS mode
          with 96-bit SHA-1 HMAC added to keytab WRFILE:/etc/krb5/krb5.keytab.
Entry for principal root/client.example.com with kvno 3, encryption type AES-128 CTS mode
          with 96-bit SHA-1 HMAC added to keytab WRFILE:/etc/krb5/krb5.keytab.
Entry for principal root/client.example.com with kvno 3, encryption type Triple DES cbc
          mode with HMAC/sha1 added to keytab WRFILE:/etc/krb5/krb5.keytab.
Entry for principal root/client.example.com with kvno 3, encryption type ArcFour
          with HMAC/md5 added to keytab WRFILE:/etc/krb5/krb5.keytab.
Entry for principal root/client.example.com with kvno 3, encryption type DES cbc mode
          with RSA-MD5 added to keytab WRFILE:/etc/krb5/krb5.keytab.
kadmin: </screen>
</step><step id="ejuqx"><para>Create a <literal>host</literal> principal and add
the principal to the server's keytab file.</para><para>The <literal>host</literal> principal
is used by remote access services to provide authentication. The principal
allows <literal>root</literal> to acquire a credential, if there is not one
already in the keytab file.</para><screen remap="wide">kadmin: <userinput>addprinc -randkey host/denver.example.com</userinput>
Principal "host/denver.example.com@EXAMPLE.COM" created.
kadmin: <userinput>ktadd host/denver.example.com</userinput>
Entry for principal host/denver.example.com with kvno 3, encryption type AES-256 CTS mode
          with 96-bit SHA-1 HMAC added to keytab WRFILE:/etc/krb5/krb5.keytab.
Entry for principal host/denver.example.com with kvno 3, encryption type AES-128 CTS mode
          with 96-bit SHA-1 HMAC added to keytab WRFILE:/etc/krb5/krb5.keytab.
Entry for principal host/denver.example.com with kvno 3, encryption type Triple DES cbc
          mode with HMAC/sha1 added to keytab WRFILE:/etc/krb5/krb5.keytab.
Entry for principal host/denver.example.com with kvno 3, encryption type ArcFour
          with HMAC/md5 added to keytab WRFILE:/etc/krb5/krb5.keytab.
Entry for principal host/denver.example.com with kvno 3, encryption type DES cbc mode
          with RSA-MD5 added to keytab WRFILE:/etc/krb5/krb5.keytab.
kadmin:</screen>
</step><step performance="optional" id="ejusq"><para>Add the server's NFS service
principal to the server's keytab file.</para><para>This step is only required
if the client needs to access NFS file systems using Kerberos authentication.</para><screen remap="wide">kadmin: <userinput>ktadd nfs/denver.example.com</userinput>
Entry for principal nfs/denver.example.com with kvno 3, encryption type AES-256 CTS mode
          with 96-bit SHA-1 HMAC added to keytab WRFILE:/etc/krb5/krb5.keytab.
Entry for principal nfs/denver.example.com with kvno 3, encryption type AES-128 CTS mode
          with 96-bit SHA-1 HMAC added to keytab WRFILE:/etc/krb5/krb5.keytab.
Entry for principal nfs/denver.example.com with kvno 3, encryption type Triple DES cbc
          mode with HMAC/sha1 added to keytab WRFILE:/etc/krb5/krb5.keytab.
Entry for principal nfs/denver.example.com with kvno 3, encryption type ArcFour
          with HMAC/md5 added to keytab WRFILE:/etc/krb5/krb5.keytab.
Entry for principal nfs/denver.example.com with kvno 3, encryption type DES cbc mode
          with RSA-MD5 added to keytab WRFILE:/etc/krb5/krb5.keytab.
kadmin: </screen>
</step><step><para>Add the <literal>host</literal> principal to the server's keytab
file.</para><screen remap="wide">kadmin: <userinput>ktadd host/denver.example.com</userinput>
Entry for principal host/denver.example.com with kvno 3, encryption type AES-256 CTS mode
          with 96-bit SHA-1 HMAC added to keytab WRFILE:/etc/krb5/krb5.keytab.
Entry for principal host/denver.example.com with kvno 3, encryption type AES-128 CTS mode
          with 96-bit SHA-1 HMAC added to keytab WRFILE:/etc/krb5/krb5.keytab.
Entry for principal host/denver.example.com with kvno 3, encryption type Triple DES cbc
          mode with HMAC/sha1 added to keytab WRFILE:/etc/krb5/krb5.keytab.
Entry for principal host/denver.example.com with kvno 3, encryption type ArcFour
          with HMAC/md5 added to keytab WRFILE:/etc/krb5/krb5.keytab.
Entry for principal host/denver.example.com with kvno 3, encryption type DES cbc mode
          with RSA-MD5 added to keytab WRFILE:/etc/krb5/krb5.keytab.
kadmin:</screen>
</step><step id="ejutc"><para>Quit <command>kadmin</command>.</para><screen>kadmin: <userinput>quit</userinput></screen>
</step>
</substeps>
</step><step performance="optional" id="seamtask-step-406"><para>Enable Kerberos
with NFS.</para><substeps><step><para>Enable Kerberos security modes in the <filename>/etc/nfssec.conf</filename> file.</para><para>Edit the <filename>/etc/nfssec.conf</filename> file and remove
the &ldquo;#&rdquo; that is placed in front of the Kerberos security modes.</para><screen># <userinput>cat /etc/nfssec.conf</userinput>
 .
 .
#
# Uncomment the following lines to use Kerberos V5 with NFS
#
krb5            390003  kerberos_v5     default -               # RPCSEC_GSS
krb5i           390004  kerberos_v5     default integrity       # RPCSEC_GSS
krb5p           390005  kerberos_v5     default privacy         # RPCSEC_GSS</screen>
</step><step><para>Enable DNS.</para><para>If the <filename>/etc/resolv.conf</filename> file
has not already been created, then create this file as the service principal
canonicalization is dependent upon DNS to do this. See the <olink targetdoc="group-refman" targetptr="resolv.conf-4" remap="external"><citerefentry><refentrytitle>resolv.conf</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink> man page for
more information.</para>
</step><step><para>Restart the <command>gssd</command> service.</para><para>After
the <filename>/etc/resolv.conf</filename> file has been created or modified
you must then restart the <command>gssd</command> daemon to reread any changes.</para><screen># <userinput>svcadm restart network/rpc/gss</userinput></screen>
</step>
</substeps>
</step><step id="seamtask-step-407"><para><indexterm><primary>tickets</primary><secondary>warning about expiration</secondary></indexterm><indexterm><primary>warning about ticket expiration</primary></indexterm>If you want the client to automatically
renew the TGT or to warn users about Kerberos ticket expiration, create an
entry in the <filename>/etc/krb5/warn.conf</filename> file. </para><para>See
the <olink targetdoc="group-refman" targetptr="warn.conf-4" remap="external"><citerefentry><refentrytitle>warn.conf</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink> man
page for more information.</para>
</step>
</procedure><example id="ehgbd"><title>Setting Up a Kerberos Client Using a Non-Solaris KDC</title><para>A Kerberos client can be set up to work with a non-Solaris KDC. In this
case, a line must be included in the <filename>/etc/krb5/krb5.conf</filename> file
in the <literal>realms</literal> section. This line changes the protocol that
is used when the client is communicating with the Kerberos password-changing
server. The format of this line follows.</para><screen>[realms]
                EXAMPLE.COM = {
                kdc = kdc1.example.com
                kdc = kdc2.example.com
                admin_server = kdc1.example.com
                <userinput>kpasswd_protocol = SET_CHANGE</userinput>
        }</screen>
</example><example><title>DNS TXT Records for the Mapping of Host and Domain Name to Kerberos
Realm</title><screen>@ IN SOA kdc1.example.com root.kdc1.example.com (
                                1989020501   ;serial
                                10800        ;refresh
                                3600         ;retry
                                3600000      ;expire
                                86400 )      ;minimum

                        IN      NS      kdc1.example.com.
kdc1                    IN      A       192.146.86.20
kdc2                    IN      A       192.146.86.21

_kerberos.example.com.             IN      TXT     "EXAMPLE.COM"
_kerberos.kdc1.example.com.        IN      TXT     "EXAMPLE.COM"
_kerberos.kdc2.example.com.        IN      TXT     "EXAMPLE.COM"</screen>
</example><example id="ejusj"><title>DNS SRV Records for Kerberos Server Locations</title><para>This example defines the records for the location of the
KDCs, the <literal>admin</literal> server, and the <literal>kpasswd</literal> server,
respectively.</para><screen>@ IN SOA kdc1.example.com root.kdc1.example.com (
                                1989020501   ;serial
                                10800        ;refresh
                                3600         ;retry
                                3600000      ;expire
                                86400 )      ;minimum

                                   IN      NS      kdc1.example.com.
kdc1                               IN      A       192.146.86.20
kdc2                               IN      A       192.146.86.21

_kerberos._udp.EXAMPLE.COM         IN      SRV 0 0 88  kdc2.example.com
_kerberos._tcp.EXAMPLE.COM         IN      SRV 0 0 88  kdc2.example.com
_kerberos._udp.EXAMPLE.COM         IN      SRV 1 0 88  kdc1.example.com
_kerberos._tcp.EXAMPLE.COM         IN      SRV 1 0 88  kdc1.example.com
_kerberos-adm._tcp.EXAMPLE.COM     IN      SRV 0 0 749 kdc1.example.com
_kpasswd._udp.EXAMPLE.COM          IN      SRV 0 0 749 kdc1.example.com</screen>
</example>
</task><task id="fgohx"><title>How to Access a Kerberos Protected NFS File System
as the <literal>root</literal> User</title><tasksummary><para>This procedure allows a client to access a NFS file system that requires
Kerberos authentication with the <literal>root</literal> ID privilege. In
particular, if the NFS file system is shared with options like: <option>o</option> <literal>sec=krb5,root=client1.sun.com</literal>.</para>
</tasksummary><procedure><step><para>Become superuser.</para>
</step><step><para>Start <command>kadmin</command>.</para><para>You can use the Graphical
Kerberos Administration Tool to add a principal, as explained in <olink targetptr="aadmin-17" remap="internal">How to Create a New Kerberos Principal</olink>. To do
so, you must log in with one of the <literal>admin</literal> principal names
that you created when you configured the master KDC. However, the following
example shows how to add the required principals by using the command line. </para><screen>denver # <userinput>/usr/sbin/kadmin -p kws/admin</userinput>
Enter password: <lineannotation>&lt;Type kws/admin password&gt;</lineannotation>
kadmin: </screen><substeps><step><para>Create a <literal>root</literal> principal for the NFS client.</para><para>This principal is used to provide root equivalent access to NFS mounted
file systems that require Kerberos authentication. The <literal>root</literal> principal
should be a two component principal with the second component the host name
of the Kerberos client system to avoid  the creation of a realm wide root
principal. Note that when the principal instance is a host name, the FQDN
must be specified in lowercase letters, regardless of the case of the domain
name in the <filename>/etc/resolv.conf</filename> file.</para><screen>kadmin: <userinput>addprinc -randkey root/client.example.com</userinput>
Principal "root/client.example.com" created.
kadmin:</screen>
</step><step><para>Add the <literal>root</literal> principal to the server's keytab
file.</para><para>This step is required if you added a <literal>root</literal> principal
so that the client can have <literal>root</literal> access to file systems
mounted using the NFS service. This step is also required if non-interactive <literal>root</literal> access is needed, such as running cron jobs as <literal>root</literal>.</para><screen remap="wide">kadmin: <userinput>ktadd root/client.example.com</userinput>
Entry for principal root/client.example.com with kvno 3, encryption type AES-256 CTS mode
          with 96-bit SHA-1 HMAC added to keytab WRFILE:/etc/krb5/krb5.keytab.
Entry for principal root/client.example.com with kvno 3, encryption type AES-128 CTS mode
          with 96-bit SHA-1 HMAC added to keytab WRFILE:/etc/krb5/krb5.keytab.
Entry for principal root/client.example.com with kvno 3, encryption type Triple DES cbc
          mode with HMAC/sha1 added to keytab WRFILE:/etc/krb5/krb5.keytab.
Entry for principal root/client.example.com with kvno 3, encryption type ArcFour
          with HMAC/md5 added to keytab WRFILE:/etc/krb5/krb5.keytab.
Entry for principal root/client.example.com with kvno 3, encryption type DES cbc mode
          with RSA-MD5 added to keytab WRFILE:/etc/krb5/krb5.keytab.
kadmin: </screen>
</step><step><para>Quit <command>kadmin</command>.</para><screen>kadmin: <userinput>quit</userinput></screen>
</step>
</substeps>
</step>
</procedure>
</task><task id="faavx"><title>How to Configure Automatic Migration of Users in a
Kerberos Realm</title><tasksummary><para>Users, who do not have a Kerberos principal, can be automatically migrated
to an existing Kerberos realm. The migration is achieved by using the PAM
framework for the service  in use by stacking the <literal>pam_krb5_migrate</literal> module
in  the service's authentication stack in <filename>/etc/pam.conf</filename>.</para><itemizedlist mark="bullet"><para>In this example, the <literal>dtlogin</literal> and <literal>other</literal> PAM
service names are configured to use the automatic migration. The following
configuration parameters are used:</para><listitem><para>Realm name = <literal>EXAMPLE.COM</literal></para>
</listitem><listitem><para>Master KDC = <literal>kdc1.example.com</literal></para>
</listitem><listitem><para>Machine hosting the migration service = <literal>server1.example.com</literal></para>
</listitem><listitem><para>Migration service principal = <literal>host/server1.example.com</literal></para>
</listitem>
</itemizedlist>
</tasksummary><taskprerequisites><para>Setup <literal>server1</literal> as a Kerberos client of the realm <literal>EXAMPLE.COM</literal>. See <olink targetptr="setup-148" remap="internal">Configuring Kerberos
Clients</olink> for more information.</para>
</taskprerequisites><procedure><step><para>Check to see if a host service principal for <literal>server1</literal> exists.</para><para>The host service principal in the <filename>keytab</filename> file
of <literal>server1</literal> is used to authenticate the server to the master
KDC.</para><screen>server1 # <userinput>klist -k</userinput>
Keytab name: FILE:/etc/krb5/krb5.keytab
	KVNO Principal
	---- ------------------------------------------------
	   3 host/server1.example.com@EXAMPLE.COM
	   3 host/server1.example.com@EXAMPLE.COM
	   3 host/server1.example.com@EXAMPLE.COM
	   3 host/server1.example.com@EXAMPLE.COM</screen>
</step><step><para>Make changes to the PAM configuration file.</para><substeps><step><para>Add entries for the <literal>dtlogin</literal> service.</para><screen># <userinput>cat /etc/pam.conf</userinput>
 .
 .
<userinput>#
# dtlogin service (explicit because of pam_krb5_migrate)
#
dtlogin       auth requisite          pam_authtok_get.so.1
dtlogin       auth required           pam_dhkeys.so.1
dtlogin       auth required           pam_unix_cred.so.1
dtlogin       auth sufficient         pam_krb5.so.1
dtlogin       auth requisite          pam_unix_auth.so.1
dtlogin       auth optional           pam_krb5_migrate.so.1</userinput></screen>
</step><step performance="optional"><para>Force an immediate password change, if
needed.</para><para>The newly created Kerberos accounts can have their password
expiration time set to the current time (now), in order to force an immediate
Kerberos password change. To set the expiration time to now, add the <option role="nodash">expire_pw</option> option to the lines which use the <literal>pam_krb5_migrate</literal> module. See the <olink targetdoc="group-refman" targetptr="pam-krb5-migrate-5" remap="external"><citerefentry><refentrytitle>pam_krb5_migrate</refentrytitle><manvolnum>5</manvolnum></citerefentry></olink> man page for more information.</para><screen># <userinput>cat /etc/pam.conf</userinput>
 .
 .
<userinput>dtlogin  auth optional           pam_krb5_migrate.so.1 expire_pw</userinput></screen>
</step><step><para>Add the <literal>pam_krb5</literal> module to the account stack.</para><para>This addition allows for password expiration in Kerberos to block access.</para><screen># <userinput>cat /etc/pam.conf</userinput>
 .
 .
#
# Default definition for Account management
# Used when service name is not explicitly mentioned for account management
#
other   account requisite       pam_roles.so.1
<userinput>other   account required        pam_krb5.so.1</userinput>
other   account required        pam_unix_account.so.1</screen>
</step><step><para>Add the <literal>pam_krb5</literal> module to the password stack.</para><para>This addition allows for passwords to be updated when the password expire.</para><screen># <userinput>cat /etc/pam.conf</userinput>
 .
 .
#
# Default definition for Password management
# Used when service name is not explicitly mentioned for password management
#
other   password required       pam_dhkeys.so.1
other   password requisite      pam_authtok_get.so.1
other   password requisite      pam_authtok_check.so.1
other   password sufficient     pam_krb5.so.1
other   password required       pam_authtok_store.so.1</screen>
</step>
</substeps>
</step><step><para>On the master KDC, update the access control file.</para><para>The
following entries grant migrate and inquire privileges to the <literal>host/server1.example.com</literal> service principal for all users, excepting the <literal>root</literal> user.
It is important that users who should not be migrated are listed in the kadm5.acl
file using the <literal>U</literal> privilege. These entries need to be before
the permit all or <literal>ui</literal> entry. See the <olink targetdoc="group-refman" targetptr="kadm5.acl-4" remap="external"><citerefentry><refentrytitle>kadm5.acl</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink> man page for
more information.</para><screen>kdc1 # <userinput>cat /etc/krb5/kadm5.acl</userinput>
host/server1.example.com@EXAMPLE.COM U root
host/server1.example.com@EXAMPLE.COM ui *
*/admin@EXAMPLE.COM *</screen>
</step><step><para>On the master KDC, restart the Kerberos administration daemon.</para><para>This step allows the <command>kadmind</command> daemon to use the new <filename>kadm5.acl</filename> entries.</para><screen>kdc1 # <userinput>svcadm restart network/security/kadmin</userinput></screen>
</step><step><para>On the master KDC, add entries to the <filename>pam.conf</filename> file.</para><para>The following entries enable the <command>kadmind</command> daemon
to use the <literal>k5migrate</literal> PAM service, to validate UNIX user
password for accounts that require migration.</para><screen># <userinput>grep k5migrate /etc/pam.conf</userinput>
k5migrate        auth    required        pam_unix_auth.so.1
k5migrate        account required        pam_unix_account.so.1</screen>
</step>
</procedure>
</task>
</sect1><sect1 id="setup-192"><title>Synchronizing Clocks Between KDCs and Kerberos
Clients</title><indexterm><primary>clock skew</primary><secondary>Kerberos and</secondary>
</indexterm><indexterm><primary>synchronizing clocks</primary><secondary>overview</secondary>
</indexterm><indexterm><primary>Network Time Protocol</primary><see>NTP</see>
</indexterm><para>All hosts that participate in the Kerberos authentication system must
have their internal clocks synchronized within a specified maximum amount
of time  (known as <emphasis>clock skew</emphasis>). This requirement provides
another Kerberos security check. If the clock skew is exceeded between any
of the participating hosts, client requests are rejected.</para><para>The clock skew also determines how long application servers must keep
track of all Kerberos protocol messages, in order to recognize and reject
replayed requests. So, the longer the clock skew value, the more information
that application servers have to collect.</para><para>The default value for the maximum clock skew is 300 seconds (five minutes).
 You can change this default in the <literal>libdefaults</literal> section
of the <filename>krb5.conf</filename> file. </para><note><para>For security reasons, do not increase the clock skew beyond 300
seconds.</para>
</note><para>Because maintaining synchronized clocks between the KDCs and Kerberos
clients is important, you should use the Network Time Protocol (NTP) software
to synchronize them. NTP public domain software from the University of Delaware
is included in the Solaris software, starting with the Solaris 2.6 release.</para><note><para>Another way to synchronize clocks is to use the <command>rdate</command> command
and <command>cron</command> jobs, a process that can be less involved than
using NTP. However, this section focuses on using NTP. And, if you use the
network to synchronize the clocks, the clock synchronization protocol must
itself be secure.</para>
</note><para>NTP enables you to manage precise time or network clock synchronization,
or both, in a network environment.  NTP is basically a server-client implementation.
You pick one system to be the master clock (the NTP server). Then, you set
up all your other systems (the NTP clients) to synchronize their clocks with
the master clock.</para><para>To synchronize the clocks, NTP uses the <literal>xntpd</literal> daemon,
which sets and maintains a UNIX system time-of-day in agreement with Internet
standard time servers. The following shows an example of this server-client
NTP implementation.</para><figure id="setup-fig-228"><title>Synchronizing Clocks by Using NTP</title><mediaobject><imageobject><imagedata entityref="ntp"/>
</imageobject><textobject><simpara>Diagram shows a central NTP server as the master clock
for NTP clients and Kerberos clients that are running the xntpd daemon.</simpara>
</textobject>
</mediaobject>
</figure><orderedlist><para>Ensuring that the KDCs and Kerberos clients maintain synchronized clocks
involves implementing the following steps:</para><listitem><para>Setting up an NTP server on your network. This server can
be any system, except the master KDC. See <olink targetdoc="group-sa" targetptr="time-20" remap="external"><citetitle remap="section">Managing Network Time Protocol (Tasks)</citetitle> in <citetitle remap="book">System Administration Guide: Network Services</citetitle></olink> to find the NTP server task.</para>
</listitem><listitem><para>As you configure the KDCs and Kerberos clients on the network,
setting them up to be NTP clients of the NTP server. See <olink targetdoc="group-sa" targetptr="time-20" remap="external"><citetitle remap="section">Managing Network Time Protocol (Tasks)</citetitle> in <citetitle remap="book">System Administration Guide: Network Services</citetitle></olink> to find the NTP
client task.</para>
</listitem>
</orderedlist>
</sect1><sect1 id="aadmin-2"><title>Swapping a Master KDC and a Slave KDC</title><indexterm><primary>master KDC</primary><secondary>swapping with slave KDC</secondary>
</indexterm><indexterm><primary>slave KDCs</primary><secondary>swapping with master KDC</secondary>
</indexterm><indexterm><primary>KDC</primary><secondary>swapping master and slave</secondary>
</indexterm><indexterm><primary>swapping master and slave KDCs</primary>
</indexterm><para>You should use the procedures in this section to make the swap of a
master KDC with a slave KDC easier. You should swap the master KDC with a
slave KDC only if the master KDC server fails for some reason, or if the master
KDC needs to be re-installed (for example, because new hardware is installed). </para><task id="setup-289"><title>How to Configure a Swappable Slave KDC</title><tasksummary><para>Perform this procedure on the slave KDC server that you want to have
available to become the master KDC. This procedure assumes that you are using
incremental propagation.</para>
</tasksummary><procedure><step id="seamtask-step-408"><para>Use alias names for the master KDC and
the swappable slave KDC during the KDC installation.</para><para>When you
define the host names for the KDCs, make sure that each system has an alias
included in DNS. Also, use the alias names when you define the hosts in the <filename>/etc/krb5/krb5.conf</filename> file.</para>
</step><step id="seamtask-step-409"><para>Follow the steps to install a slave KDC.</para><para>Prior to any swap, this server should function as any other slave KDC
in the realm. See <olink targetptr="setup-74" remap="internal">How to Configure a Slave KDC</olink> for
instructions. </para>
</step><step id="seamtask-step-410"><para>Move the master KDC commands.</para><para>To
prevent the master KDC commands from being run from this slave KDC, move the <command>kprop</command>, <command>kadmind</command>, and <command>kadmin.local</command> commands
to a reserved place.</para><screen>kdc4 # <userinput>mv /usr/lib/krb5/kprop /usr/lib/krb5/kprop.save</userinput>
kdc4 # <userinput>mv /usr/lib/krb5/kadmind /usr/lib/krb5/kadmind.save</userinput>
kdc4 # <userinput>mv /usr/sbin/kadmin.local /usr/sbin/kadmin.local.save</userinput></screen>
</step>
</procedure>
</task><task id="seamtask-16"><title>How to Swap a Master KDC and a Slave KDC</title><tasksummary><para>In this procedure, the master KDC server that is being swapped out is
named <literal>kdc1</literal>. The slave KDC that will become the new master
KDC is named <literal>kdc4</literal>. This procedure assumes that you are
using incremental propagation.</para>
</tasksummary><taskprerequisites><para>This procedure requires that the slave KDC server has been set up as
a swappable slave. For more information, see <olink targetptr="setup-289" remap="internal">How
to Configure a Swappable Slave KDC</olink>). </para>
</taskprerequisites><procedure><step><para>On the new master KDC, start <command>kadmin</command>.</para><screen>kdc4 # <userinput>/usr/sbin/kadmin -p kws/admin</userinput>
Enter password: <lineannotation>&lt;Type kws/admin password&gt;</lineannotation>
kadmin: </screen><substeps><step><para>Create new principals for the <command>kadmind</command> service.</para><para>The following example shows the first <command>addprinc</command> command
on two lines, but it should be typed on one line.</para><screen>kadmin: <userinput>addprinc -randkey -allow_tgs_req +password_changing_service -clearpolicy \
       changepw/kdc4.example.com</userinput>
Principal "changepw/kdc4.example.com@ENG.SUN.COM" created.
kadmin: <userinput>addprinc -randkey -allow_tgs_req -clearpolicy kadmin/kdc4.example.com</userinput>
Principal "kadmin/kdc4.example.com@EXAMPLE.COM" created.
kadmin: </screen>
</step><step><para>Create a keytab file.</para><screen remap="wide">kadmin: <userinput>ktadd -k /etc/krb5/kadm5.keytab kadmin/kdc4.example.com</userinput>
Entry for principal kadmin/kdc4.example.com with kvno 3, encryption type AES-256 CTS mode
          with 96-bit SHA-1 HMAC added to keytab WRFILE:/etc/krb5/kadm5.keytab.
Entry for principal kadmin/kdc4.example.com with kvno 3, encryption type AES-128 CTS mode
          with 96-bit SHA-1 HMAC added to keytab WRFILE:/etc/krb5/kadm5.keytab.
Entry for principal kadmin/kdc4.example.com with kvno 3, encryption type Triple DES cbc
          mode with HMAC/sha1 added to keytab WRFILE:/etc/krb5/kadm5.keytab.
Entry for principal kadmin/kdc4.example.com with kvno 3, encryption type ArcFour
          with HMAC/md5 added to keytab WRFILE:/etc/krb5/kadm5.keytab.
Entry for principal kadmin/kdc4.example.com with kvno 3, encryption type DES cbc mode
          with RSA-MD5 added to keytab WRFILE:/etc/krb5/kadm5.keytab.
kadmin: <userinput>ktadd -k /etc/krb5/kadm5.keytab changepw/kdc4.example.com</userinput>
Entry for principal changepw/kdc4.example.com with kvno 3, encryption type AES-256 CTS mode
          with 96-bit SHA-1 HMAC added to keytab WRFILE:/etc/krb5/kadm5.keytab.
Entry for principal changepw/kdc4.example.com with kvno 3, encryption type AES-128 CTS mode
          with 96-bit SHA-1 HMAC added to keytab WRFILE:/etc/krb5/kadm5.keytab.
Entry for principal changepw/kdc4.example.com with kvno 3, encryption type Triple DES cbc
          mode with HMAC/sha1 added to keytab WRFILE:/etc/krb5/kadm5.keytab.
Entry for principal changepw/kdc4.example.com with kvno 3, encryption type ArcFour
          with HMAC/md5 added to keytab WRFILE:/etc/krb5/kadm5.keytab.
Entry for principal changepw/kdc4.example.com with kvno 3, encryption type DES cbc mode
          with RSA-MD5 added to keytab WRFILE:/etc/krb5/kadm5.keytab.
kadmin: <userinput>ktadd -k /etc/krb5/kadm5.keytab kadmin/changepw</userinput>
Entry for principal kadmin/changepw with kvno 3, encryption type AES-256 CTS mode
          with 96-bit SHA-1 HMAC added to keytab WRFILE:/etc/krb5/kadm5.keytab.
Entry for principal kadmin/changepw with kvno 3, encryption type AES-128 CTS mode
          with 96-bit SHA-1 HMAC added to keytab WRFILE:/etc/krb5/kadm5.keytab.
Entry for principal kadmin/changepw with kvno 3, encryption type Triple DES cbc
          mode with HMAC/sha1 added to keytab WRFILE:/etc/krb5/kadm5.keytab.
Entry for principal kadmin/changepw with kvno 3, encryption type ArcFour
          with HMAC/md5 added to keytab WRFILE:/etc/krb5/kadm5.keytab.
Entry for principal kadmin/changepw with kvno 3, encryption type DES cbc mode
          with RSA-MD5 added to keytab WRFILE:/etc/krb5/kadm5.keytab.
kadmin: </screen>
</step><step><para>Quit <command>kadmin</command>.</para><screen>kadmin: <userinput>quit</userinput></screen>
</step>
</substeps>
</step><step><para>On the new master KDC, force synchronization.</para><para>The
following steps force a full KDC update on the slave server.</para><screen>kdc4 # <userinput>svcadm disable network/security/krb5kdc</userinput>
kdc4 # <userinput>rm /var/krb5/principal.ulog</userinput></screen>
</step><step><para>On the new master KDC, verify that the update is complete.</para><screen>kdc4 # <userinput>/usr/sbin/kproplog -h</userinput></screen>
</step><step><para>On the new master KDC, restart the KDC service.</para><screen>kdc4 # <userinput>svcadm enable -r network/security/krb5kdc</userinput></screen>
</step><step><para>On the new master KDC, clear the update log.</para><para>These
steps reinitialize the update log for the new master KDC server.</para><screen>kdc4 # <userinput>svcadm disable network/security/krb5kdc</userinput>
kdc4 # <userinput>rm /var/krb5/principal.ulog</userinput></screen>
</step><step id="seamtask-step-412"><para>On the old master KDC, kill the <command>kadmind</command> and <command>krb5kdc</command> processes.</para><para>When you
kill the <command>kadmind</command> process, you prevent any changes from
being made to the KDC database.</para><screen>kdc1 # <userinput>svcadm disable network/security/kadmin</userinput>
kdc1 # <userinput>svcadm disable network/security/krb5kdc</userinput></screen>
</step><step id="seamtask-step-413"><para>On the old master KDC, specify the poll
time for requesting propagations.</para><para>Comment out the <literal>sunw_dbprop_master_ulogsize</literal> entry in <filename>/etc/krb5/kdc.conf</filename> and add an entry
defining <literal>sunw_dbprop_slave_poll</literal>. The entry sets the poll
time to 2 minutes.</para><screen>kdc1 # <userinput>cat /etc/krb5/kdc.conf</userinput>
[kdcdefaults]
        kdc_ports = 88,750

[realms]
        EXAMPLE.COM= {
                profile = /etc/krb5/krb5.conf
                database_name = /var/krb5/principal
                admin_keytab = /etc/krb5/kadm5.keytab
                acl_file = /etc/krb5/kadm5.acl
                kadmind_port = 749
                max_life = 8h 0m 0s
                max_renewable_life = 7d 0h 0m 0s
                sunw_dbprop_enable = true
#               sunw_dbprop_master_ulogsize = 1000
                <userinput>sunw_dbprop_slave_poll = 2m</userinput>
        }</screen>
</step><step id="seamtask-step-415"><para>On the old master KDC, move the master
KDC commands and the <filename>kadm5.acl</filename> file.</para><para>To prevent
the master KDC commands from being run, move the <command>kprop</command>, <command>kadmind</command>, and <command>kadmin.local</command> commands to a reserved
place.</para><screen>kdc1 # <userinput>mv /usr/lib/krb5/kprop /usr/lib/krb5/kprop.save</userinput>
kdc1 # <userinput>mv /usr/lib/krb5/kadmind /usr/lib/krb5/kadmind.save</userinput>
kdc1 # <userinput>mv /usr/sbin/kadmin.local /usr/sbin/kadmin.local.save</userinput>
kdc1 # <userinput>mv /etc/krb5/kadm5.acl /etc/krb5/kadm5.acl.save</userinput></screen>
</step><step id="seamtask-step-416"><para>On the DNS server, change the alias names
for the master KDC.</para><para>To change the servers, edit the <literal>example.com</literal> zone file and change the entry for <literal>masterkdc</literal>.</para><screen>masterkdc IN CNAME kdc4</screen>
</step><step id="seamtask-step-417"><para>On the DNS server, restart the Internet
domain name server.</para><para>Run the following command to reload the new
alias information:</para><screen># <userinput>svcadm refresh network/dns/server</userinput></screen>
</step><step id="seamtask-step-418"><para>On the new master KDC, move the master
KDC commands and the slave <filename>kpropd.acl</filename> file.</para><screen>kdc4 # <userinput>mv /usr/lib/krb5/kprop.save /usr/lib/krb5/kprop</userinput>
kdc4 # <userinput>mv /usr/lib/krb5/kadmind.save /usr/lib/krb5/kadmind</userinput>
kdc4 # <userinput>mv /usr/sbin/kadmin.local.save /usr/sbin/kadmin.local</userinput>
kdc4 # <userinput>mv /etc/krb5/kpropd.acl /etc/krb5/kpropd.acl.save</userinput></screen>
</step><step id="seamtask-step-419"><para><indexterm><primary>access control list</primary><see>ACL</see></indexterm><indexterm><primary><filename>kadm5.acl</filename> file</primary><secondary>master KDC entry</secondary></indexterm>On the new master
KDC, create the Kerberos access control list file (<filename>kadm5.acl</filename>).</para><para>Once populated, the <filename>/etc/krb5/kadm5.acl</filename> file
should contain all principal names that are allowed to administer the KDC.
The file should also list all of the slaves that make requests for incremental
propagation. See the <olink targetdoc="group-refman" targetptr="kadm5.acl-4" remap="external"><citerefentry><refentrytitle>kadm5.acl</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink> man
page for more information.</para><screen>kdc4 # <userinput>cat /etc/krb5/kadm5.acl</userinput>
<userinput>kws/admin@EXAMPLE.COM   *</userinput>
<userinput>kiprop/kdc1.example.com@EXAMPLE.COM p</userinput></screen>
</step><step><para>On the new master KDC, specify the update log size in the <filename>kdc.conf</filename> file.</para><para>Comment out the <literal>sunw_dbprop_slave_poll</literal> entry
and add an entry defining <literal>sunw_dbprop_master_ulogsize</literal>.
The entry sets the log size to 1000 entries.</para><screen>kdc1 # <userinput>cat /etc/krb5/kdc.conf</userinput>
[kdcdefaults]
        kdc_ports = 88,750

[realms]
        EXAMPLE.COM= {
                profile = /etc/krb5/krb5.conf
                database_name = /var/krb5/principal
                admin_keytab = /etc/krb5/kadm5.keytab
                acl_file = /etc/krb5/kadm5.acl
                kadmind_port = 749
                max_life = 8h 0m 0s
                max_renewable_life = 7d 0h 0m 0s
                sunw_dbprop_enable = true
#               sunw_dbprop_slave_poll = 2m
                <userinput>sunw_dbprop_master_ulogsize = 1000</userinput>
        }</screen>
</step><step><para>On the new master KDC, add the <literal>kiprop</literal> principal to the <literal>kadmind</literal> keytab file.</para><screen remap="wide">kdc4 # <userinput>kadmin.local</userinput>
kadmin.local: <userinput>ktadd -k /etc/krb5/kadm5.keytab kiprop/kdc4.example.com</userinput>
Entry for principal kiprop/kdc4.example.com with kvno 3, encryption type AES-256 CTS mode
          with 96-bit SHA-1 HMAC added to keytab WRFILE:/etc/krb5/kadm5.keytab.
Entry for principal kiprop/kdc4.example.com with kvno 3, encryption type AES-128 CTS mode
          with 96-bit SHA-1 HMAC added to keytab WRFILE:/etc/krb5/kadm5.keytab.
Entry for principal kiprop/kdc4.example.com with kvno 3, encryption type Triple DES cbc
          mode with HMAC/sha1 added to keytab WRFILE:/etc/krb5/kadm5.keytab.
Entry for principal kiprop/kdc4.example.com with kvno 3, encryption type ArcFour
          with HMAC/md5 added to keytab WRFILE:/etc/krb5/kadm5.keytab.
Entry for principal kiprop/kdc4.example.com with kvno 3, encryption type DES cbc mode
          with RSA-MD5 added to keytab WRFILE:/etc/krb5/kadm5.keytab.
kadmin.local: <userinput>quit</userinput></screen>
</step><step id="seamtask-step-421"><para>On the new master KDC, start <command>kadmind</command> and <command>krb5kdc</command>.</para><screen>kdc4 # <userinput>svcadm enable -r network/security/krb5kdc</userinput>
kdc4 # <userinput>svcadm enable -r network/security/kadmin</userinput></screen>
</step><step><para>On the old master KDC, add the <literal>kiprop</literal> service
principal.</para><para>Adding the <literal>kiprop</literal> principal to the <filename>krb5.keytab</filename> file allows the <command>kpropd</command> daemon to
authenticate itself for the incremental propagation service.</para><screen>kdc1 # <userinput>/usr/sbin/kadmin -p kws/admin</userinput>
Authenticating as pricipal kws/admin@EXAMPLE.COM with password.
Enter password: <lineannotation>&lt;Type kws/admin password&gt;</lineannotation>
kadmin: <userinput>ktadd kiprop/kdc1.example.com</userinput>
Entry for principal kiprop/kdc1.example.com with kvno 3, encryption type AES-256 CTS mode
          with 96-bit SHA-1 HMAC added to keytab WRFILE:/etc/krb5/krb5.keytab.
Entry for principal kiprop/kdc1.example.com with kvno 3, encryption type AES-128 CTS mode
          with 96-bit SHA-1 HMAC added to keytab WRFILE:/etc/krb5/krb5.keytab.
Entry for principal kiprop/kdc1.example.com with kvno 3, encryption type Triple DES cbc
          mode with HMAC/sha1 added to keytab WRFILE:/etc/krb5/krb5.keytab.
Entry for principal kiprop/kdc1.example.com with kvno 3, encryption type ArcFour
          with HMAC/md5 added to keytab WRFILE:/etc/krb5/krb5.keytab.
Entry for principal kiprop/kdc1.example.com with kvno 3, encryption type DES cbc mode
          with RSA-MD5 added to keytab WRFILE:/etc/krb5/krb5.keytab.
kadmin: <userinput>quit</userinput></screen>
</step><step><para>On the old master KDC, add an entry for each KDC listed in <filename>krb5.conf</filename> to the propagation configuration file, <filename>kpropd.acl</filename>.</para><screen>kdc1 # <userinput>cat /etc/krb5/kpropd.acl</userinput>
host/kdc1.example.com@EXAMPLE.COM
host/kdc2.example.com@EXAMPLE.COM
host/kdc3.example.com@EXAMPLE.COM
host/kdc4.example.com@EXAMPLE.COM</screen>
</step><step><para>On the old master KDC, start <command>kpropd</command> and <command>krb5kdc</command>.</para><screen>kdc1 # <userinput>svcadm enable -r network/security/krb5_prop</userinput>
kdc1 # <userinput>svcadm enable -r network/security/krb5kdc</userinput></screen>
</step>
</procedure>
</task>
</sect1><sect1 id="aadmin-3"><title>Administering the Kerberos Database</title><para>The Kerberos database is the backbone of Kerberos and must be maintained
properly. This section provides some procedures on how to administer the Kerberos
database, such as backing up and restoring the database, setting up incremental
or parallel propagation, and administering the stash file. The steps to initially
set up the database are in <olink targetptr="setup-1" remap="internal">How to Configure a Master
KDC</olink>.</para><sect2 id="setup-304"><title>Backing Up and Propagating the Kerberos Database</title><indexterm><primary>databases</primary><secondary>backing up and propagating KDC</secondary>
</indexterm><indexterm><primary>KDC</primary><secondary>backing up and propagating</secondary>
</indexterm><indexterm><primary>propagation</primary><secondary>Kerberos database</secondary>
</indexterm><indexterm><primary>backup</primary><secondary>Kerberos database</secondary>
</indexterm><indexterm><primary><filename>slave_datatrans</filename> file</primary><secondary>KDC propagation and</secondary>
</indexterm><para>Propagating the Kerberos database from the master KDC to the slave KDCs
is one of the most important configuration tasks. If propagation doesn't happen
often enough, the master KDC and the slave KDCs will lose synchronization.
So, if the master KDC goes down, the slave KDCs will not have the most recent
database information. Also, if a slave KDC has been configured as a master
KDC for purposes of load balancing, the clients that use that slave KDC as
a master KDC will not have the latest information. Therefore, you must make
sure that propagation occurs often enough or else configure the servers for
incremental propagation, based on how often you change the Kerberos database.
Incremental propagation is preferred over manual propagation because there
is more administrative overhead when you manually propagate the database.
Also, there are inefficiencies when you do full propagation of the database.</para><para>When you configure the master KDC, you set up the <literal>kprop_script</literal> command
in a <command>cron</command> job to automatically back up the Kerberos database
to the <filename>/var/krb5/slave_datatrans</filename> dump file and propagate
it to the slave KDCs. But, as with any file, the Kerberos database can become
corrupted. If data corruption occurs on a slave KDC, you might never notice,
because the next automatic propagation of the database installs a fresh copy.
However, if corruption occurs on the master KDC, the corrupted database is
propagated to all of the slave KDCs during the next propagation. And, the
corrupted backup overwrites the previous uncorrupted backup file on the master
KDC.</para><para>Because there is no &ldquo;safe&rdquo; backup copy in this scenario,
you should also set up a <command>cron</command> job to periodically copy
the <filename>slave_datatrans</filename> dump file to another location or
to create another separate backup copy by using the <command>dump</command> command
of <command>kdb5_util</command>. Then, if your database becomes corrupted,
you can restore the most recent backup on the master KDC by using the <command>load</command> command of <command>kdb5_util</command>. </para><para>Another important note: Because the database dump file contains principal
keys, you need to protect the file from being accessed by unauthorized users.
By default, the database dump file has read and write permissions only as <literal>root</literal>. To protect against unauthorized access, use only the <command>kprop</command> command to propagate the database dump file, which encrypts the
data that is being transferred. Also, <command>kprop</command> propagates
the data only to the slave KDCs, which minimizes the chance of accidentally
sending the database dump file to unauthorized hosts.</para><caution><para>If the Kerberos database is updated after it has been propagated
and if the database subsequently is corrupted before the next propagation,
the KDC slaves will not contain the updates. The updates will be lost. For
this reason, if you add significant updates to the Kerberos database before
a regularly scheduled propagation, you should manually propagate the database
to avoid data loss.</para>
</caution><sect3 id="setup-314"><title>The <filename>kpropd.acl</filename> File</title><para>The <filename>kpropd.acl</filename> file on a slave KDC provides a list
of host principal names, one name per line, that specifies the systems from
which the KDC can receive an updated database through propagation. If the
master KDC is used to propagate all the slave KDCs, the <filename>kpropd.acl</filename> file
on each slave needs to contain only the host principal name of the master
KDC. </para><para>However, the Kerberos installation and subsequent configuration steps
in this book instruct you to add the same <filename>kpropd.acl</filename> file
to the master KDC and the slave KDCs. This file contains all the KDC host
principal names. This configuration enables you to propagate from any KDC,
in case the propagating KDCs become temporarily unavailable. And, by keeping
an identical copy on all KDCs, you make the configuration easy to maintain.
 </para>
</sect3><sect3 id="setup-315"><title>The <command>kprop_script</command> Command</title><para>The <command>kprop_script</command> command uses the <command>kprop</command> command
to propagate the Kerberos database to other KDCs. If the <command>kprop_script</command> command
is run on a slave KDC, it propagates the slave KDC's copy of the Kerberos
database to other KDCs. The <command>kprop_script</command> accepts a list
of host names for arguments, separated by spaces, which denote the KDCs to
propagate.  </para><para>When <command>kprop_script</command> is run, it creates a backup of
the Kerberos database to the <filename>/var/krb5/slave_datatrans</filename> file
and copies the file to the specified KDCs. The Kerberos database is locked
until the propagation is finished.</para>
</sect3>
</sect2><task id="setup-155"><title>How to Back Up the Kerberos Database</title><procedure><step id="seamtask-step-423"><para>Become superuser on the master KDC.</para>
</step><step id="seamtask-step-424"><para>Back up the Kerberos database by using
the <command>dump</command> command of the <command>kdb5_util</command> command.</para><screen># <userinput>/usr/sbin/kdb5_util dump</userinput> [<userinput></userinput><option>verbose</option><userinput></userinput>] [<userinput></userinput><option>d</option><userinput></userinput> <replaceable>dbname</replaceable>] [<replaceable>filename</replaceable> [<replaceable>principals</replaceable>...]]</screen><variablelist><varlistentry><term><option>verbose</option></term><listitem><para>Prints the name of each principal and policy that is being
backed up.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>dbname</replaceable></term><listitem><para>Defines the name of the database to back up. Note that you
can specify an absolute path for the file.  If the <option>d</option> option
is not specified, the default database name is <filename>/var/krb5/principal</filename>.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>filename</replaceable></term><listitem><para>Defines the file that is used to back up the database. You
can specify an absolute path for the file. If you don't specify a file, the
database is dumped to standard output.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>principals</replaceable></term><listitem><para>Defines a list of one or more principals (separated by a space)
to back up. You must use fully qualified principal names. If you don't specify
any principals, the entire database is backed up.</para>
</listitem>
</varlistentry>
</variablelist>
</step>
</procedure><example id="ehgbf"><title>Backing Up the Kerberos Database</title><para>In the following example, the Kerberos database is backed up to a file
called <filename>dumpfile</filename>. Because the <option>verbose</option> option
is specified, each principal is printed as it is backed up.</para><screen># <userinput>kdb5_util dump -verbose dumpfile</userinput> 
kadmin/kdc1.eng.example.com@ENG.EXAMPLE.COM 
krbtgt/eng.example.com@ENG.EXAMPLE.COM 
kadmin/history@ENG.EXAMPLE.COM 
pak/admin@ENG.EXAMPLE.COM 
pak@ENG.EXAMPLE.COM
changepw/kdc1.eng.example.com@ENG.EXAMPLE.COM</screen><para>In the following example, the <literal>pak</literal> and <literal>pak/admin</literal> principals from the Kerberos database are backed up.</para><screen># <userinput>kdb5_util dump -verbose dumpfile pak/admin@ENG.EXAMPLE.COM pak@ENG.EXAMPLE.COM</userinput>
pak/admin@ENG.EXAMPLE.COM
pak@ENG.EXAMPLE.COM</screen>
</example>
</task><task id="setup-152"><title>How to Restore the Kerberos Database</title><procedure><step><para>Become superuser on the master KDC.</para>
</step><step><para>On the master, stop the KDC daemons.</para><screen>kdc1 # <userinput>svcadm disable network/security/krb5kdc</userinput>
kdc1 # <userinput>svcadm disable network/security/kadmin</userinput></screen>
</step><step><para>Restore the Kerberos database by using the <command>load</command> command
of the <command>kdb_util</command> command.</para><screen># <userinput>/usr/sbin/kdb5_util load</userinput> [<userinput></userinput><option>verbose</option><userinput></userinput>] [<userinput></userinput><option>d</option><userinput></userinput> <replaceable>dbname</replaceable>] [<userinput></userinput><option>update</option><userinput></userinput>] [<replaceable>filename</replaceable>] </screen><variablelist><varlistentry><term><option>verbose</option></term><listitem><para>Prints the name of each principal and policy that is being
restored.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>dbname</replaceable></term><listitem><para>Defines the name of the database to restore. Note you can
specify an absolute path for the file. If the <option>d</option> option is
not specified, the default database name is <filename>/var/krb5/principal</filename>.</para>
</listitem>
</varlistentry><varlistentry><term><option>update</option></term><listitem><para>Updates the existing database. Otherwise, a new database is
created or the existing database is overwritten.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>filename</replaceable></term><listitem><para>Defines the file from which to restore the database. You can
specify an absolute path for the file. </para>
</listitem>
</varlistentry>
</variablelist>
</step><step><para>Start the KDC daemons.</para><screen>kdc1 # <userinput>svcadm enable -r network/security/krb5kdc</userinput>
kdc1 # <userinput>svcadm enable -r network/security/kadmin</userinput></screen>
</step>
</procedure><example id="ehgbe"><title>Restoring the Kerberos Database</title><para>In the following example, the database called <literal>database1</literal> is
restored into the current directory from the <filename>dumpfile</filename> file.
Because the <option>update</option> option isn't specified, a new database
is created by the restore.</para><screen># <userinput>kdb5_util load -d database1 dumpfile</userinput></screen>
</example>
</task><task id="faazs"><title>How to Convert a Kerberos Database After a Server
Upgrade</title><tasksummary><para>If your KDC database was created on a server running the Solaris 8 or
Solaris 9 release, converting the database allows you to take advantage of
the improved database format.</para>
</tasksummary><taskprerequisites><para>Make sure that the database is using an older format. </para>
</taskprerequisites><procedure><step><para>On the master, stop the KDC daemons.</para><screen>kdc1 # <userinput>svcadm disable network/security/krb5kdc</userinput>
kdc1 # <userinput>svcadm disable network/security/kadmin</userinput></screen>
</step><step><para>Create a directory to store a temporary copy of the database.</para><screen>kdc1 # <userinput>mkdir /var/krb5/tmp</userinput>
kdc1 # <userinput>chmod 700 /var/krb5/tmp</userinput></screen>
</step><step><para>Dump the KDC database.</para><screen>kdc1 # <userinput>kdb5_util dump /var/krb5/tmp/prdb.txt</userinput></screen>
</step><step><para>Save copies of the current database files.</para><screen>kdc1 # <userinput>cd /var/krb5</userinput>
kdc1 # <userinput>mv princ* tmp/</userinput></screen>
</step><step><para>Load the database.</para><screen>kdc1 # <userinput>kdb5_util load /var/krb5/tmp/prdb.txt</userinput></screen>
</step><step><para>Start the KDC daemons.</para><screen>kdc1 # <userinput>svcadm enable -r network/security/krb5kdc</userinput>
kdc1 # <userinput>svcadm enable -r network/security/kadmin</userinput></screen>
</step>
</procedure>
</task><task id="faazt"><title>How to Reconfigure a Master KDC to Use Incremental
Propagation</title><tasksummary><itemizedlist mark="bullet"><para>The steps in this procedure can be used to reconfigure an existing master
KDC to use incremental propagation. In this procedure, the following configuration
parameters are used: </para><listitem><para>Realm name = <literal>EXAMPLE.COM</literal></para>
</listitem><listitem><para>DNS domain name = <literal>example.com</literal></para>
</listitem><listitem><para>Master KDC = <literal>kdc1.example.com</literal></para>
</listitem><listitem><para>Slave KDC = <literal>kdc2.example.com</literal></para>
</listitem><listitem><para><literal>admin</literal> principal = <literal>kws/admin</literal></para>
</listitem>
</itemizedlist>
</tasksummary><procedure><step><para>Add entries to <filename>kdc.conf</filename>.</para><para>You
need to enable incremental propagation and select the number of updates the
KDC master keeps in the log. See the <olink targetdoc="group-refman" targetptr="kdc.conf-4" remap="external"><citerefentry><refentrytitle>kdc.conf</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink> man page for more information.</para><screen>kdc1 # <userinput>cat /etc/krb5/kdc.conf</userinput>
[kdcdefaults]
        kdc_ports = 88,750

[realms]
        <userinput>EXAMPLE.COM</userinput>= {
                profile = /etc/krb5/krb5.conf
                database_name = /var/krb5/principal
                admin_keytab = /etc/krb5/kadm5.keytab
                acl_file = /etc/krb5/kadm5.acl
                kadmind_port = 749
                max_life = 8h 0m 0s
                max_renewable_life = 7d 0h 0m 0s
                <userinput>sunw_dbprop_enable = true</userinput>
                <userinput>sunw_dbprop_master_ulogsize = 1000</userinput>
        }</screen>
</step><step><para>Create the <literal>kiprop</literal> principal.</para><para>The <literal>kiprop</literal> principal is used to authenticate the master KDC server and
to authorize updates from the master KDC.</para><screen>kdc1 # <userinput>/usr/sbin/kadmin -p kws/admin</userinput>
Enter password: <lineannotation>&lt;Type kws/admin password&gt;</lineannotation>
kadmin: <userinput>addprinc -randkey kiprop/kdc1.example.com</userinput>
Principal "kiprop/kdc1.example.com@EXAMPLE.COM" created.
kadmin: <userinput>addprinc -randkey kiprop/kdc2.example.com</userinput>
Principal "kiprop/kdc2.example.com@EXAMPLE.COM" created.
kadmin:</screen>
</step><step><para>Add the <literal>kiprop</literal> principal
to the <command>kadmind</command> keytab file</para><para>Adding the <literal>kiprop</literal> principal to the <filename>kadm5.keytab</filename> file allows
the <command>kadmind</command> command to authenticate itself when it is started.</para><screen remap="wide">kadmin: <userinput>ktadd -k /etc/krb5/kadm5.keytab kiprop/kdc1.example.com</userinput>
Entry for principal kiprop/kdc1.example.com with kvno 3, encryption type AES-256 CTS mode
          with 96-bit SHA-1 HMAC added to keytab WRFILE:/etc/krb5/kadm5.keytab.
Entry for principal kiprop/kdc1.example.com with kvno 3, encryption type AES-128 CTS mode
          with 96-bit SHA-1 HMAC added to keytab WRFILE:/etc/krb5/kadm5.keytab.
Entry for principal kiprop/kdc1.example.com with kvno 3, encryption type Triple DES cbc
          mode with HMAC/sha1 added to keytab WRFILE:/etc/krb5/kadm5.keytab.
Entry for principal kiprop/kdc1.example.com with kvno 3, encryption type ArcFour
          with HMAC/md5 added to keytab WRFILE:/etc/krb5/kadm5.keytab.
Entry for principal kiprop/kdc1.example.com with kvno 3, encryption type DES cbc mode
          with RSA-MD5 added to keytab WRFILE:/etc/krb5/kadm5.keytab.
kadmin: <userinput>quit</userinput></screen>
</step><step><para>On the master KDC, add a kiprop entry to <filename>kadm5.acl</filename></para><para>This entry allows the master KDC to receive requests for incremental
propagation from the <literal>kdc2</literal> server.</para><screen>kdc1 # <userinput>cat /etc/krb5/kadm5.acl</userinput>
*/admin@EXAMPLE.COM *
<userinput>kiprop/kdc2.example.com@EXAMPLE.COM p</userinput></screen>
</step><step id="ejusu"><para>Comment out the <literal>kprop</literal> line in the <literal>root</literal> crontab file.</para><para>This step prevents the master KDC
from propagating its copy of the KDC database.</para><screen>kdc1 # <userinput>crontab -e</userinput>
#ident  "@(#)root       1.20    01/11/06 SMI"
#
# The root crontab should be used to perform accounting data collection.
#
# The rtc command is run to adjust the real time clock if and when
# daylight savings time changes.
#
10 3 * * * /usr/sbin/logadm
15 3 * * 0 /usr/lib/fs/nfs/nfsfind
1 2 * * * [ -x /usr/sbin/rtc ] &amp;&amp; /usr/sbin/rtc -c &gt; /dev/null 2&gt;&amp;1
30 3 * * * [ -x /usr/lib/gss/gsscred_clean ] &amp;&amp; /usr/lib/gss/gsscred_clean
<userinput>#</userinput>10 3 * * * /usr/lib/krb5kprop_script kdc2.example.sun.com #SUNWkr5ma</screen>
</step><step id="ejuqu"><para>Restart <command>kadmind</command>.</para><screen>kdc1 # <userinput>svcadm restart network/security/kadmin</userinput></screen>
</step><step><para>Reconfigure all slave KDC servers that use incremental propagation.</para><para>See <olink targetptr="ejurx" remap="internal">How to Reconfigure a Slave KDC to Use Incremental
Propagation</olink> for complete instructions.</para>
</step>
</procedure>
</task><task id="ejurx"><title>How to Reconfigure a Slave KDC to Use Incremental
Propagation</title><procedure><step><para>Add entries to <filename>krb5.conf</filename>.</para><para>The
new entries enable incremental propagation and set the poll time to 2 minutes.</para><screen>kdc2 # <userinput>cat /etc/krb5/krb5.conf</userinput>
[kdcdefaults]
        kdc_ports = 88,750

[realms]
        EXAMPLE.COM= {
                profile = /etc/krb5/krb5.conf
                database_name = /var/krb5/principal
                admin_keytab = /etc/krb5/kadm5.keytab
                acl_file = /etc/krb5/kadm5.acl
                kadmind_port = 749
                max_life = 8h 0m 0s
                max_renewable_life = 7d 0h 0m 0s
                <userinput>sunw_dbprop_enable = true</userinput>
                <userinput>sunw_dbprop_slave_poll = 2m</userinput>
        }</screen>
</step><step><para>Add the <literal>kiprop</literal> principal to the <command>krb5.keytab</command> file.</para><screen remap="wide">kdc2 # <userinput>/usr/sbin/kadmin -p kws/admin</userinput>
Enter password: <lineannotation>&lt;Type kws/admin password&gt;</lineannotation>
kadmin: <userinput>ktadd kiprop/kdc2.example.com</userinput>
Entry for principal kiprop/kdc2.example.com with kvno 3, encryption type AES-256 CTS mode
          with 96-bit SHA-1 HMAC added to keytab WRFILE:/etc/krb5/krb5.keytab.
Entry for principal kiprop/kdc2.example.com with kvno 3, encryption type AES-128 CTS mode
          with 96-bit SHA-1 HMAC added to keytab WRFILE:/etc/krb5/krb5.keytab.
Entry for principal kiprop/kdc2.example.com with kvno 3, encryption type Triple DES cbc
          mode with HMAC/sha1 added to keytab WRFILE:/etc/krb5/krb5.keytab.
Entry for principal kiprop/kdc2.example.com with kvno 3, encryption type ArcFour
          with HMAC/md5 added to keytab WRFILE:/etc/krb5/krb5.keytab.
Entry for principal kiprop/kdc2.example.com with kvno 3, encryption type DES cbc mode
          with RSA-MD5 added to keytab WRFILE:/etc/krb5/krb5.keytab.
kadmin: <userinput>quit</userinput></screen>
</step><step><para>Restart <command>kpropd</command>.</para><screen>kdc2 # <userinput>svcadm restart network/security/krb5_prop</userinput></screen>
</step>
</procedure>
</task><task id="feotp"><title>How to Configure a Slave KDC to Use Full Propagation</title><tasksummary><para>This procedure shows how to reconfigure a slave KDC server running the
Solaris 10 release to use full propagation. Normally, the procedure would
only need to be used if the master KDC server is running either the Solaris
9 release or an earlier release. In this case, the master KDC server can not
support incremental propagation, so the slave needs to be configured to allow
propagation to work.</para><itemizedlist mark="bullet"><para>In this procedure, a slave KDC named <literal>kdc3</literal> is configured.
This procedure uses the following configuration parameters:</para><listitem><para>Realm name = <literal>EXAMPLE.COM</literal></para>
</listitem><listitem><para>DNS domain name = <literal>example.com</literal></para>
</listitem><listitem><para>Master KDC = <literal>kdc1.example.com</literal></para>
</listitem><listitem><para>Slave KDC = <literal>kdc2.example.com</literal> and <literal>kdc3.example.com</literal></para>
</listitem><listitem><para><literal>admin</literal> principal = <literal>kws/admin</literal></para>
</listitem><listitem><para>Online help URL = <literal>http://denver:8888/ab2/coll.384.1/SEAM/@AB2PageView/6956</literal></para><note><para>Adjust the URL to point to the &ldquo;Graphical Kerberos Administration
Tool&rdquo; section, as described in the <olink targetptr="seamplan-3" remap="internal">Online
Help URL in the Graphical Kerberos Administration Tool</olink>.</para>
</note>
</listitem>
</itemizedlist>
</tasksummary><taskprerequisites><para>The master KDC must be configured. For specific instructions if this
slave is to be swappable, see <olink targetptr="aadmin-2" remap="internal">Swapping a Master
KDC and a Slave KDC</olink>.</para>
</taskprerequisites><procedure><step><para>On the master KDC, become superuser.</para>
</step><step><para>On the master KDC, start <command>kadmin</command>.</para><para>You
must log in with one of the <literal>admin</literal> principal names that
you created when you configured the master KDC.</para><screen>kdc1 # <userinput>/usr/sbin/kadmin -p kws/admin</userinput>
Enter password: <lineannotation>&lt;Type kws/admin password&gt;</lineannotation>
kadmin: </screen><substeps><step id="feotl"><para>On the master KDC, add slave host principals to the
database, if not already done.</para><para>For the slave to function, it must
have a host principal. Note that when the principal instance is a host name,
the FQDN must be specified in lowercase letters, regardless of the case of
the domain name in the <filename>/etc/resolv.conf</filename> file.</para><screen>kadmin: <userinput>addprinc -randkey host/kdc3.example.com</userinput>
Principal "host/kdc3@EXAMPLE.COM" created.
kadmin: </screen>
</step><step><para>Quit <command>kadmin</command>.</para><screen>kadmin: <command>quit</command></screen>
</step>
</substeps>
</step><step id="feovb"><para>On the master KDC, edit the Kerberos configuration
file (<filename>krb5.conf</filename>).</para><para>You need to add an entry
for each slave. See the <olink targetdoc="group-refman" targetptr="krb5.conf-4" remap="external"><citerefentry><refentrytitle>krb5.conf</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink> man
page for a full description of this file.</para><screen>kdc1 # <userinput>cat /etc/krb5/krb5.conf</userinput>
 .
 .
[realms]
                EXAMPLE.COM = {
                kdc = kdc1.example.com
                kdc = kdc2.example.com
                <userinput>kdc = kdc3.example.com</userinput>
                admin_server = kdc1.example.com
        }</screen>
</step><step><para>On the master KDC, add an entry for the master KDC and each slave
KDC into the <filename>kpropd.acl</filename> file.</para><para>See the <olink targetdoc="group-refman" targetptr="kprop-1m" remap="external"><citerefentry><refentrytitle>kprop</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man page for a full description
of this file.</para><screen>kdc1 # <userinput>cat /etc/krb5/kpropd.acl</userinput>
host/kdc1.example.com@EXAMPLE.COM
host/kdc2.example.com@EXAMPLE.COM
<userinput>host/kdc3.example.com@EXAMPLE.COM</userinput></screen>
</step><step id="feouv"><para><indexterm><primary>KDC</primary><secondary>copying administration files from slave to master</secondary></indexterm>On all slave
KDCs, copy the KDC administration files from the master KDC server.</para><itemizedlist><para>This step needs to be followed on all slave KDCs, because the master
KDC server has updated information that each KDC server needs. You can use <command>ftp</command> or a similar transfer mechanism to grab copies of the following
files from the master KDC:</para><listitem><para><filename>/etc/krb5/krb5.conf</filename></para>
</listitem><listitem><para><filename>/etc/krb5/kdc.conf</filename></para>
</listitem><listitem><para><filename>/etc/krb5/kpropd.acl</filename></para>
</listitem>
</itemizedlist>
</step><step><para>On all slave KDCs, make sure that the Kerberos access control
list file, <filename>kadm5.acl</filename>, is not populated.</para><para>An
unmodified <filename>kadm5.acl</filename> file would look like:</para><screen>kdc2 # <userinput>cat /etc/krb5/kadm5.acl</userinput>
*/admin@___default_realm___ *</screen><para>If the file has <literal>kiprop</literal> entries, remove them.</para>
</step><step id="feouk"><para>On the new slave, start the <command>kadmin</command> command.</para><para>You must log in with one of the <literal>admin</literal> principal
names that you created when you configured the master KDC.</para><screen>kdc2 # <userinput>/usr/sbin/kadmin -p kws/admin</userinput>
Enter password: <lineannotation>&lt;Type kws/admin password&gt;</lineannotation>
kadmin: </screen><substeps><step><para>Add the slave's <literal>host</literal> principal to the slave's
keytab file by using <command>kadmin</command>.</para><para>This entry allows <command>kprop</command> and other Kerberized applications to function. Note that when
the principal instance is a host name, the FQDN must be specified in lowercase
letters, regardless of the case of the domain name in the <filename>/etc/resolv.conf</filename> file.</para><screen remap="wide">kadmin: <userinput>ktadd host/kdc3.example.com</userinput>
Entry for principal host/kdc3.example.com with kvno 3, encryption type AES-256 CTS mode
          with 96-bit SHA-1 HMAC added to keytab WRFILE:/etc/krb5/krb5.keytab.
Entry for principal host/kdc3.example.com with kvno 3, encryption type AES-128 CTS mode
          with 96-bit SHA-1 HMAC added to keytab WRFILE:/etc/krb5/krb5.keytab.
Entry for principal host/kdc3.example.com with kvno 3, encryption type Triple DES cbc
          mode with HMAC/sha1 added to keytab WRFILE:/etc/krb5/krb5.keytab.
Entry for principal host/kdc3.example.com with kvno 3, encryption type ArcFour
          with HMAC/md5 added to keytab WRFILE:/etc/krb5/krb5.keytab.
Entry for principal host/kdc3.example.com with kvno 3, encryption type DES cbc mode
          with RSA-MD5 added to keytab WRFILE:/etc/krb5/krb5.keytab.
kadmin: </screen>
</step><step><para>Quit <command>kadmin</command>.</para><screen>kadmin: <command>quit</command></screen>
</step>
</substeps>
</step><step><para>On the master KDC, add the slave KDC name to the <command>cron</command> job,
which automatically runs the backups, by running <command>crontab</command> <option>e</option>.</para><para>Add the name of each slave KDC server at the end of
the <filename>kprop_script</filename> line.</para><screen>10 3 * * * /usr/lib/krb5/kprop_script kdc2.example.com <userinput>kdc3.example.com</userinput></screen><para>You might also want to change the time of the backups. This entry starts
the backup process every day at 3:10 AM.</para>
</step><step><para>On the new slave, start the Kerberos propagation daemon.</para><screen>kdc3 # <userinput>svcadm enable network/security/krb5_prop</userinput></screen>
</step><step><para>On the master KDC, back up and propagate the database by using <filename>kprop_script</filename>.</para><para>If a backup copy of the database is already
available, it is not necessary to complete another backup. See <olink targetptr="setup-224" remap="internal">How to Manually Propagate the Kerberos Database to the
Slave KDCs</olink> for further instructions.</para><screen>kdc1 # <userinput>/usr/lib/krb5/kprop_script kdc3.example.com</userinput>
Database propagation to kdc3.example.com: SUCCEEDED</screen>
</step><step id="feoug"><para><indexterm><primary>stash file</primary><secondary>creating</secondary></indexterm><indexterm><primary>creating</primary><secondary>stash file</secondary></indexterm><indexterm><primary><command>kdb5_util</command> command</primary><secondary>creating stash file</secondary></indexterm>On the new
slave, create a stash file by using <command>kdb5_util</command>.</para><screen>kdc3 # <userinput>/usr/sbin/kdb5_util stash</userinput>
kdb5_util: Cannot find/read stored master key while reading master key
kdb5_util: Warning: proceeding without master key

Enter KDC database master key: <lineannotation>&lt;Type the key&gt;</lineannotation></screen>
</step><step performance="optional" id="feovd"><para><indexterm><primary>KDC</primary><secondary>synchronizing clocks</secondary><tertiary>slave KDC</tertiary></indexterm><indexterm><primary>clock synchronizing</primary><secondary>Kerberos slave server and</secondary></indexterm><indexterm><primary>NTP</primary><secondary>slave KDC and</secondary></indexterm><indexterm><primary>synchronizing clocks</primary><secondary>slave KDC</secondary></indexterm>On the new slave
KDC, synchronize the master KDCs clock by using NTP or another clock synchronization
mechanism.</para><para>Installing and using the Network Time Protocol (NTP)
is not required. However, every clock must be within the default time that
is defined in the <literal>libdefaults</literal> section of the <filename>krb5.conf</filename> file for authentication to succeed. See <olink targetptr="setup-192" remap="internal">Synchronizing Clocks Between KDCs and Kerberos Clients</olink> for information
about NTP.</para>
</step><step id="feoty"><para><indexterm><primary><command>krb5kdc</command> daemon</primary><secondary>starting</secondary></indexterm><indexterm><primary>KDC</primary><secondary>starting daemon</secondary></indexterm><indexterm><primary>starting</primary><secondary>KDC daemon</secondary></indexterm>On the new slave, start the KDC
daemon (<command>krb5kdc</command>).</para><screen>kdc3 # <userinput>svcadm enable network/security/krb5kdc</userinput></screen>
</step>
</procedure>
</task><task id="ejuqs"><title>How to Verify That the KDC Servers Are Synchronized</title><tasksummary><para>If incremental propagation has been configured, this procedure ensures
that the information on the slave KDC has been updated.</para>
</tasksummary><procedure><step><para>On the KDC master server, run the <command>kproplog</command> command.</para><screen>kdc1 # <userinput>/usr/sbin/kproplog -h</userinput></screen>
</step><step><para>On a KDC slave server, run the <command>kproplog</command> command.</para><screen>kdc2 # <userinput>/usr/sbin/kproplog -h</userinput></screen>
</step><step><para>Check that the last serial # and the last timestamp values match.</para>
</step>
</procedure><example id="ejusn"><title>Verifying That the KDC Servers Are Synchronized</title><para>The following is a sample of results from running the <command>kproplog</command> command
on the master KDC server.</para><screen>kdc1 # <userinput>/usr/sbin/kproplog -h</userinput>

Kerberos update log (/var/krb5/principal.ulog)
Update log dump:
    Log version #: 1
    Log state: Stable
    Entry block size: 2048
    Number of entries: 2500
    First serial #: 137966
    Last serial #: 140465
    First time stamp: Fri Nov 28 00:59:27 2004
    Last time stamp: Fri Nov 28 01:06:13 2004</screen><para>The following is a sample of results from running the <command>kproplog</command> command
on a slave KDC server.</para><screen>kdc2 # <userinput>/usr/sbin/kproplog -h</userinput>

Kerberos update log (/var/krb5/principal.ulog)
Update log dump:
    Log version #: 1
    Log state: Stable
    Entry block size: 2048
    Number of entries: 0
    First serial #: None
    Last serial #: 140465
    First time stamp: None
    Last time stamp: Fri Nov 28 01:06:13 2004</screen><para>Notice that the values for the last serial number and the last timestamp
are identical, which indicates that the slave is synchronized with the master
KDC server.</para><para>In the slave KDC server output, notice that no update entries exist
in the slave KDC server's update log. No entries exist because the slave KDC
server does not keep a set of updates, unlike the master KDC server. Also,
the KDC slave server does not include information on the first serial number
or the first timestamp because this is not relevant information.</para>
</example>
</task><task id="setup-224"><title>How to Manually Propagate the Kerberos Database
to the Slave KDCs</title><tasksummary><para>This procedure shows you how to propagate the Kerberos database by using
the <command>kprop</command> command. Use this procedure if you need to synchronize
a slave KDC with the master KDC outside the periodic <command>cron</command> job.
Unlike the <command>kprop_script</command>, you can use <command>kprop</command> to
propagate just the current database backup without first making a new backup
of the Kerberos database.</para><note><para>Do not use this procedure if you are using incremental propagation.</para>
</note>
</tasksummary><procedure><step id="seamtask-step-427"><para>Become superuser on the master KDC.</para>
</step><step performance="optional" id="setup-step-214"><para>Back up the database
by using the <command>kdb5_util</command> command.</para><screen># <userinput>/usr/sbin/kdb5_util dump /var/krb5/slave_datatrans</userinput></screen>
</step><step id="seamtask-step-428"><para>Propagate the database to a slave KDC by
using the <command>kprop</command> command.</para><screen># <userinput>/usr/lib/krb5/kprop -f /var/krb5/slave_datatrans <replaceable>slave-KDC</replaceable></userinput></screen>
</step>
</procedure><example id="seamtask-ex-434"><title>Manually Propagating the Kerberos Database to the Slave KDCs Using <command>kprop_script</command></title><para>If you want to back up the database and propagate it to a slave KDC
outside the periodic <command>cron</command> job, you can also use the <command>kprop_script</command> command as follows:</para><screen># <userinput>/usr/lib/krb5/kprop_script <replaceable>slave-KDC</replaceable></userinput></screen>
</example>
</task><sect2 id="setup-313"><title>Setting Up Parallel Propagation</title><para>In most cases, the master KDC is used exclusively to propagate its Kerberos
database to the slave KDCs. However, if your site has many slave KDCs, you
might consider load-sharing the propagation process, known as <emphasis>parallel
propagation</emphasis>.</para><note><para>Do not use this procedure if you are using incremental propagation.</para>
</note><para>Parallel propagation allows specific slave KDCs to share the propagation
duties with the master KDC. This sharing of duties enables the propagation
to be done faster and to lighten the work for the master KDC. </para><para>For example, say your site has one master KDC and six slave KDCs (shown
in <olink targetptr="setup-fig-316" remap="internal">Figure&nbsp;23&ndash;2</olink>), where <literal>slave-1</literal> through <literal>slave-3</literal> consist of one logical
grouping and <literal>slave-4</literal> through <literal>slave-6</literal> consist
of another logical grouping. To set up parallel propagation, you could have
the master KDC propagate the database to <literal>slave-1</literal> and <literal>slave-4</literal>. In turn, those KDC slaves could propagate the database
to the KDC slaves in their group.</para><figure id="setup-fig-316"><title>Example of Parallel Propagation Configuration</title><mediaobject><imageobject><imagedata entityref="parallel-prop"/>
</imageobject><textobject><simpara>Diagram shows a master KDC with two propagation slaves.
Each propagation slave propagates to its slaves the master KDC database.</simpara>
</textobject>
</mediaobject>
</figure>
</sect2><sect2 id="setup-317"><title>Configuration Steps for Setting Up Parallel Propagation</title><para>The following is not a detailed step-by-step procedure, but a high-level
list of configuration steps to enable parallel propagation. These steps involve
the following:</para><orderedlist><listitem><para>On the master KDC, changing the <command>kprop_script</command> entry
in its <command>cron</command> job to include arguments for only the KDC slaves
that will perform the succeeding propagation (the <emphasis>propagation slaves</emphasis>). </para>
</listitem><listitem><para>On each propagation slave, adding a <command>kprop_script</command> entry
to its <command>cron</command> job, which must include arguments for the slaves
to propagate. To successfully propagate in parallel, the <command>cron</command> job
should be set up to run after the propagation slave is itself propagated with
the new Kerberos database. </para><note><para>How long it will take for a propagation slave to be propagated
depends on factors such as network bandwidth and the size of the Kerberos
database.</para>
</note>
</listitem><listitem><para>On each slave KDC, setting up the appropriate permissions
to be propagated. This step is done by adding the host principal name of its
propagating KDC to its <filename>kpropd.acl</filename> file.</para>
</listitem>
</orderedlist><example id="ezlrh"><title>Setting Up Parallel Propagation</title><para>Using the example in <olink targetptr="setup-fig-316" remap="internal">Figure&nbsp;23&ndash;2</olink>, the master KDC's <command>kprop_script</command> entry would look
similar to the following:        </para><screen>0 3 * * * /usr/lib/krb5/kprop_script slave-1.example.com slave-4.example.com</screen><para>The <literal>slave-1</literal>'s <command>kprop_script</command> entry
would look similar to the following:</para><screen>0 4 * * * /usr/lib/krb5/kprop_script slave-2.example.com slave-3.example.com</screen><para>Note that the propagation on the slave starts an hour after it is propagated
by the master.</para><para>The <filename>kpropd.acl</filename> file on the propagation slaves would
contain the following entry:</para><screen>host/master.example.com@EXAMPLE.COM</screen><para>The <filename>kpropd.acl</filename> file on the KDC slaves being propagated
by <literal>slave-1</literal> would contain the following entry:</para><screen>host/slave-1.example.com@EXAMPLE.COM</screen>
</example>
</sect2><sect2 id="setup-305"><title>Administering the Stash File</title><para>The <emphasis>stash file</emphasis> contains the master key for the
Kerberos database, which is automatically created when you create a Kerberos
database. If the stash file gets corrupted, you can use the <command>stash</command> command
of the <literal>kdb5_util</literal> utility to replace the corrupted file.
The only time you should need to remove a stash file is after removing the
Kerberos database with the <command>destroy</command> command of <command>kdb5_util</command>. Because the stash file is not automatically removed with the database,
you have to remove the stash file to finish the cleanup.</para>
</sect2><task id="seamtask-26"><title>How to Remove a Stash File</title><procedure><step id="seamtask-step-429"><para>Become superuser on the KDC that contains
the stash file.</para>
</step><step id="seamtask-step-430"><para>Remove the stash file.</para><screen># <userinput>rm <replaceable>stash-file</replaceable></userinput></screen><para>Where <replaceable>stash-file</replaceable> is the path to the stash
file. By default, the stash file is located at <filename>/var/krb5/.k5.<replaceable>realm</replaceable></filename>. </para><note><para>If you need to re-create the stash file, you can use the <option>f</option> option
of the <command>kdb5_util</command> command.</para>
</note>
</step>
</procedure>
</task>
</sect1><sect1 id="ggklp"><title>Managing a KDC on an LDAP Directory Server</title><para>Most of the KDC administration tasks using an LDAP Directory Server
are the same as those for the DB2 server. There are some new tasks that are
specific to working with LDAP.</para><table frame="topbot" pgwide="1" id="ggmnc"><title>Configuring KDC Servers
(Task Map)</title><tgroup cols="3" colsep="1" rowsep="1"><colspec colwidth="110*"/><colspec colname="col2" colwidth="167*"/><colspec colwidth="119*"/><thead><row><entry><para>Task</para>
</entry><entry><para>Description</para>
</entry><entry><para>For Instructions</para>
</entry>
</row>
</thead><tbody><row><entry><para>Configuring a Master KDC</para>
</entry><entry><para>Configures and builds the master KDC server and database for a realm
using a manual process and using LDAP for the KDC..</para>
</entry><entry><para><olink targetptr="ggdqi" remap="internal">How to Configure a KDC to Use an LDAP Data
Server</olink></para>
</entry>
</row><row><entry><para>Mix Kerberos principal attributes with non-Kerberos object class types.</para>
</entry><entry><para>Allows information stored with the Kerberos records to be shared with
other LDAP databases.</para>
</entry><entry><para><olink targetptr="ggkod" remap="internal">How to Mix Kerberos Principal Attributes in
a Non-Kerberos Object Class Type</olink></para>
</entry>
</row><row><entry><para>Destroy a Realm</para>
</entry><entry><para>Removes all of the data associated with a realm</para>
</entry><entry><para><olink targetptr="ggknu" remap="internal">How to Destroy a Realm on an LDAP Directory
Server</olink></para>
</entry>
</row>
</tbody>
</tgroup>
</table><task id="ggkod"><title>How to Mix Kerberos Principal Attributes in a Non-Kerberos
Object Class Type</title><tasksummary><para>This procedure allows for Kerberos principal attributes to be associated
with non-Kerberos object class types. In this procedure the <literal>krbprincipalaux</literal>, and <literal>krbTicketPolicyAux</literal> and <literal>krbPrincipalName</literal> attributes are associated with the people object class.</para><itemizedlist mark="bullet"><para>In this procedure, the following configuration parameters are used: </para><listitem><para>Directory Server = <literal>dsserver.example.com</literal></para>
</listitem><listitem><para>user principal = <literal>willf@EXAMPLE.COM</literal></para>
</listitem>
</itemizedlist>
</tasksummary><procedure><step><para>Become superuser.</para>
</step><step><para>Prepare each entry in the people object class.</para><para>Repeat
this step for each entry.</para><screen>cat &lt;&lt; EOF | ldapmodify -h dsserver.example.com -D "cn=directory manager"
dn: uid=willf,ou=people,dc=example,dc=com
changetype: modify
objectClass: krbprincipalaux
objectClass: krbTicketPolicyAux
krbPrincipalName: willf@EXAMPLE.COM
EOF</screen>
</step><step><para>Add a subtree attribute to the realm container.</para><para>This
step allows for searching of principal entries in the <literal>ou=people,dc=example,dc=com</literal> container, as well as in the default EXAMPLE.COM container.</para><screen># <userinput>kdb5_ldap_util -D "cn=directory manager" modify</userinput> \
            <userinput>-subtrees 'ou=people,dc=example,dc=com' -r EXAMPLE.COM</userinput></screen>
</step><step performance="optional"><para>If the KDC records are stored in DB2, migrate
DB2 entries.</para><substeps><step><para>Dump the DB2 entries.</para><screen># <userinput>kdb5_util dump &gt; dumpfile</userinput></screen>
</step><step><para>Load the database into the LDAP server.</para><screen># <userinput>kdb5_util load -update dumpfile</userinput></screen>
</step>
</substeps>
</step><step performance="optional"><para>Add the principal attributes to the KDC.</para><screen># kadmin.local -q 'addprinc willf'</screen>
</step>
</procedure>
</task><task id="ggknu"><title>How to Destroy a Realm on an LDAP Directory Server</title><tasksummary><para>This procedure can be used if a different LDAP Directory Server has
been configured to handle a realm.</para>
</tasksummary><procedure><step><para>Become superuser.</para>
</step><step><para>Destroy the realm.</para><screen># <userinput>kdb5_ldap_util -D "cn=directory manager" destroy</userinput></screen>
</step>
</procedure>
</task>
</sect1><sect1 id="setup-280"><title>Increasing Security on Kerberos Servers</title><para>Follow these steps to increase security on Kerberos application servers
and on KDC servers. </para><task id="setup-281"><title>How to Enable Only Kerberized Applications</title><indexterm><primary>Kerberos</primary><secondary>enabling Kerberized applications only</secondary>
</indexterm><indexterm><primary>Kerberos commands</primary><secondary>enabling only Kerberized</secondary>
</indexterm><indexterm><primary>enabling</primary><secondary>Kerberized applications only</secondary>
</indexterm><tasksummary><para>This procedure restricts network access to the server that is running <command>telnet</command>, <command>ftp</command>, <command>rcp</command>, <command>rsh</command>,
and <command>rlogin</command> to use Kerberos authenticated transactions only.</para>
</tasksummary><procedure><step><para>Change the <literal>exec</literal> property for the <command>telnet</command> service.</para><para>Add the <option>a user</option> option to the <literal>exec</literal> property
for <literal>telnet</literal> to restrict access to those users who can provide
valid authentication information.</para><screen># inetadm -m svc:/network/telnet:default exec="/usr/sbin/in.telnetd -a user"</screen>
</step><step performance="optional"><para>If not already configured, change the <literal>exec</literal> property for the <command>telnet</command> service.</para><para>Add
the <option>a</option> option to the <literal>exec</literal> property for <literal>ftp</literal> to permit only Kerberos authenticated connections.</para><screen># inetadm -m svc:/network/ftp:default exec="/usr/sbin/in.ftpd -a"</screen>
</step><step><para>Disable other services.</para><para>The <command>in.rshd</command> and <command>in.rlogind</command> daemons should be disabled.</para><screen># <userinput>svcadm disable network/shell</userinput>
# <userinput>svcadm disable network/login:rlogin</userinput></screen>
</step>
</procedure>
</task><task id="setup-246"><title>How to Restrict Access to KDC Servers</title><indexterm><primary>access</primary><secondary>restricting for KDC servers</secondary>
</indexterm><indexterm><primary>KDC</primary><secondary>restricting access to servers</secondary>
</indexterm><indexterm><primary>restricting access for KDC servers</primary>
</indexterm><tasksummary><para>Both master KDC servers and slave KDC servers have copies of the KDC
database stored locally. Restricting access to these servers so that the databases
are secure is important to the overall security of the Kerberos installation.</para>
</tasksummary><procedure><step id="seamtask-step-431"><para>Disable remote services, as needed.</para><para>To provide a secure KDC server, all nonessential network services should
be disabled . Depending on your configuration, some of these services may
already be disabled. Check the service status with the <command>svcs</command> command.
In most circumstances, the only services that would need to run would be <literal>krb5kdc</literal> and <literal>krdb5_kprop</literal> if the KDC is a slave or only <literal>kadmin</literal> if the
KDC is a master. In addition, any services that use loopback tli (<literal>ticlts</literal>, <literal>ticotsord</literal>, and <literal>ticots</literal>) can
be left enabled. </para><screen># <userinput>svcadm disable network/comsat</userinput>
# <userinput>svcadm disable network/dtspc/tcp</userinput>
# <userinput>svcadm disable network/finger</userinput>
# <userinput>svcadm disable network/login:rlogin</userinput>
# <userinput>svcadm disable network/rexec</userinput>
# <userinput>svcadm disable network/shell</userinput>
# <userinput>svcadm disable network/talk</userinput>
# <userinput>svcadm disable network/tname</userinput>
# <userinput>svcadm disable network/uucp</userinput>
# <userinput>svcadm disable network/rpc_100068_2-5/rpc_udp</userinput></screen>
</step><step id="seamtask-step-432"><para>Restrict access to the hardware that supports
the KDC.</para><para>To restrict physical access, make sure that the KDC server
and its monitor are located in a secure facility. Users should not be able
to access this server in any way.</para>
</step><step id="seamtask-step-433"><para>Store KDC database backups on local disks
or on the KDC slaves.</para><para>Make tape backups of your KDC only if the
tapes are stored securely. Follow the same practice for copies of keytab files.
It would be best to store these files on a local file system that is not shared
with other systems. The storage file system can be on either the master KDC
server or any of the slave KDCs.</para>
</step>
</procedure>
</task>
</sect1>
</chapter><?Pub *0000243318 0?>