System Administration Guide: Security Services

How to Swap a Master KDC and a Slave KDC

This procedure requires that the slave KDC server has been set up as a swappable slave (see How to Configure a Swappable Slave KDC). In this procedure, the master KDC server that is being swapped out is named kdc1. The slave KDC that will become the new master KDC is named kdc4.

  1. On the old master KDC, kill the kadmind process.


    kdc1 # /etc/init.d/kdc.master stop
    

    When you kill the kadmind process, you prevent any changes from being made to the KDC database.

  2. On the old master KDC, comment out the kprop line in the root crontab file.


    kdc1 # crontab -e
    #ident  "@(#)root       1.19    98/07/06 SMI"   /* SVr4.0 1.1.3.1       */
    #
    # 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 * * 0,4 /etc/cron.d/logchecker
    10 3 * * 0   /usr/lib/newsyslog
    15 3 * * 0 /usr/lib/fs/nfs/nfsfind
    1 2 * * * [ -x /usr/sbin/rtc ] && /usr/sbin/rtc -c > /dev/null 2>&1
    30 3 * * * [ -x /usr/lib/gss/gsscred_clean ] && /usr/lib/gss/gsscred_clean
    #10 3 * * * /usr/lib/krb5/kprop_script kdc2.example.sun.com #SUNWkr5ma
    

    This step prevents the old master from propagating its copy of the KDC database.

  3. On the old master KDC, run kprop_script to back up and propagate the database.


    kdc1 # /usr/lib/krb5/kprop_script kdc4.example.com
    Database propagation to kdc4.example.com: SUCCEEDED
  4. On the old master KDC, move the master KDC commands.

    To prevent the master KDC commands from being run, move the kprop, kadmind and kadmin.local commands to a reserved place.


    kdc4 # mv /usr/lib/krb5/kprop /usr/lib/krb5/kprop.save
    kdc4 # mv /usr/lib/krb5/kadmind /usr/lib/krb5/kadmind.save
    kdc4 # mv /usr/sbin/kadmin.local /usr/sbin/kadmin.local.save
    kdc4 # mv /etc/krb5/kadm5.acl /etc/krb5/kadm5.acl.save
    
  5. On the DNS server, change the alias names for the master KDC.

    To change the servers, edit the example.com zone file and change the entry for masterkdc.


    masterkdc IN CNAME kdc4
  6. On the DNS server, restart the Internet domain name server.

    Run the following command on both servers to get the new alias information:


    # pkill -1 in.named
  7. On the new master KDC, move the master KDC commands.


    kdc4 # mv /usr/lib/krb5/kprop.save /usr/lib/krb5/kprop
    kdc4 # mv /usr/lib/krb5/kadmind.save /usr/lib/krb5/kadmind
    kdc4 # mv /usr/sbin/kadmin.local.save /usr/sbin/kadmin.local
    
  8. On the new master KDC, edit the Kerberos access control list file (kadm5.acl).

    Once populated, the /etc/krb5/kadm5.acl file should contain all principal names that are allowed to administer the KDC. The first entry that is added might look similar to the following:


    kws/admin@EXAMPLE.COM   *

    This entry gives the kws/admin principal in the EXAMPLE.COM realm the ability to modify principals or policies in the KDC. The default installation includes an asterisk (*) to match all admin principals. This default could be a security risk, so it is more secure to include a list of all of the admin principals. See the kadm5.acl(4) man page for more information.

  9. On the new master KDC, create a keytab file for kadmin by using kadmin.local.

    This command sequence creates a special keytab file with principal entries for admin and changepw. These principals are needed for the kadmind service.


    kdc4 # /usr/sbin/kadmin.local
    kadmin.local: ktadd -k /etc/krb5/kadm5.keytab kadmin/kdc4.example.com
    Entry for principal kadmin/kdc4.example.com with kvno 3, encryption type DES-CBC-CRC
              added to keytab WRFILE:/etc/krb5/kadm5.keytab.
    kadmin.local: ktadd -k /etc/krb5/kadm5.keytab changepw/kdc4.example.com
    Entry for principal changepw/kdc4.example.com with kvno 3, encryption type DES-CBC-CRC 
              added to keytab WRFILE:/etc/krb5/kadm5.keytab.
    kadmin.local: quit
    
  10. On the new master KDC, start kadmind.


    kdc4 # /etc/init.d/kdc.master start
    
  11. Enable the kprop line in the root crontab file.


    kdc4 # crontab -e
    #ident  "@(#)root       1.19    98/07/06 SMI"   /* SVr4.0 1.1.3.1       */
    #
    # 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 * * 0,4 /etc/cron.d/logchecker
    10 3 * * 0   /usr/lib/newsyslog
    15 3 * * 0 /usr/lib/fs/nfs/nfsfind
    1 2 * * * [ -x /usr/sbin/rtc ] && /usr/sbin/rtc -c > /dev/null 2>&1
    30 3 * * * [ -x /usr/lib/gss/gsscred_clean ] && /usr/lib/gss/gsscred_clean
    10 3 * * * /usr/lib/krb5/kprop_script kdc1.example.sun.com #SUNWkr5ma