home *** CD-ROM | disk | FTP | other *** search
/ ftp.pasteur.org/FAQ/ / ftp-pasteur-org-FAQ.zip / FAQ / kerberos-faq / general next >
Encoding:
Internet Message Format  |  2004-04-18  |  131.2 KB

  1. Path: senator-bedfellow.mit.edu!dreaderd!not-for-mail
  2. Message-ID: <kerberos-faq/general_1082200966@rtfm.mit.edu>
  3. Supersedes: <kerberos-faq/general_1079601013@rtfm.mit.edu>
  4. Expires: 31 May 2004 11:22:46 GMT
  5. X-Last-Updated: 2000/08/18
  6. Newsgroups: comp.protocols.kerberos,comp.answers,news.answers
  7. From: Ken Hornstein <kenh@cmf.nrl.navy.mil>
  8. Subject: Kerberos FAQ, v2.0 (last modified 8/18/2000)
  9. Followup-To: comp.protocols.kerberos
  10. Organization: Naval Research Laboratory, Computational Meta-Facility
  11. Summary: This is the list of Frequently Asked Questions about the Kerberos
  12.         security protocol.  It should be read by anyone who has questions
  13.         about Kerberos or wants to learn more about it.
  14. Approved: news-answers-request@MIT.EDU
  15. Originator: faqserv@penguin-lust.MIT.EDU
  16. Date: 17 Apr 2004 11:28:07 GMT
  17. Lines: 3029
  18. NNTP-Posting-Host: penguin-lust.mit.edu
  19. X-Trace: 1082201287 senator-bedfellow.mit.edu 576 18.181.0.29
  20. Xref: senator-bedfellow.mit.edu comp.protocols.kerberos:21808 comp.answers:56876 news.answers:269946
  21.  
  22. Archive-name: kerberos-faq/general
  23. Posting-Frequency: monthly
  24. URL: http://www.nrl.navy.mil/CCS/people/kenh/kerberos-faq.html
  25. Copyright: (c) 2000 United States Government as represented by the
  26.         Secretary of the Navy. All rights reserved.
  27.  
  28. Table of Contents:
  29.  
  30.    * 0. Introduction
  31.  
  32.    * 1. General information about Kerberos
  33.         o 1.1. What is Kerberos?
  34.         o 1.2. Where does the name "Kerberos" come from?
  35.         o 1.3. Hey! I remember my Greek mythology, and I thought the dog
  36.           that guarded the entrance was called Cerberus! What gives?
  37.         o 1.4. Where can I find out more information about Kerberos?
  38.         o 1.5. What is the latest version of Kerberos available from MIT?
  39.         o 1.6. Are there any other free version of Kerberos available?
  40.         o 1.7. What are the differences between Kerberos Version 4 and
  41.           Version 5?
  42.         o 1.8. What are the differences between AFS Kerberos and "normal"
  43.           Kerberos?
  44.         o 1.9. What is the format of principals?
  45.         o 1.10. How are realms named? Do they really have to be uppercase?
  46.         o 1.11. What is ASN.1?
  47.         o 1.12. I see the acronyms TGT and TGS used a lot. What do they
  48.           mean?
  49.         o 1.13. What is the export status of Kerberos?
  50.         o 1.14. What is a "Kerberos client", "Kerberos server", and
  51.           "application server"?
  52.         o 1.15. I use software package <foo>, and it claims it supports
  53.           Kerberos. What does that mean?
  54.         o 1.16. What is cross-realm authentication?
  55.         o 1.17. Are there security risks involved in cross-realm
  56.           authentication?
  57.         o 1.18. Are there any known weaknesses in Kerberos?
  58.         o 1.19. What is preauthentication?
  59.         o 1.20. Why do I need to synchronize my system clocks to run
  60.           Kerberos?
  61.         o 1.21. What computer vendors support Kerberos?
  62.         o 1.22. Can I use Kerberos 4 clients with Kerberos 5? How about the
  63.           reverse?
  64.         o 1.23. What is a "key salt"? "kvno"?
  65.         o 1.24. Does Kerberos support multi-homed machines?
  66.         o 1.25. What is "user to user" authentication?
  67.         o 1.26. What are forwardable tickets?
  68.         o 1.27. What are renewable tickets?
  69.         o 1.28. What are postdatable tickets?
  70.         o 1.29. What are the advantages/disadvantages of Kerberos vs. SSL?
  71.         o 1.30. What are proxiable tickets?
  72.    * 2. Administration questions
  73.         o 2.1. Okay, I'm the administrator of a site, and I'd like to run
  74.           Kerberos. What do I need to do?
  75.         o 2.2. What sort of resources do I need to dedicate to a KDC?
  76.         o 2.3. What programs/files need to go on each application server?
  77.         o 2.4. What programs/files need to go on each client?
  78.         o 2.5. There's a lot of stuff in the krb5.conf and kdc.conf files.
  79.           What does it all mean, and what do I really need?
  80.         o 2.6. How do I change the master key?
  81.         o 2.7. How do I set up slave servers?
  82.         o 2.8. What do I need to do to make V4 clients work with my V5 KDC?
  83.         o 2.9. I just added a host key to a machine with ktadd, and the kvno
  84.           got incremented! What just happened?
  85.         o 2.10. How do I run kadmin from a shell script unattended?
  86.         o 2.11. I can't use kadmin to talk to the admin server of another
  87.           realm. What am I doing wrong?
  88.         o 2.12. We run AFS at our site currently. Is there a way we can run
  89.           Kerberos along with AFS?
  90.         o 2.13. Employee <X> just left the company, and he had root on our
  91.           KDC. What should I do?
  92.         o 2.14. How should I configure my DNS for Kerberos?
  93.         o 2.15. What do I need to do to setup cross-realm authentication?
  94.         o 2.16. Can I configure the admin server to reject bad passwords?
  95.         o 2.17. Is there a hook I can use to do further password checking?
  96.         o 2.18. How come the "Last xxx" fields in the Kerberos database
  97.           don't seem to get updated?
  98.         o 2.19. What does krb524d do? Do I need to run it?
  99.         o 2.20. What is v5passwdd? Do I need to run it?
  100.         o 2.21. How do a rename a principal?
  101.         o 2.22. What is the difference between the "-a valid" and the "-a
  102.           user" flags for telnetd?
  103.         o 2.23. I already have a standard Unix password database for my user
  104.           population. Can I convert this to a Kerberos password database?
  105.         o 2.24. Can I have multiple realms on a single KDC?
  106.         o 2.25. What is the kadm5.acl file?
  107.    * 3. User and application questions
  108.         o 3.1. What happens when my tickets expire?
  109.         o 3.2. How do I run a cron job with Kerberos authentication?
  110.         o 3.3. How do I use renewable tickets?
  111.         o 3.4. What is the .k5login file, and how do I use it?
  112.         o 3.5. I've hear Microsoft will support Kerberos in Windows 2000. Is
  113.           that true?
  114.         o 3.6. How can I be authenticated as two different principals at the
  115.           same time?
  116.         o 3.7. How come Kerberos rlogin works to a machine, but when I use
  117.           Kerberos telnet I'm still asked for a password?
  118.         o 3.8. How do I use Kerberos telnet/rlogin to connect to a system as
  119.           a userid other than my current one?
  120.         o 3.9. Is there any way to do Kerberos authentication across the
  121.           WWW?
  122.         o 3.10. Is there a way to use Kerberos to authenticate my X windows
  123.           connections? I tried compiling the Kerberos support in X, but it
  124.           didn't work.
  125.         o 3.11. I need to use Kerberos through a firewall. What does my
  126.           firewall administrator need to do?
  127.    * 4. Error messages and other problems.
  128.         o 4.1. "No such file or directory"
  129.         o 4.2. "Decrypt integrity check failed"
  130.         o 4.3. "Cannot find/read stored master key"
  131.         o 4.4. "Incorrect net address"
  132.         o 4.5. "Initial Ticket response appears to be Version 4 error"
  133.         o 4.6. "Message stream modified"
  134.         o 4.7. "Illegal cross-realm ticket"
  135.         o 4.8. "Couldn't authenticate to server: Bad sendauth version was
  136.           sent"
  137.         o 4.9. When I try using Kerberos ftp, it doesn't work, but it says,
  138.           "No error".
  139.         o 4.10. When I telnet from a Linux machine to a Solaris machine with
  140.           Kerberos and hit Ctrl-C, the connection hangs.
  141.    * 5. Programming with Kerberos.
  142.         o 5.1. How do I start programming with Kerberos?
  143.         o 5.2. What is GSSAPI?
  144.         o 5.3. What is SASL?
  145.         o 5.4. Is there a reference for the Kerberos API?
  146.  
  147. ------------------------------------------------------------
  148.  
  149. Subject: 0. Introduction
  150.  
  151. Welcome to the Kerberos FAQ! The intent of this document is to answer many
  152. of the recurring questions that appear on the kerberos@mit.edu mailing list,
  153. as well as the comp.protocols.kerberos newsgroup. It is also intended to
  154. serve as a repository of information for people who want to know more about
  155. the Kerberos authentication system.
  156.  
  157. In general, this FAQ deals with the freely available MIT releases of
  158. Kerberos. If a question deals specifically with another implementation of
  159. Kerberos, then it will be explicitly mentioned.
  160.  
  161. Questions and comments should be directed to the FAQ maintainer, Ken
  162. Hornstein, <kenh@cmf.nrl.navy.mil>.
  163.  
  164. ------------------------------------------------------------
  165.  
  166. Subject: 1. General information about Kerberos
  167.  
  168. ------------------------------------------------------------
  169.  
  170. Subject: 1.1 What is Kerberos?
  171.  
  172. From <http://web.mit.edu/kerberos/www/>
  173.  
  174.      Kerberos is a network authentication protocol. It is designed to
  175.      provide strong authentication for client/server applications by
  176.      using secret-key cryptography. A free implementation of this
  177.      protocol is available from the Massachusetts Institute of
  178.      Technology. Kerberos is available in many commercial products as
  179.      well.
  180.  
  181.      The Internet is an insecure place. Many of the protocols used in
  182.      the Internet do not provide any security. Tools to "sniff"
  183.      passwords off of the network are in common use by systems
  184.      crackers. Thus, applications which send an unencrypted password
  185.      over the network are extremely vulnerable. Worse yet, other
  186.      client/server applications rely on the client program to be
  187.      "honest" about the identity of the user who is using it. Other
  188.      applications rely on the client to restrict its activities to
  189.      those which it is allowed to do, with no other enforcement by the
  190.      server.
  191.  
  192.      Some sites attempt to use firewalls to solve their network
  193.      security problems. Unfortunately, firewalls assume that "the bad
  194.      guys" are on the outside, which is often a very bad assumption.
  195.      Most of the really damaging incidents of computer crime are
  196.      carried out by insiders. Firewalls also have a significant
  197.      disadvantage in that they restrict how your users can use the
  198.      Internet. (After all, firewalls are simply a less extreme example
  199.      of the dictum that there is nothing more secure then a computer
  200.      which is not connected to the network --- and powered off!) In
  201.      many places, these restrictions are simply unrealistic and
  202.      unacceptable.
  203.  
  204.      Kerberos was created by MIT as a solution to these network
  205.      security problems. The Kerberos protocol uses strong cryptography
  206.      so that a client can prove its identity to a server (and vice
  207.      versa) across an insecure network connection. After a client and
  208.      server have used Kerberos to prove their identity, they can also
  209.      encrypt all of their communications to assure privacy and data
  210.      integrity as they go about their business.
  211.  
  212.      Kerberos is freely available from MIT, under a copyright
  213.      permission notice very similar to the one used for the BSD
  214.      operating and X11 Windowing system. MIT provides Kerberos in
  215.      source form, so that anyone who wishes to use it may look over the
  216.      code for themselves and assure themselves that the code is
  217.      trustworthy. In addition, for those who prefer to rely on a
  218.      professional supported product, Kerberos is available as a product
  219.      from many different vendors.
  220.  
  221.      In summary, Kerberos is a solution to your network security
  222.      problems. It provides the tools of authentication and strong
  223.      cryptography over the network to help you secure your information
  224.      systems across your entire enterprise. We hope you find Kerberos
  225.      as useful as it has been to us. At MIT, Kerberos has been
  226.      invaluable to our Information/Technology architecture.
  227.  
  228. ------------------------------------------------------------
  229.  
  230. Subject: 1.2. Where does the name "Kerberos" come from?
  231.  
  232. The name Kerberos comes from Greek mythology; it is the three-headed dog
  233. that guarded the entrance to Hades.
  234.  
  235. ------------------------------------------------------------
  236.  
  237. Subject: 1.3. Hey! I remember my Greek mythology, and I thought the dog that
  238.     guarded the entrance was called Cerberus! What gives?
  239.  
  240. I personally wonder about this myself. I have seen references in "The
  241. Devil's Dictionary" that claim it is Kerberos, but when I checked this
  242. myself I only found the "Cerberus" variant.
  243.  
  244. I never actually heard of the "Kerberos" spelling/pronunciation until I got
  245. involved with Kerberos myself.
  246.  
  247. From: Tom Yu <tlyu@MIT.EDU>
  248.  
  249.      "Cerberus" is the Latin spelling of the Greek "Kerberos", and
  250.      according to the OED is pronounced like "serberus", but that is
  251.      quite at odds with the Greek, as the initial consonant is a "k".
  252.      MIT Project Athena chose to use the Greek spelling and
  253.      pronunciation.
  254.  
  255. From: Jan Sacharuk <Jan.Sacharuk@cul.ca>
  256.  
  257.      Tom Yu is correct, Cerberus is the Latin spelling. However, the
  258.      fact that the OED says that the 'c' is pronounced as an 's' is an
  259.      English affectation. In Latin, the letter 'c' is always hard. So
  260.      Cerberus is pronounced 'Ker-ber-ous'. The letter 'u' is also
  261.      slightly different, making it somewhere in between 'oos' and
  262.      'ous'.
  263.  
  264. From: Michael A. Covington <Michael@CovingtonInnovations.com>
  265.  
  266.      "Kerberos" is the original Greek name. In Latin, the letter K is
  267.      not normally used, and in Roman times, C always represented the K
  268.      sound. Also, "-os" is a Greek suffix (nominative masculine
  269.      singular) whose nearest equivalent in Latin is the suffix "-us"
  270.      (very familiar in Latin names). That's why the name goes into
  271.      Latin as Cerberus.
  272.  
  273.      (See, a Ph.D. in linguistics is good for something! :)
  274.  
  275. ------------------------------------------------------------
  276.  
  277. Subject: 1.4. Where can I find out more information about Kerberos?
  278.  
  279. If you're new to Kerberos, I would suggest you read:
  280.  
  281.    * Bill Bryant, "Designing an Authentication System: A Dialogue in Four
  282.      Scenes."
  283.      <http://web.mit.edu/kerberos/www/dialogue.html>
  284.  
  285.      A cute explanation of Kerberos protocol, in plain English. Technobabble
  286.      is kept to a minimum.
  287.  
  288.    * Jeffrey I. Schiller, "Secure Distributed Computing", Scientific
  289.      American, November 1994, pp 72-76.
  290.  
  291.      An excellent overview that covers all of the important details of the
  292.      Kerberos protocol. It also explains how it's used at MIT as a "real
  293.      world" example. This article could be useful in persuading manager
  294.      droids that Kerberos is a good thing.
  295.  
  296.    * J. G. Steiner, B. Clifford Neuman, and J.I. Schiller, "Kerberos: An
  297.      Authentication Service for Open Network Systems".
  298.      <ftp://athena-dist.mit.edu/pub/kerberos/doc/usenix.PS>
  299.  
  300.      The original paper describing Kerberos. A good general overview. It
  301.      describes the encryption notation used by many other Kerberos papers,
  302.      so it is definitely worth reading if you want to read other Kerberos
  303.      papers.
  304.  
  305.    * Brian Tung, "The Moron's Guide to Kerberos"
  306.      <http://www.isi.edu/~brian/security/kerberos.html>
  307.  
  308.      Despite the title, goes into a fair amount of detail. I would suggest
  309.      reading this after you have read one or more of the higher-level
  310.      papers.
  311.  
  312. The MIT Kerberos web page <http://web.mit.edu/kerberos/www/> has many links
  313. pointing to Kerberos resources.
  314.  
  315. One of the best tutorials for Kerberos is Jim Rowe's, "How To Kerberize Your
  316. Site", which is available at:
  317.  
  318.    * <http://www.y12.doe.gov/~jar/HowToKerb.html>
  319.  
  320. There is an RFC for Kerberos 5: RFC 1510, which is available at:
  321.  
  322. <http://www.ietf.org/rfc/rfc1510.txt>
  323.  
  324. But it is a rather difficult read unless you already know a lot about how
  325. Kerberos works.
  326.  
  327. ------------------------------------------------------------
  328.  
  329. Subject: 1.5. What is the latest version of Kerberos available from MIT?
  330.  
  331. The latest version of Kerberos 4 from MIT is patchlevel 10. You can get it
  332. by reading <ftp://athena-dist.mit.edu/pub/kerberos/README.KRB4> and
  333. following the directions in that file.
  334.  
  335. Kerberos 4 is officially considered "dead" by MIT; all current development
  336. is concentrated on Kerberos 5.
  337.  
  338. The latest version of Kerberos 5 is 1.2.1. You can get it from the following
  339. location:
  340.  
  341. http
  342.      Go to the Kerberos web page <http://web.mit.edu/kerberos/www/>, select
  343.      the link marked, "Release 1.2", and from there, select "Retrieving".
  344.  
  345. Note that only U.S. & Canadian citizens can legally download Kerberos from
  346. MIT. However, Kerberos 5 is available for ftp from:
  347. <ftp://ftp.ox.ac.uk/pub/comp/security/software/Kerberos5>
  348.  
  349. I have no idea if it is legal for non-US residents to download Kerberos from
  350. this ftp site.
  351.  
  352. ------------------------------------------------------------
  353.  
  354. Subject: 1.6. Are there any other free version of Kerberos available?
  355.  
  356. Cygnus Solutions has announced the release of KerbNet 1.2. This is based on
  357. the MIT 1.0pl1 release, but with a number of enhancements. You can find out
  358. more information about KerbNet at <http://www.cygnus.com/technie/kerbnet/>.
  359.  
  360. The Center for Parallel Computers at the Royal Institute of Technology in
  361. Stockholm, Sweden have a version of eBones (Bones with crypto calls added
  362. back in). This is a version of Kerberos 4 that is exportable to other
  363. countries (assuming that your country allows you to import cryptographic
  364. software). It is available at
  365.  
  366. <ftp://ftp.pdc.kth.se/pub/krb>.
  367.  
  368. A web page for KTH krb4 is available at:
  369.  
  370.    * <http://www.pdc.kth.se/kth-krb>
  371.  
  372. There is also work at the Center for Parallel Computers to create a freely
  373. available version of Kerberos 5 called Heimdal. Mailing lists to discuss
  374. Heimdal are are available at:
  375.  
  376.    * <heimdal-announce@sics.se> - low-volume announcement only, moderated
  377.    * <heimdal-discuss@sics.se> - high-volume discussion
  378.  
  379. Send email to <majordomo@sics.se> to subscribe to either one of these
  380. mailing lists.
  381.  
  382. A web page for heimdal is also available at:
  383.  
  384. <http://www.pdc.kth.se/heimdal/>
  385.  
  386. As of this writing, the latest release is 0.03a.
  387.  
  388. ------------------------------------------------------------
  389.  
  390. Subject: 1.7. What are the differences between Kerberos Version 4 and
  391.     Version 5?
  392.  
  393. The paper "The Evolution of the Kerberos Authentication System" is a very
  394. good description of the limitations of Kerberos 4 and what changes were made
  395. in Kerberos 5. This paper is available from
  396. <ftp://athena-dist.mit.edu/pub/kerberos/doc/krb_evol.PS>.
  397.  
  398. However, here is a quick list of the more important changes:
  399.  
  400.    * The key salt algorithm has been changed to use the entire principal
  401.      name.
  402.    * The network protocol has been completely redone and now uses ASN.1
  403.      encoding everywhere.
  404.    * There is now support for forwardable, renewable, and postdatable
  405.      tickets.
  406.    * Kerberos tickets can now contain multiple IP addresses and addresses
  407.      for different types of networking protocols.
  408.    * A generic crypto interface module is now used, so other encryption
  409.      algorithms beside DES can be used.
  410.    * There is now support for replay caches, so authenticators are not
  411.      vulnerable to replay.
  412.    * There is support for transitive cross-realm authentication.
  413.  
  414. ------------------------------------------------------------
  415.  
  416. Subject: 1.8. What are the differences between AFS Kerberos and "normal"
  417.     Kerberos?
  418.  
  419. The Kerberos used in AFS (formerly known as the Andrew File System) was
  420. developed from the Kerberos 4 papers, but before the protocol was
  421. formalized.
  422.  
  423. As a result, AFS Kerberos uses the RX protocol for all communication between
  424. the clients and database servers (which function as KDCs in Kerberos
  425. termology)
  426.  
  427. The standard AFS clients that perform authentication discard the TGT after
  428. they acquire an AFS service ticket. This means that you can't get tickets
  429. for other services using your AFS token.
  430.  
  431. It is possible to use regular Kerberos instead of AFS Kerberos. For more
  432. information, see Question 2.12.
  433.  
  434. ------------------------------------------------------------
  435.  
  436. Subject: 1.9. What is the format of principals?
  437.  
  438. In Kerberos 4, a principal was divided into three parts:
  439.  
  440.   1. The principal name
  441.   2. An optional instance
  442.   3. The Kerberos realm
  443.  
  444. Kerberos 4 principals are written in the following format:
  445.  
  446. name.instance@realm
  447.  
  448. Kerberos 5 principals are written in a slightly different format:
  449.  
  450. component/component/component@realm
  451.  
  452. The terms "name" and "instance" are still used for the first and the second
  453. components respectively.
  454.  
  455. Note that in both Kerberos 4 and Kerberos 5, the way that principals are
  456. encoded into strings have nothing to do with the way they are stored
  457. internally in Kerberos.
  458.  
  459. There is an established convention as to how principals are named.
  460. Generally, you will encounter three different types of principals.
  461.  
  462.   1. A principal without an instance. This is used for users, with the
  463.      username being used as the principal name. Some examples:
  464.  
  465.      kenh@CMF.NRL.NAVY.MIL
  466.      tytso@ATHENA.MIT.EDU
  467.  
  468.   2. A principal with a hostname for an instance. This is used to
  469.      distinguish between the same service on different machines. Some
  470.      examples:
  471.  
  472.      host/foo.bar.org@BAR.ORG
  473.      ftp/blah.bar.org@BAR.ORG
  474.  
  475.   3. A principal with a unique instance that is not a hostname. For these
  476.      principals the instance has other significance.
  477.  
  478.      krbtgt/BAR.ORG@BAR.ORG
  479.      krbtgt/FOO.ORG@BAR.ORG
  480.  
  481. While the specification for Kerberos 5 allows more than two components, in
  482. practice this is not used.
  483.  
  484. The two most important differences between Kerberos 4 principals and
  485. Kerberos 5 principals are:
  486.  
  487.   1. The instance separator in Kerberos 4 is a period (.) where in Kerberos
  488.      5 the instance separator is a forward slash (/).
  489.   2. In principals where the hostname is used as the instance, the "short"
  490.      hostname (without a domain name) is used as the instance for Kerberos
  491.      4. In Kerberos 5, the fully qualified domain name is used as the
  492.      instance.
  493.  
  494. ------------------------------------------------------------
  495.  
  496. Subject: 1.10. How are realms named? Do they really have to be uppercase?
  497.  
  498. In theory, the realm name is arbitrary. You can call your realm whatever you
  499. want.
  500.  
  501. However, in practice a Kerberos realm is named by uppercasing the DNS domain
  502. name associated with the hosts in the to-be named realm. In other words, if
  503. your hosts are all in the foo.org domain, you might call your Kerberos realm
  504. FOO.ORG.
  505.  
  506. If you wish to have more than one Kerberos realm associated with the same
  507. DNS domain name, the convention is to create realms that are in the same
  508. hierarchy of your DNS domain name. For example, if you wish to have two
  509. Kerberos realms in the DNS domain foo.org for Human Resources and Sales, you
  510. might create the Kerberos realms HR.FOO.ORG and SALES.FOO.ORG.
  511.  
  512. The convention to use uppercase for realms names arose out of the desire to
  513. easily distinguish between DNS domain names (which are actually
  514. case-insensitive) and Kerberos realms. The Kerberos realm name is case
  515. sensitive (the realm foo.org is different than the realm FOO.ORG). You are
  516. not required to have an uppercase Kerberos realm, but I would strongly
  517. advise it.
  518.  
  519. It is worth noting that the recent revisions to the Kerberos standard have
  520. specified that uppercase realm names are preferred and lowercase realm names
  521. have been depreciated.
  522.  
  523. ------------------------------------------------------------
  524.  
  525. Subject: 1.11. What is ASN.1?
  526.  
  527. ASN.1 is short for Abstract Syntax Notation One. It is a notation for
  528. describing abstract types and values. Using ASN.1, one can describe the
  529. format of complex objects by putting together more simpler types.
  530.  
  531. However, ASN.1 does not specify how these objects are encoded into strings
  532. of ones and zeros. For that, you must use a set of encoding rules. The two
  533. most common encoding rules are the Basic Encoding Rules (BER) and the
  534. Distinguished Encoding Rules (DER). The only difference between BER and DER
  535. is that there are multiple ways to encode objects in the BER, but the DER is
  536. a subset of the BER such that there is only one possible way to encode each
  537. object.
  538.  
  539. Kerberos 5 uses ASN.1 and the DER to encode and decode all of the Kerberos
  540. protocol messages. Unless you are planning on adding to the Kerberos
  541. protocol itself, you don't really need to worry about ASN.1 at all.
  542.  
  543. If you wish to learn more about ASN.1, I would suggest reading:
  544.  
  545.    * Burton S. Kaliski Jr., "A Layman's Guide to a Subset of ASN.1, BER, and
  546.      DER"
  547.      <ftp://ftp.rsa.com/pub/pkcs/ps/layman.ps>
  548.    * Brian Tung, "ASN.1: Wherefore Art Thou?"
  549.      <http://www.isi.edu/~brian/security/asn1.html>
  550.  
  551. ------------------------------------------------------------
  552.  
  553. Subject: 1.12. I see the acronyms TGT and TGS used a lot. What do they mean?
  554.  
  555. TGT is the acronym for a "Ticket Granting Ticket".
  556.  
  557. TGS is the acronym for the "Ticket Granting Service".
  558.  
  559. While it may seen that the two acronyms are used interchangeably, they refer
  560. to two very different things. The Ticket Granting Ticket is a Kerberos
  561. ticket for the Ticket Granting Service. Both play a special role in
  562. Kerberos.
  563.  
  564. When a user first authenticates to Kerberos, he talks to the Authentication
  565. Service on the KDC to get a Ticket Granting Ticket. This ticket is encrypted
  566. with the user's password.
  567.  
  568. When the user wants to talk to a Kerberized service, he uses the Ticket
  569. Granting Ticket to talk to the Ticket Granting Service (which also runs on
  570. the KDC). The Ticket Granting Service verifies the user's identity using the
  571. Ticket Granting Ticket and issues a ticket for the desired service.
  572.  
  573. The reason the Ticket Granting Ticket exists is so a user doesn't have to
  574. enter in their password every time they wish to connect to a Kerberized
  575. service or keep a copy of their password around. If the Ticket Granting
  576. Ticket is compromised, an attacker can only masquerade as a user until the
  577. ticket expires.
  578.  
  579. The documentation in Question 1.4 explains all of this in further detail.
  580.  
  581. ------------------------------------------------------------
  582.  
  583. Subject: 1.13. What is the export status of Kerberos?
  584.  
  585. This is a topic of much discussion, and it appears that there is no clear
  586. answer. Your best bet is to contact a lawyer for a definitive answer. But if
  587. you're willing to listen to "educated guesses", read on.
  588.  
  589. The recent US Government relaxation of export controls has caused much
  590. discussion on this topic. The current belief is that under the new
  591. regulations, Kerberos source code can be exported everywhere, except for the
  592. so-called "T7" countries (countries that are defined by the US State
  593. Department as being terrorist countries).
  594.  
  595. The definitive source for the exact regulations is the Bureau of Export
  596. Administration, and their web site is at:
  597. <http://www.bxa.doc.gov/Encryption/>
  598.  
  599. Specifically, if you look at the Encryption License Exemption Chart,
  600. <http://www.bxa.doc.gov/Encryption/lechart1.htm>
  601.  
  602. you can see that under "Unrestricted, encryption source code (open source
  603. code)" that the only restriction is to not knowingly export to T7 countries.
  604.  
  605. The official response from MIT with respect to the export status of Kerberos
  606. 5 is that they have contacted their legal staff, and they have not yet given
  607. them an answer.
  608.  
  609. However, Question 1.5 does list a non-US ftp site for Kerberos 5. The
  610. legality of downloading Kerberos from this site is unknown.
  611.  
  612. ------------------------------------------------------------
  613.  
  614. Subject: 1.14. What is a "Kerberos client", "Kerberos server", and
  615.     "application server"?
  616.  
  617. In Kerberos, all authentication takes place between clients and servers. So
  618. in Kerberos termology, a "Kerberos client" is any entity that gets a service
  619. ticket for a Kerberos service. A client is typically a user, but any
  620. principal can be a client (unless for some reason the administrator has
  621. explicitly forbidden this principal to be a client).
  622.  
  623. The term "Kerberos server" generally refers to the Key Distribution Center,
  624. or the KDC for short. The KDC implements the Authentication Service (AS) and
  625. the Ticket Granting Service (TGS). The KDC has a copy of every password
  626. associated with every principal. For this reason, it is absolutely vital
  627. that the KDC be as secure as possible.
  628.  
  629. Most KDC implementations store the principals in a database, so you may hear
  630. the term "Kerberos database" applied to the KDC.
  631.  
  632. For reliability purposes, it is possible to have backup KDCs. These are
  633. referred to as slave servers. The slaves all synchronize their databases
  634. from the master KDC.
  635.  
  636. In most Kerberos implementations there is also an administration server
  637. which allows remote manipulation of the Kerberos database. This
  638. administration server usually runs on the KDC.
  639.  
  640. The term "application server" generally refers to Kerberized programs that
  641. clients communicate with using Kerberos tickets for authentication. For
  642. example, the Kerberos telnet daemon (telnetd) is an example of an
  643. application server.
  644.  
  645. ------------------------------------------------------------
  646.  
  647. Subject: 1.15. I use software package <foo>, and it claims it supports
  648.     Kerberos. What does that mean?
  649.  
  650. Unfortunately, "supporting Kerberos" can mean a number of things.
  651.  
  652. The most basic level of Kerberos support is verifying a plaintext password
  653. against the Kerberos database. Depending on the application, this may or may
  654. not be secure. For example, since the Unix xlock application is designed to
  655. verify passwords and (hopefully) is only run from on your local workstation,
  656. verifying passwords against a Kerberos database is perfectly adequate.
  657. However, if you have a POP server that verifies the PASS command by checking
  658. the password against a Kerberos database, that is NOT secure, because the
  659. password will travel over the network in the clear.
  660.  
  661. There are different levels of password verification, however. Unless a
  662. program that does plaintext password verification uses the acquired TGT to
  663. get a service ticket for a locally trusted service (that is, with the key in
  664. a keytab on local disk), then an attacker can spoof the client with a TGT
  665. encrypted in a known password.
  666.  
  667. The next level of Kerberos support is a "true" Kerberized application that
  668. uses Kerberos tickets to verify identity and/or encrypt data. This is the
  669. way that Kerberos was designed to function, and it provides the highest
  670. level of security that Kerberos has to offer. Unfortunately, relatively few
  671. applications support Kerberos to this degree.
  672.  
  673. If you use an application that claims to support Kerberos, you should find
  674. out exactly what this means and determine if that is appropriate for your
  675. environment. If you use Kerberos primarily as a single-signon system, then
  676. having a POP server that verifies plaintext passwords against a Kerberos
  677. database may be acceptable to you.
  678.  
  679. All of the Unix replacement commands that come with the MIT Kerberos
  680. distributions (telnet, ftp, rlogin, rsh, etc), are "true" Kerberized
  681. applications.
  682.  
  683. ------------------------------------------------------------
  684.  
  685. Subject: 1.16. What is cross-realm authentication?
  686.  
  687. Any Kerberos principal can authenticate to other principals within the same
  688. Kerberos realm. However, it is also possible to configure a Kerberos realm
  689. so principals in one realm can authenticate to principals in another realm.
  690. This is called cross-realm authentication.
  691.  
  692. The way this is implemented is the KDCs in the two realms share a special
  693. cross-realm secret, and this secret is used to prove the identity of
  694. principals when crossing the boundary between realms.
  695.  
  696. Kerberos 5 supports an additional variant of this called transitive
  697. cross-realm authentication. In traditional cross-realm authentication, each
  698. pair of realms that wish to authenticate need to share a cross-realm secret.
  699. This means in a group of N realms, 2 * ((N - 1) ** 2) secrets will need to
  700. be exchanged in order to cover all possible cross-realm authentication
  701. paths.
  702.  
  703. In transitive cross-realm authentication you can define a path of realms
  704. connected via cross-realm secrets and use this path to "hop" between realms
  705. until you get credentials in the desired realm.
  706.  
  707. Information on configuring cross-realm authentication can be found in the
  708. answer to Question 2.15
  709.  
  710. ------------------------------------------------------------
  711.  
  712. Subject: 1.17. Are there security risks involved in cross-realm
  713.     authentication?
  714.  
  715. When you set up a cross-realm secret, you are in essence trusting the remote
  716. KDC to only issue cross-realm tickets for the correct users. If you do not
  717. trust the foreign KDC then all principals from the foreign realm are
  718. suspect.
  719.  
  720. However, a realm which you share a cross-realm secret with cannot acquire a
  721. ticket for a user in your local realm; a foreign KDC can only cause tickets
  722. to be issued that identify users from the foreign realm (in other words,
  723. there's no way a KDC can cause a ticket to be generated for a principal in a
  724. realm other than it's own).
  725.  
  726. All of the daemons that come with the MIT Kerberos 5 release do not trust
  727. principals in foreign realms by default; you have to explicitly enable them
  728. using ACLs. So as long as foreign-realm principals are not on any ACLs in
  729. your realm, there isn't a risk.
  730.  
  731. If you do decide to place foreign-realm principals on ACLs, you will have to
  732. remember that the security of that principal depends on the security of the
  733. foreign realm.
  734.  
  735. ------------------------------------------------------------
  736.  
  737. Subject: 1.18. Are there any known weaknesses in Kerberos?
  738.  
  739. Kerberos makes no provisions for host security; it assumes that it is
  740. running on trusted hosts with an untrusted network. If your host security is
  741. compromised, then Kerberos is compromised as well.
  742.  
  743. However, the degree to which Kerberos is compromised depends on the host
  744. that is compromised. If an attacker breaks into a multi-user machine and
  745. steals all of the tickets stored on that machine, he can impersonate the
  746. users who have tickets stored on that machine .... but only until those
  747. tickets expire.
  748.  
  749. Kerberos uses a principal's password (encryption key) as the fundamental
  750. proof of identity. If a user's Kerberos password is stolen by an attacker,
  751. then the attacker can impersonate that user with impunity.
  752.  
  753. Since the KDC holds all of the passwords for all of the principals in a
  754. realm, if host security on the KDC is compromised, then the entire realm is
  755. compromised.
  756.  
  757. In Kerberos 4, authenticators are valid for 5 minutes. If an attacker sniffs
  758. the network for authenticators, they have a 5 minute window in which they
  759. can re-use it and gain access to the same service you used. Kerberos 5
  760. introduced a replay cache which prevents any authenticator from being used
  761. more than once.
  762.  
  763. Since anybody can request a TGT for any user, and that ticket is encrypted
  764. with the user's secret key (password), it is simple to perform a offline
  765. attack on this ticket by trying to decrypt it with different passwords.
  766. Kerberos 5 introduced preauthentication to solve this problem.
  767.  
  768. A excellent critique of Kerberos is:
  769.  
  770.    * S. M. Bellovin and M. Merritt. "Limitations of the Kerberos
  771.      Authentication System"
  772.      <ftp://research.att.com/dist/internet_security/kerblimit.usenix.ps>
  773.  
  774. It was written for Kerberos 4, but has an appendix which also covers
  775. Kerberos 5.
  776.  
  777. ------------------------------------------------------------
  778.  
  779. Subject: 1.19. What is preauthentication?
  780.  
  781. As mentioned in Question 1.18, one weakness in Kerberos is the ability to do
  782. an offline dictionary attack by requested a TGT for a user and just trying
  783. different passwords until you find one that decrypts the TGT successfully.
  784.  
  785. One way of preventing this particular attack is to do what is known as
  786. preauthentication. This means to simply require some additional
  787. authentication before the KDC will issue you a TGT.
  788.  
  789. The simplest form of preauthentication is known as PA-ENC-TIMESTAMP. This is
  790. simply the current timestamp encrypted with the user's key.
  791.  
  792. There are various other types of preauthentication, but not all versions of
  793. Kerberos 5 support them all.
  794.  
  795. ------------------------------------------------------------
  796.  
  797. Subject: 1.20. Why do I need to synchronize my system clocks to run
  798.     Kerberos?
  799.  
  800. The actual verification of a client's identity is done by validating an
  801. authenticator. The authenticator contains the client's identity and a
  802. timestamp.
  803.  
  804. To insure that the authenticator is up-to-date and is not an old one that
  805. has been captured by an attacker, the timestamp in the authenticator is
  806. checked against the current time. If the timestamp is not close enough to
  807. the current time (typically within five minutes) then the authenticator is
  808. rejected as invalid. Thus, Kerberos requires your system clocks to be
  809. loosely synchronized (the default is 5 minutes, but it can be adjusted in
  810. Version 5 to be whatever you want).
  811.  
  812. The paper:
  813.  
  814.    * Don Davis, Daniel Geer, and Theodore Ts'o, "Kerberos With Clocks
  815.      Adrift: History, Protocols, and Implementation"
  816.      <http://world.std.com/~dtd/synch/synch.ps>
  817.  
  818. explains a way for Kerberos principals to securely determine the time
  819. without having to rely on a external time source. This is implemented for
  820. clients only in the Kerberos 5 release. With this in place, clients do not
  821. need to synchronize their system clocks to use Kerberos; however,
  822. application servers need to.
  823.  
  824. Note that it is possible to use the above technique for application servers
  825. as well as clients; it is just not currently implemented that way.
  826.  
  827. ------------------------------------------------------------
  828.  
  829. Subject: 1.21. What vendors support Kerberos?
  830.  
  831. Please note that this is by no means a definitive list; I am only listing
  832. the ones that I know about. Corrections to this list are especially welcome.
  833.  
  834. A number of software vendors sell versions of Kerberos, or provide support
  835. for Kerberos:
  836.  
  837.    * CyberSafe sells and supports Kerberos 4 and Kerberos 5 with their
  838.      TrustBroker product. In additional to normal Kerberos passwords,
  839.      TrustBroker also supports the use of PKINIT authentication using public
  840.      key certificates.
  841.  
  842.      You can find out more information from <http://www.cybersafe.com>.
  843.  
  844.    * WRQ Inc. supports Kerberos on Win32 platforms with their Reflection
  845.      Secure and Reflection Signature products. This includes a telnet client
  846.      that does Kerberos 5 authentication and a graphical FTP client which
  847.      supports Kerberos 5 (GSSAPI) authentication, data integrity, and
  848.      privacy.
  849.  
  850.      You can find out more information from <http://www.wrq.com>.
  851.  
  852.    * Hummingbird Communications Ltd. supports Kerberos on Win32 platforms
  853.      with their HostExplorer product. This includes a telnet client that
  854.      does Kerberos 4 authentication and encryption.
  855.  
  856.      You can find out more information from <http://www.hummingbird.com>.
  857.  
  858.    * Columbia University's Kermit Project supports Kerberos 4 and Kerberos 5
  859.      in Kermit 95 for Windows 95/98/NT and in C-Kermit for Unix. Kermit's
  860.      scripting language can be used to automate a variety of ticket
  861.      management tasks. Kerberos authentication and DES encryption applies to
  862.      telnet connections.
  863.  
  864.      The Internet Kermit Service daemon (C-Kermit 7.0) supports Kerberos for
  865.      automated client authentication.
  866.  
  867.      For further information see <http://www.kermit-project.org/>.
  868.  
  869. In additional to independent vendors, a number of computer vendors have
  870. integrated Kerberos into some of their products:
  871.  
  872.    * Sun ships a basic set of Kerberos 4 utilities with Solaris (kinit,
  873.      klist, kdestroy), and the RPC that comes with Solaris supports a
  874.      Kerberos 4 authentication mechanism.
  875.  
  876.      Sun has also announced a complete Kerberos 5 product that will also act
  877.      as a Microsoft KDC. This product is available world-wide with 56 bit
  878.      DES with no key recovery/escrow requirements.
  879.  
  880.      For the press release on this product announcement, see
  881.      <http://www.sun.com/smi/Press/sunflash/9907/sunflash.990719.1.html>.
  882.  
  883.      For more specific documentation, please see
  884.      <http://docs.sun.com:80/ab2/coll.384.1/@Ab2CollView>.
  885.    * Cisco routers support Kerberos 5 authentication for incoming and
  886.      outgoing telnet connections. It was broken for a very long time, but I
  887.      have heard reports that it's fixed now. However, ticket forwarding (as
  888.      of last report) is still broken.
  889.    * Microsoft has stated that they will support some version of Kerberos 5
  890.      in Windows 2000.
  891.  
  892. ------------------------------------------------------------
  893.  
  894. Subject: 1.22. Can I use Kerberos 4 clients with Kerberos 5? How about the
  895.     reverse?
  896.  
  897. The MIT Kerberos 5 release can speak the Kerberos 4 protocol, assuming it
  898. was built with the --with-krb4 option (which is the default). So with a
  899. little work (see Question 2.8) you should be able to use all Kerberos 4
  900. programs with your Kerberos 5 KDC and application servers.
  901.  
  902. However, since the protocol is so different, there is really no way to make
  903. Kerberos 5 clients work with Kerberos 4 application servers and KDCs.
  904.  
  905. ------------------------------------------------------------
  906.  
  907. Subject: 1.23. What is a "key salt"? "kvno"?
  908.  
  909. To understand a key salt, it's important to remember that in Kerberos you
  910. prove your identity by being able to decrypt or encrypt data using an
  911. encryption key that you share with the KDC.
  912.  
  913. However, a 56-bit DES key is hard for humans to remember. So, whenever a
  914. person enters in their "Kerberos password", it is really converted to a
  915. encryption key by a function called string2key(). This function converts the
  916. plaintext password via a one-way hash algorithm to an encryption key. In
  917. Kerberos 4 this is always a DES key. In Kerberos 5 it could be a key for
  918. algorithms other than DES (but currently DES is still the most widely used
  919. algorithm in Kerberos 5).
  920.  
  921. The string2key() function takes an optional argument called the key salt.
  922. This is an additional input to the one-way hash algorithm. If a salt is
  923. supplied, it is concatenated to the plaintext password and the resulting
  924. string is converted using the one-way hash algorithm.
  925.  
  926. In Kerberos 4, a salt was never used. The password was the only input to the
  927. one-way hash function. This has a serious disadvantage; if a user happens to
  928. use the same password in two Kerberos realms, a key compromise in one realm
  929. would result in a key compromise in the other realm.
  930.  
  931. In Kerberos 5 the complete principal name (including the realm) is used as
  932. the salt. This means that the same password will not result in the same
  933. encryption key in different realms or with two different principals in the
  934. same realm.
  935.  
  936. AFS uses a different string2key algorithm than Kerberos 4 and Kerberos 5,
  937. and uses the Kerberos realm name (not the cell name) as the key salt.
  938.  
  939. The MIT Kerberos 5 KDC stores the key salt algorithm along with the
  940. principal name, and that is passed back to the client as part of the
  941. authentication exchange. This means that if you convert your Kerberos
  942. database from Kerberos 4 to Kerberos 5, Kerberos 5 clients can use the
  943. correct string2key algorithm to convert your password to the matching
  944. encryption key. The same is true with AFS, and the AFS-Kerberos 5 migration
  945. kit comes with tools to let you do this (see Question 2.12 for more
  946. information).
  947.  
  948. It's worth pointing out that this is only an issue for the cases when you
  949. need to convert a plaintext password to an encryption key. Programs that
  950. deal directly with encryption keys (such as application servers) never deal
  951. with plaintext passwords, and as a result this is not an issue with them.
  952.  
  953. The term "kvno" is simply an acronym for "Key version number". To help
  954. distinguish between multiple keys associated with the same principal (for
  955. example, if a user changes his password), each key is assigned a key version
  956. number. Key version numbers typically start at zero when the principal is
  957. first created and are incremented by one every time the password/encryption
  958. key is changed.
  959.  
  960. ------------------------------------------------------------
  961.  
  962. Subject: 1.24. Does Kerberos support multi-homed machines?
  963.  
  964. In both Kerberos 4 and Kerberos 5, a machine's network address is part of
  965. the ticket information. This address is used as an additional check to make
  966. sure the ticket hasn't been stolen and is being used on another machine.
  967.  
  968. In Kerberos 4, there was room for only one IP address in the ticket, which
  969. did not work with multihomed machines. KTH krb4 includes some hacks to make
  970. it work with Kerberos 4.
  971.  
  972. Kerberos 5 supports multiple IP addresses in a ticket, thus allowing
  973. Kerberos 5 tickets to deal with multi-homed machines. However, doing so
  974. requires careful configuration of your DNS server. Question 2.14 explains
  975. this in further detail.
  976.  
  977. ------------------------------------------------------------
  978.  
  979. Subject: 1.25. What is "user to user" authentication?
  980.  
  981. From: Don Davis <dtd@world.std.com>
  982.  
  983.      User-to-user authentication is a special Kerberos application
  984.      protocol, that allows users to host secure application services on
  985.      their desktop machines. It is increasingly common for users to
  986.      offer desktop services that merit secure authentication, such as
  987.      nfs and ftp. When users configure their desktop servers with a
  988.      long-lived srvtab key, this long-lived key becomes a very
  989.      attractive target for theft. User-to-user authentication enables a
  990.      user to run a server without keeping a long-lived key on disk.
  991.      Instead, the user's short-lived TGS session-key takes the place of
  992.      the usual srvtab secret key, in the server's authentication
  993.      handshakes.
  994.  
  995.      Authentication in Kerberos happens between a client and server.
  996.      The client gets a ticket for a service, and the server decrypts
  997.      this ticket using its secret key. This works fine for a
  998.      physically- secure server, which keeps its secret key on its local
  999.      disk. But, storing the server's key on disk doesn't work for
  1000.      services that run on users' desktop machines, since no-one should
  1001.      keep a long-lived secret key on an insecure disk drive.
  1002.  
  1003.      The solution to this problem is called user-to-user
  1004.      authentication, and it is implemented in Kerberos 5. In the
  1005.      user-to-user protocol, one user acts as a server, and the other
  1006.      user acts as a client. at the client-user's request, the
  1007.      server-user sends his TGT (but not his session key) to the
  1008.      client-user, who then gets credentials from the KDC, encrypted
  1009.      with the session keys of both TGTs. Both users can decrypt the new
  1010.      session-key and use it to verify each other's identity. The
  1011.      advantage of the U2U scheme is that the server-user exposes only
  1012.      his short-lived TGS session-key to theft; he keeps his long-lived
  1013.      secret, his password, in his biological memory. An attacker is
  1014.      less likely to bother to steal a short-lived server-key. However,
  1015.      U2U's downside is that the desktop server cannot operate
  1016.      autonomously; the service-operator has to refresh his TGT in order
  1017.      for the server to keep accepting clients' requests.
  1018.  
  1019.      Applications have to handle user-to-user authentication as a
  1020.      special case; Kerberos 5 does not offer an API that hides the
  1021.      difference between desktop servers and physically-secure servers.
  1022.      For this reason, very few services currently support the
  1023.      user-to-user protocol. The user-to-user protocol was originally
  1024.      designed for authenticating X-windows sessions, where the server
  1025.      usually runs on an insecure desktop machine. See Question 3.10 for
  1026.      more information on this.
  1027.  
  1028. The motivation and theory behind user to user authentication is described in
  1029. the paper:
  1030.  
  1031.    * Don Davis, Ralph Swick, "Workstation Services and Kerberos
  1032.      Authentication at Project Athena"
  1033.      <ftp://athena-dist.mit.edu/pub/ATHENA/kerberos/doc/user2user.ps>
  1034.  
  1035. ------------------------------------------------------------
  1036.  
  1037. Subject: 1.26. What are forwardable tickets?
  1038.  
  1039. Inside of the Kerberos ticket is encoded the IP address of the client. This
  1040. is used by application servers and the KDC to verify the address of the
  1041. client. This means that a ticket that was acquired on one host cannot be
  1042. used on another.
  1043.  
  1044. Kerberos 5 introduced the concept of forwardable tickets. During the initial
  1045. TGT acquisition, a client can request that the ticket be marked forwardable.
  1046. If the KDC chooses to honor this request (the administrator has the option
  1047. of disallowing forwardable tickets on a per-site or per-principal basis),
  1048. the TKT_FLG_FORWARDABLE flag will be set in the flags field in the ticket.
  1049.  
  1050. Once the TKT_FLG_FORWARDABLE flag is set on a ticket, the user can use this
  1051. ticket to request a new ticket, but with a different IP address. Thus, a
  1052. user can use their current credentials to get credentials valid on another
  1053. machine.
  1054.  
  1055. In the MIT Kerberos 5 release, all of the remote login programs (telnet,
  1056. rlogin, rsh) support forwarding a user's TGT to the remote system.
  1057.  
  1058. ------------------------------------------------------------
  1059.  
  1060. Subject: 1.27. What are renewable tickets?
  1061.  
  1062. One practical problem with Kerberos is that the tickets eventually expire. A
  1063. practical balance has to be made between the desire to reduce the usefulness
  1064. of stolen tickets (short lifetime) versus the ease-of-use for the user (long
  1065. lifetime).
  1066.  
  1067. This problem becomes a much larger issue when dealing with long-running user
  1068. processes. Jobs run on some supercomputer systems can run for days or weeks,
  1069. but having tickets that last that long can be a security nightmare.
  1070.  
  1071. The compromise for this problem that was introduced in Kerberos 5 is the
  1072. support for renewable tickets. Renewable tickets have expiration times, like
  1073. normal tickets. However, they also have a maximum renewable lifetime.
  1074.  
  1075. A renewable ticket can be renewed by asking the KDC for a new ticket with an
  1076. extended lifetime. However, the ticket itself has to be valid (in other
  1077. words, you cannot renew a ticket that has expired; you have to renew it
  1078. before it expires). A renewable ticket can be renewed up until the maximum
  1079. renewable ticket lifetime.
  1080.  
  1081. This scheme has two important advantages over long-lived tickets:
  1082.  
  1083.   1. It reduces the window of usefulness for stolen tickets. If an attacker
  1084.      gets access to a renewable ticket after it has expired, then it is
  1085.      useless.
  1086.   2. After a user is finished with a renewable ticket, he can notify the KDC
  1087.      that he no longer needs the ticket, and the KDC will refuse to renew
  1088.      this ticket any more (note that although this is in the protocol, I
  1089.      don't think any version of Kerberos actually implements this part).
  1090.  
  1091. ------------------------------------------------------------
  1092.  
  1093. Subject: 1.28. What are postdatable tickets?
  1094.  
  1095. Normally, a ticket is valid starting from the time you request it until it
  1096. expires.
  1097.  
  1098. However, there may be some cases where a user would like a ticket that is
  1099. valid some time in the future. For example, a user may wish to run a batch
  1100. job next week, but your maximum ticket lifetime is only one day.
  1101.  
  1102. To accommodate this need, Kerberos 5 introduced postdatable tickets. These
  1103. are tickets which are initially invalid, and have a starting time some time
  1104. in the future.
  1105.  
  1106. To use a postdatable ticket, the user must send it back to the KDC to have
  1107. it validated during the ticket's valid lifetime.
  1108.  
  1109. ------------------------------------------------------------
  1110.  
  1111. Subject: 1.29. What are the advantages/disadvantages of Kerberos vs. SSL?
  1112.  
  1113. From: Jonathan Kamens <jik@kamens.brookline.ma.us>
  1114.  
  1115.      In brief, the question seems to be, "What does Kerberos give me
  1116.      that SSL doesn't?"
  1117.  
  1118.      That question is specific case of the general question, "What are
  1119.      the advantages and disadvantages of a private-key,
  1120.      trusted-third-party authentication system vs. a public-key,
  1121.      certificate-based authentication system?"
  1122.  
  1123.      As I see it, SSL has two major advantages over Kerberos: (1) It
  1124.      doesn't require an accessible trusted third party; (2) it can be
  1125.      used to establish a secure connection even when one end of the
  1126.      connection doesn't have a "secret" (a.k.a. "key" or "password").
  1127.      These two advantages make it ideal for secured Web communication
  1128.      and for similar applications where there is a large user base
  1129.      which is not known in advance.
  1130.  
  1131.      [ Here are some disadvantages of SSL: ]
  1132.  
  1133.      1) Key revocation. If a Verisign certificate issued to a user is
  1134.      compromised and must be revoked, how will all the servers with
  1135.      whom that user interacts know that the certificate is no longer
  1136.      valid? Either revocation certificates have to be circulated to all
  1137.      relevant servers and cached for a long time, or servers have to
  1138.      verify incoming user certificates against a "revocation server."
  1139.      In that case, the revocation server must be a highly available
  1140.      third party, which means you've eliminated one of the two major
  1141.      advantages of SSL over Kerberos. Kerberos principals can be
  1142.      disabled at will on the KDC and will then become unusable as soon
  1143.      as any cached tickets expire, on the order of hours, without any
  1144.      action by servers.
  1145.  
  1146.      2) Key security. If I'm issued a Verisign certificate, it has to
  1147.      live on my hard disk. Yes, it may be encrypted there such that I
  1148.      have to unlock it with a password before I can use it, but it's
  1149.      still on the hard disk and therefore vulnerable to cracking
  1150.      attacks. On the other hand, I don't need any sort of certificate
  1151.      to authenticate to Kerberos -- all I need is my password, which is
  1152.      in my brain, not on a hard disk.
  1153.  
  1154.      3) Cost of use. Kerberos doesn't infringe on any patents. Which
  1155.      means that it can be used for free, while SSL users may have to
  1156.      pay.
  1157.  
  1158.      4) Open standards. Kerberos has been free from the beginning. The
  1159.      standards documenting it are open and have been developed openly
  1160.      from the start. On the other hand, SSL was developed by a company
  1161.      with a commercial interest in ensuring that its standards become
  1162.      THE standard. Let's just say that Netscape is not exactly known
  1163.      for "playing by the rules" when it comes to developing Internet
  1164.      standards.
  1165.  
  1166.      5) Flexibility. I'm under the impression, although I may be wrong
  1167.      (if so, I hope someone will correct me), that Kerberos is somewhat
  1168.      more flexible than SSL. For example, if I want to add a new
  1169.      authentication technology to Kerberos (e.g., a new kind of
  1170.      SmartCard with its own algorithm), all I have to do is modify my
  1171.      KDC and my ticket-acquiring client to know how to do the new
  1172.      authentication. Then, it can be used to get Kerberos tickets which
  1173.      will look the same as any other Kerberos tickets and will be
  1174.      usable with any Kerberos-capable application. On the other hand,
  1175.      if I want to implement a new authentication technology for SSL, I
  1176.      believe I'd have to get new versions of all my SSL-capable
  1177.      applications.
  1178.  
  1179.      I'm probably forgetting some advantages and disadvantages of
  1180.      Kerberos and SSL, but my object here isn't to be comprehensive. My
  1181.      point is that there are applications for which SSL is superior to
  1182.      Kerberos and vice versa.
  1183.  
  1184. Another good reference for comparing public-key cryptography to symmetric
  1185. key systems like Kerberos can be found at:
  1186.  
  1187.    * Don Davis, "Compliance Defects in Public-Key Cryptography"
  1188.      <http://world.std.com/~dtd/compliance/compliance.ps>
  1189.  
  1190. ------------------------------------------------------------
  1191.  
  1192. Subject: 1.30. What are proxiable tickets?
  1193.  
  1194. As discussed in Question 1.26, Kerberos tickets contain the IP addresses of
  1195. hosts they are to be used on.
  1196.  
  1197. In addition to forwardable tickets, Kerberos 5 introduce the concept of
  1198. proxiable tickets. A proxiable ticket is a ticket (generally only a TGT)
  1199. that allows you to get a ticket for a service with IP addresses other than
  1200. the ones in the TGT.
  1201.  
  1202. This is different than forwardable tickets in that you cannot proxy a new
  1203. TGT from your current TGT; you can only proxy non-TGT service tickets. In
  1204. other words, forwardable tickets let you transfer your complete identity
  1205. (TGT) to another machine, where proxy tickets only let you transfer
  1206. particular tickets.
  1207.  
  1208. In general practice, proxiable tickets are not used that often.
  1209.  
  1210. ------------------------------------------------------------
  1211.  
  1212. Subject: 2. Administration questions
  1213.  
  1214. ------------------------------------------------------------
  1215.  
  1216. Subject: 2.1. Okay, I'm the administrator of a site, and I'd like to run
  1217.     Kerberos. What do I need to do?
  1218.  
  1219. An excellent question!
  1220.  
  1221. Please note that this information applies to the MIT Kerberos 5 release. If
  1222. you're using one of the commercial versions of Kerberos, then you should
  1223. consult the documentation that came with it.
  1224.  
  1225. First, you should read at least some of the documentation in Question 1.4.
  1226. You will find that administrating Kerberos is much easier once you
  1227. understand the fundamentals.
  1228.  
  1229. Once you feel you understand the basics, you should download the software
  1230. from MIT. You can get it from any of the places listed in Question 1.5. Note
  1231. that Kerberos is usually distributed as three tar files containing the src,
  1232. doc, and crypto directories; you'll want to download all three tar files.
  1233.  
  1234. The doc directory contains three important files that you'll want to read:
  1235. the Kerberos installation guide, the Kerberos administration guide, and the
  1236. Kerberos user's guide. The first one you'll need to read is the installation
  1237. guide.
  1238.  
  1239. After you have everything downloaded, you should compile the Kerberos
  1240. distribution. If you don't have the space or would rather not, binary
  1241. snapshots of Kerberos are available from the Kerberos web site mentioned in
  1242. Question 1.5 for some of the more popular versions of Unix.
  1243.  
  1244. If you're compiling Kerberos yourself, the installation guide explains how
  1245. to do it, and lists most of the options you can give to configure program.
  1246. Unless you have special needs the defaults are usually sufficient.
  1247.  
  1248. Building the MIT Kerberos 5 distribution requires GNU make. I have not had
  1249. success with any vendor's make.
  1250.  
  1251. Once Kerberos is built, you should follow the instructions in the install
  1252. guide for Chapter 4: "Installing Kerberos 5".
  1253.  
  1254. Unfortunately, it is difficult to give specific directions on how to deploy
  1255. Kerberos at your site, since every site is different. The deployment of
  1256. Kerberos at your site may have political issues that are beyond the scope of
  1257. this FAQ :-).
  1258.  
  1259. A fair amount of practical advice can be found at:
  1260.  
  1261.    * <http://www.y12.doe.gov/~jar/HowToKerb.html>
  1262.  
  1263. ------------------------------------------------------------
  1264.  
  1265. Subject: 2.2. What sort of resources do I need to dedicate to a KDC?
  1266.  
  1267. You will need a dedicated machine to run the KDC on. The database stored on
  1268. this machine is quite sensitive, if it's compromised your entire realm will
  1269. be compromised. Therefore, this machine needs to be as secure as possible.
  1270. Preferably it should not run any services other than the KDC. The
  1271. secure-minded administrator might only allow logins on the console.
  1272.  
  1273. This machine also has to be reliable. If it is down, you will not be able to
  1274. use any Kerberized services unless you have also configured a slave server.
  1275.  
  1276. Running the Kerberos server requires very little CPU power and a small
  1277. amount of disk. An old PC with some hundreds of megabytes of free disk space
  1278. should do fine. Most of the disk space will be used for various logs.
  1279.  
  1280. Because the KDC has all of the keys for all of the principals in your realm,
  1281. loss of the Kerberos database would require your entire realm to be rekeyed.
  1282. Thus, backing up your Kerberos database is critical. However, precisely
  1283. because the database contains all of your keys, you should treat backups of
  1284. the KDC with the same security that you treat the KDC itself (in other
  1285. words, don't leave the dump tapes lying around on your desk).
  1286.  
  1287. ------------------------------------------------------------
  1288.  
  1289. Subject: 2.3. What programs/files need to go on each application server?
  1290.  
  1291. As a MINIMUM, on each application server, you'll need to put:
  1292.  
  1293.    * A Kerberos configuration file (/etc/krb5.conf).
  1294.    * The Kerberos application server daemons (telnetd, rlogind, ftpd, etc).
  1295.    * At least one encryption key (usually stored in /etc/krb5.keytab).
  1296.  
  1297. The encryption key is really the critical part; it needs to be transmitted
  1298. to the application server host in a secure fashion. This is typically the
  1299. key for the host principal (host/foo.bar.org@REALM). Note that the MIT admin
  1300. client kadmin encrypts all of the transfers between it and the admin server,
  1301. so using ktadd from inside of kadmin is safe, provided that you're not
  1302. sending your admin password over the network in the clear.
  1303.  
  1304. You'll probably want to put the Kerberos client binaries on each application
  1305. server as well, if you plan on having interactive user logins on your
  1306. application servers.
  1307.  
  1308. ------------------------------------------------------------
  1309.  
  1310. Subject: 2.4. What programs/files need to go on each client?
  1311.  
  1312. The bare minimum:
  1313.  
  1314.    * A configuration file (usually /etc/krb5.conf, but with MIT Kerberos you
  1315.      can set the environment variable KRB5_CONFIG to point to the location
  1316.      of the configuration file).
  1317.    * The Kerberos client binaries. At a minimum, you would need:
  1318.         o kinit
  1319.         o kdestroy
  1320.         o klist
  1321.         o telnet
  1322.      And whatever other client programs your users would use (rlogin, ftp).
  1323.  
  1324. As a data point, our Kerberos client kits we distribute to our user
  1325. community contain the following files:
  1326.  
  1327.    * krb5.conf
  1328.    * kinit
  1329.    * kdestroy
  1330.    * klist
  1331.    * kpasswd
  1332.    * telnet
  1333.    * rcp
  1334.    * rlogin
  1335.    * rsh
  1336.    * ftp
  1337.  
  1338. ------------------------------------------------------------
  1339.  
  1340. Subject: 2.5. There's a lot of stuff in the krb5.conf and kdc.conf files.
  1341.     What does it all mean, and what do I really need?
  1342.  
  1343. For krb5.conf, there are six different stanzas used:
  1344.  
  1345. [libdefaults]
  1346.      Various configuration parameters used by the Kerberos library. The
  1347.      krb5.conf man page lists all of the available parameters. Ones you
  1348.      should take special note of are:
  1349.  
  1350.      default_realm
  1351.           The default Kerberos realm. THIS IS REQUIRED!
  1352.  
  1353.      default_keytab_name
  1354.           The default keytab used by application servers. In pre-1.0
  1355.           releases of Kerberos 5, the default was /etc/v5srvtab, but
  1356.           starting with 1.0 it is now /etc/krb5.keytab. This field could be
  1357.           used to ease the transition from a pre-1.0 installation to an
  1358.           up-to-date version of Kerberos 5.
  1359.  
  1360.      ccache_type
  1361.           This sets the credential cache type used by Kerberos. The default
  1362.           credential cache type is 3.
  1363.  
  1364.           Credential cache type 1 is also understood by DCE 1.0.3a systems,
  1365.           and credential cache type 2 is also understood by DCE 1.1 systems.
  1366.           If you wish to have interoperability with DCE, you may want to set
  1367.           this value.
  1368.  
  1369.           If you wish to use the kdc_timesync feature, you will need to set
  1370.           this value to 4, as this is the credential cache type that
  1371.           supports header tags, which are used by the clock skew correction
  1372.           code.
  1373.  
  1374.      kdc_timesync
  1375.           Setting this variable to 1 enables Kerberos clients to
  1376.           automatically correct for a difference between the local clock and
  1377.           the clock used by the KDC. Note that you will need to set
  1378.           ccache_type to a value of 4 to use this feature.
  1379. [login]
  1380.      This configures the behavior of login.krb5. The man page for login.krb5
  1381.      explains these in more detail.
  1382.  
  1383. [realms]
  1384.      This section lists all of the Kerberos realms known to this client. If
  1385.      a realm is not listed in this section, than it cannot be accessed by
  1386.      the client that is using this configuration file.
  1387.  
  1388.      Configuration variables of note used in this section are:
  1389.  
  1390.      default_domain
  1391.           This lists the default domain used to convert V4 instances (which
  1392.           were not fully qualified host names) to V5 instances (which are
  1393.           fully qualified).
  1394.  
  1395.           When converting a principal name from Kerberos 4 to Kerberos 5,
  1396.           the default_domain is appended to the instance. When converting
  1397.           from Kerberos 5 to Kerberos 4, it is removed.
  1398.  
  1399.      v4_instance_convert
  1400.           This is used to configure exceptions to the default_domain mapping
  1401.           rule. In this subsection is a list of V4 instance names and their
  1402.           V5 equivalents.
  1403.  
  1404.      Note that neither of these two variables are required if you're not
  1405.      planning on using the Kerberos 4 compatibility of Kerberos 5. Question
  1406.      2.8 explains the use of these two variables in more detail.
  1407.  
  1408. [domain_realm]
  1409.      This section defines the mapping from hostnames to Kerberos realms.
  1410.  
  1411.      When using host-based services, a Kerberos client needs to know the
  1412.      Kerberos realm that the service lives in so it can contact the proper
  1413.      KDC (and optionally request cross-realm tickets if necessary). This is
  1414.      determined by the rules found in the domain_realm section.
  1415.  
  1416.      If you're only using one Kerberos realm, and your realm is the
  1417.      uppercase version of your domain name, then you don't need a
  1418.      domain_realm section.
  1419.  
  1420.      One point about the [domain_realm] stanza that confuses a lot of people
  1421.      is whether or not to use a leading period when referring to domains
  1422.      (most people put both just to be safe). For example:
  1423.  
  1424.      [domain_realm]
  1425.              foo.bar.org = FOO.BAR.ORG
  1426.              .foo.bar.org = FOO.BAR.ORG
  1427.  
  1428.      The rules are very simple. Anything with a leading period matches all
  1429.      hosts in that domain. So the entry for .foo.bar.org matches all hosts
  1430.      in the foo.bar.org domain. Entries without a leading period only match
  1431.      that specific host. So in this case, the entry for foo.bar.org only
  1432.      matches the host foo.bar.org.
  1433.  
  1434.      An important side note is that domain wildcard entries do not match a
  1435.      host who's name is the name of your domain. In other words, the entry
  1436.      for .foo.bar.org doesn't match a host called foo.bar.org.
  1437.  
  1438.      If this is too confusing, remember these simple rules:
  1439.  
  1440.        1. You almost always need an entry for your domain with a leading
  1441.           period.
  1442.        2. You only need an entry without a leading period if you have a host
  1443.           named the same as your domain name (in other words, your domain is
  1444.           foo.bar.org, and you have a host called foo.bar.org).
  1445.  
  1446. [logging]
  1447.      This section describes the way different Kerberos programs perform
  1448.      logging. Currently this is only used by the KDC and the admin servers,
  1449.      so this section is only required on on your master and slave Kerberos
  1450.      servers.
  1451. [capaths]
  1452.      This section defines a set of valid authentication paths when doing
  1453.      transitive cross-realm authentication. The use of this section is
  1454.      explained further in Question 2.15.
  1455.  
  1456. A bare minimum krb5.conf will need to contain a default_realm entry and a
  1457. [realms] section describing your default realm. For example:
  1458.  
  1459. [libdefaults]
  1460.         default_realm = FOO.BAR
  1461.  
  1462. [realms]
  1463.         FOO.BAR = {
  1464.                 kdc = kdc1.foo.bar
  1465.                 kdc = kdc2.foo.bar
  1466.                 admin_server = kdc1.foo.bar
  1467.         }
  1468.  
  1469. If your realm name is different than your domain name, then you'll need an
  1470. appropriate mapping entry under [domain_realm].
  1471.  
  1472. [libdefaults]
  1473.         default_realm = TEST.BAR
  1474.  
  1475. [realms]
  1476.         TEST.BAR = {
  1477.                 kdc = kdc1.foo.bar
  1478.                 kdc = kdc2.foo.bar
  1479.                 admin_server = kdc1.foo.bar
  1480.         }
  1481.  
  1482. [domain_realm]
  1483.         .foo.bar = TEST.BAR
  1484.  
  1485. The kdc.conf uses the same format. The man page describes all of the
  1486. sections and variables used. The critical ones are:
  1487.  
  1488. max_life
  1489.      This is the maximum lifetime for all tickets issued from this KDC. The
  1490.      default is 10 hours. If you wish to increase the ticket lifetime, you
  1491.      will need to increase this variable (in addition to increasing the
  1492.      lifetime of the principals in the database).
  1493.  
  1494. supported_keytypes
  1495.      This lists all of the key/salt combinations that will be created for
  1496.      new principals or principals that change their password. This is
  1497.      important if you wish to support Kerberos 4 or AFS clients.
  1498.  
  1499.      Since it is impossible to change a key from one salt type to another, I
  1500.      always advise people to configure in support for V4 salted keys when
  1501.      they first set up their realm, since it may require users to change
  1502.      their passwords if you find out you need V4 compatibility at a later
  1503.      date (depending on what sort of V4 compatibility you need). Question
  1504.      2.8 has more information on the subject of configuring V4
  1505.      compatibility.
  1506.  
  1507. A minimal kdc.conf would be:
  1508.  
  1509. [realms]
  1510.     FOO.BAR = {
  1511.         supported_keytypes = des:normal
  1512.     }
  1513.  
  1514. If you wanted to support V4 and AFS salted keys, you might have:
  1515.  
  1516. [realms]
  1517.     FOO.BAR = {
  1518.         supported_keytypes = des:normal des-cbc-crc:v4 des-cbc-crc:afs3
  1519.     }
  1520.  
  1521. ------------------------------------------------------------
  1522.  
  1523. Subject: 2.6. How do I change the master key?
  1524.  
  1525. In Kerberos 5 .. you don't :-)
  1526.  
  1527. It is possible for you to change the master key using the kadmin. However,
  1528. the master key is also probably stored in a stash file (depending on your
  1529. site) and is used to encrypt all of the entries in the database. If you
  1530. change the master key with kadmin, you won't change it in the stash file or
  1531. reencrypt all of the entries in the database.
  1532.  
  1533. Note that there are no technical obstacles in doing this; Kerberos 4
  1534. provided a command to change the master key, and it did all of the right
  1535. things. However, no one has implemented this functionality (yet) for
  1536. Kerberos 5.
  1537.  
  1538. ------------------------------------------------------------
  1539.  
  1540. Subject: 2.7. How do I set up slave servers?
  1541.  
  1542. Setting up a slave KDC is fairly simple. Here are the steps you need to
  1543. perform:
  1544.  
  1545.   1. Create host principals for your master and slave KDCs. These will look
  1546.      like host/kdc1.foo.bar@FOO.BAR, or something similar.
  1547.   2. In the Kerberos database directory (/usr/krb5/lib/krb5kdc using the
  1548.      default configuration) on both your masters and slaves, create a file
  1549.      called kpropd.acl and place in it all of the host principals for your
  1550.      KDCs.
  1551.  
  1552.      For example, if you had three KDCs, kdc1.foo.bar, kdc2.foo.bar, and
  1553.      kdc3.foo.bar, this file would contain:
  1554.  
  1555.      host/kdc1.foo.bar@FOO.BAR
  1556.      host/kdc2.foo.bar@FOO.BAR
  1557.      host/kdc3.foo.bar@FOO.BAR
  1558.  
  1559.   3. On your slave KDCs, add an entry for kpropd in inetd.conf. A sample
  1560.      entry would look like:
  1561.  
  1562.      krb5_prop  stream  tcp  nowait root /usr/krb5/sbin/kpropd kpropd
  1563.  
  1564.   4. On the master KDC, dump the database into a file using kdb5_util.
  1565.      Depending on where you told Kerberos to live, a sample command would
  1566.      look like:
  1567.  
  1568.      /usr/krb5/sbin/kdb5_util dump /usr/krb5/lib/krb5kdc/slave_datatrans
  1569.  
  1570.   5. Run kprop on the master to propagate the database to each slave:
  1571.  
  1572.      /usr/krb5/sbin/kprop -f /usr/krb5/lib/krb5kdc/slave_datatrans kdc2.foo.bar
  1573.      /usr/krb5/sbin/kprop -f /usr/krb5/lib/krb5kdc/slave_datatrans kdc3.foo.bar
  1574.  
  1575. Once you have this working, you probably want to write a script to propagate
  1576. the database at regular intervals. Here is the one that I use:
  1577.  
  1578. #!/bin/sh
  1579. #
  1580.  
  1581. kdclist="kdc1.foo.bar kdc2.foo.bar"
  1582.  
  1583. /usr/krb5/sbin/kdb5_util dump /var/krb5/krb5kdc/slave_datatrans
  1584.  
  1585. for kdc in $kdclist
  1586. do
  1587.         /usr/krb5/sbin/kprop $kdc > /dev/null
  1588. done
  1589.  
  1590. The most common error people get when setting up their KDC is the extremely
  1591. confusing "Decrypt integrity check failed". This means that the host keys
  1592. stored in the KDC don't match the keys stored in the corresponding keytabs
  1593. (I bet you recreated the database a couple of times while you were playing
  1594. around with the KDC, didn't you?). Installing new host keys on the master
  1595. and the slaves will fix this problem.
  1596.  
  1597. ------------------------------------------------------------
  1598.  
  1599. Subject: 2.8. What do I need to do to make V4 clients work with my V5 KDC?
  1600.  
  1601. First off, it's important to understand the issues involved.
  1602.  
  1603. The main differences between V4 and V5 (for the purpose of this discussion)
  1604. are:
  1605.  
  1606.   1. The network protocol used is very different.
  1607.   2. The string-to-key algorithm is different.
  1608.   3. The format of the encrypted tickets is very different.
  1609.  
  1610. The MIT V5 KDC can speak the V4 protocol as well as the V5 protocol, so
  1611. difference number 1 isn't a big problem.
  1612.  
  1613. The MIT V5 KDC also supports the V4 string-to-key algorithm, and will use
  1614. this to encrypt tickets when it gets V4 requests. If you read Question 2.5,
  1615. then you already have your KDC set up to support this before you started
  1616. adding users :-).
  1617.  
  1618. The MIT distribution also included a special daemon called krb524d. This can
  1619. be used to convert an encrypted Kerberos 5 ticket into an encrypted Kerberos
  1620. 4 ticket.
  1621.  
  1622. A number of the MIT application servers (telnetd, rlogind, rshd) support V4
  1623. clients as well as V5.
  1624.  
  1625. So, all of the pieces are there ... now, how do you use them?
  1626.  
  1627. If your application needs to get a Kerberos 4 TGT, then you need to
  1628. configure your KDC to support Kerberos 4 salted keys. You can tell if your
  1629. application needs to get a V4 TGT if you have to give it a Kerberos password
  1630. at some point.
  1631.  
  1632. If your application needs to get V4 service tickets, then you have the
  1633. option of using krb524init to convert your V5 TGT into a V4 TGT, and then
  1634. your application can use the V4 TGT to acquire V4 service tickets. Question
  1635. 2.19 explains more about krb524init and krb524d.
  1636.  
  1637. If you can modify your application, then you can change it so it converts a
  1638. V5 service ticket into a V4 service ticket internally. This is the approach
  1639. used by the aklog program in the AFS-Kerberos 5 migration kit. Question 2.12
  1640. explains this in greater detail.
  1641.  
  1642. If you want to support a V4 application server, you need to create a V4
  1643. format keytab containing the principal used by the application server. You
  1644. can do this by using ktutil to convert a V5 format keytab into the
  1645. corresponding V4 keytab.
  1646.  
  1647. If you simply wish to support incoming Kerberos 4 telnet or rlogin, then all
  1648. you need to do is configure the daemons to support V4 connections. This is
  1649. done by an additional flag in inetd.conf for the Berkeley r-commands. The V4
  1650. compatibility routines can read a Kerberos 5 keytab, so there's no need to
  1651. copy it over.
  1652.  
  1653. There is a bug in telnetd that prevents it from talking correctly to V4
  1654. clients; to work around it, you simply need to create an empty /etc/srvtab.
  1655.  
  1656. There is one more important point when dealing with V4 clients. You should
  1657. never create V4 format principals in your KDC; you should use the V5 names.
  1658. For example, you shouldn't create rcmd.foo; you should instead always use
  1659. host/foo.bar.org
  1660.  
  1661. The KDC automatically converts back and forth between V4 and V5 principal
  1662. names at the appropriate times. This is trivial for user principals, but is
  1663. trickier for host-based principals. Since the instance was the "short" name
  1664. in V4 and is now fully qualified in V5, rules have to be configured to
  1665. convert between V4 and V5 instances. This is done via the default_domain and
  1666. the v4_instance_convert lines in krb5.conf.
  1667.  
  1668. The default_domain variable is used to indicate the DNS domain name that is
  1669. removed or added when converting between V4 and V5 principals. For example,
  1670. if you have:
  1671.  
  1672. [realms]
  1673.         FOO.BAR.ORG = {
  1674.                 kdc = kdc1.foo.bar.org
  1675.                 default_domain = foo.bar.org
  1676.         }
  1677.  
  1678. Then the V5 principal host/sun1.foo.bar.org will be converted to the V4
  1679. principal rcmd/sun1.
  1680.  
  1681. The v4_instance_convert variable is used to configure exceptions to the
  1682. default mapping rule. For example, let's say the above realm has a host
  1683. called foo.bar.org. Under V4 the host principal for this machine would be
  1684. called rcmd/foo, but the default_domain rule would fail to convert this
  1685. principal name correctly. However, if we place the following in in our
  1686. krb5.conf:
  1687.  
  1688.         v4_instance_convert = {
  1689.                 foo = foo.bar.org
  1690.         }
  1691.  
  1692. Then the instance will be converted correctly.
  1693.  
  1694. Since all of these name translations take place on the KDC, you generally
  1695. only need to make sure the krb5.conf files on the KDC are the ones that are
  1696. up-to-date (but it's a good idea to keep the configuration file consistent
  1697. across machines).
  1698.  
  1699. ------------------------------------------------------------
  1700.  
  1701. Subject: 2.9. I just added a host key to a machine with ktadd, and the kvno
  1702.     got incremented! What just happened?
  1703.  
  1704. The protocol that kadmin uses has no way of extracting a key from the
  1705. database. That was a deliberate design decision; it prevents a compromised
  1706. admin account from being able to read out all of the keys from the database.
  1707.  
  1708. However, there is a way to create a new random key and return this key to
  1709. the client program. This is used by the ktadd command of kadmin to get a new
  1710. key to add to a keytab. A new random key is created for the principal, and
  1711. as a result, the kvno gets incremented (just like when a user changes their
  1712. password). The returned random key then gets added to the keytab.
  1713.  
  1714. This has a couple of noteworthy side effects. You can't use ktadd to add the
  1715. same key to more than one host, because the key will be changed on the
  1716. second host you add it to. Also, since you'll be creating a new key, tickets
  1717. created with the old key will no longer be valid. You can work around this
  1718. by saving the old key in the keytab, but if you're regenerating a key
  1719. because the previous one didn't match the one in the KDC, you will need to
  1720. have your users acquire new service tickets (by running kinit or the
  1721. equivalent) before they will get tickets encrypted with the new key.
  1722.  
  1723. ------------------------------------------------------------
  1724.  
  1725. Subject: 2.10. How do I run kadmin from a shell script unattended?
  1726.  
  1727. To do this, it's important to understand that to authenticate to Kerberos,
  1728. one of two things has to happen:
  1729.  
  1730.   1. A human has to enter in a secret at some point.
  1731.   2. A secret has to be stored somewhere on a computer.
  1732.  
  1733. You can play some funny games with either of these two things, but it
  1734. basically boils down to #1 or #2.
  1735.  
  1736. Now, to truly run kadmin unattended, you need to store the secret key of a
  1737. privileged user somewhere on the computer that will run kadmin. That means
  1738. that if the system is ever compromised, the attacker could gain access to
  1739. this secret key and use it to do nasty things to your Kerberos database. You
  1740. need to decide if you want to open yourself up to this risk.
  1741.  
  1742. That being said .... here's how you do it.
  1743.  
  1744.   1. Create the admin principal you wish to use.
  1745.   2. Put the key for the admin principal somewhere on your machine.
  1746.   3. Use kinit to acquire a Kerberos ticket for the principal from the
  1747.      keytab, and run kadmin with the -q to perform whatever tasks you wish.
  1748.      Here's an example of a shell script that does this.
  1749.  
  1750.      #!/bin/sh
  1751.      #
  1752.      PATH=$PATH:/path/to/kerberos; export PATH
  1753.      KRB5CCNAME=/tmp/krb5cc_root_$$; export KRB5CCNAME
  1754.      trap kdestroy 0 1 2 3 5 15
  1755.  
  1756.      kinit -S kadmin/admin -k -t /path/to/keytab admin_principal
  1757.      kadmin -c $KRB5CCNAME -q "delprinc foo"
  1758.      exit 0
  1759.  
  1760. ------------------------------------------------------------
  1761.  
  1762. Subject: 2.11. I can't use kadmin to talk to the admin server of another
  1763.     realm. What am I doing wrong?
  1764.  
  1765. Even though you can specify an alternate realm to kadmin with the -r option,
  1766. it doesn't change the default realm for the admin principal. You need to
  1767. specify the complete admin principal (including the realm!) with the -p
  1768. option:
  1769.  
  1770. kadmin -r BAR.ORG -p user/admin@BAR.ORG
  1771.  
  1772. ------------------------------------------------------------
  1773.  
  1774. Subject: 2.12. We run AFS at our site currently. Is there a way we can run
  1775.     Kerberos along with AFS?
  1776.  
  1777. Yes! You should get the AFS-Kerberos 5 Migration Kit. It comes with all of
  1778. the tools and documentation you should need. And since it was developed by
  1779. the FAQ author, you can be sure it was done by someone who claims they know
  1780. what they're talking about.
  1781.  
  1782. The latest version of the AFS-Kerberos 5 Migration Kit is 1.2, and includes
  1783. patches for Kerberos 1.0.5. You can get it from:
  1784.  
  1785. ftp
  1786.      <ftp://ftp.cmf.nrl.navy.mil/pub/kerberos5/afs-krb5-1.2.tar.Z>
  1787. afs
  1788.      <file:///afs/transarc.com/public/afs-contrib/tools/afs-krb5-1.2.tar.Z>
  1789.  
  1790. However, if you'd rather not run Kerberos 5, the AFS kaserver already
  1791. implements a perfectly adequate Kerberos 4 KDC. In addition to that,
  1792. Transarc provides drop-in replacements for the klog, pagsh, and tokens
  1793. commands which are Kerberos 4 aware, and retain the Kerberos TGT after
  1794. authentication has completed.
  1795.  
  1796. ------------------------------------------------------------
  1797.  
  1798. Subject: 2.13. Employee <X> just left the company, and he had root on our
  1799.     KDC. What should I do?
  1800.  
  1801. If a person had root on your KDC, then they had the ability to grab a copy
  1802. of your entire Kerberos database. While the database is encrypted with the
  1803. master key, a root user could have read the master key out of the stash
  1804. file, or even attached a debugger to the KDC process to read the master key
  1805. out of the KDC's memory.
  1806.  
  1807. So, this now becomes a question of what to do when every key in your
  1808. database is compromised.
  1809.  
  1810. When a user's key is compromised, the attacker can impersonate that user.
  1811.  
  1812. If a host key is compromised, then an attacker could generate forged service
  1813. tickets for that host with any user in the ticket.
  1814.  
  1815. However, the worst key to get compromised is the krbtgt key, as an attacker
  1816. could use this to generate a valid TGT for any principal in your realm!
  1817.  
  1818. The steps you should take depend on the exact circumstances of the incident
  1819. and your local site policy. However, it's important to keep in mind that the
  1820. worst-case scenario is that your realm would need to be completely re-keyed.
  1821.  
  1822. If I personally was responsible for our KDC and this situation happened to
  1823. me (a person who had root on our KDC left under questionable circumstances),
  1824. I would immediately change the key for the krbtgt and the admin principals,
  1825. and force a global user password change over some period of time (assuming
  1826. we weren't expiring passwords at this point).
  1827.  
  1828. As a side note, a compromised master key isn't quite as bad as one would
  1829. normally fear. The master key is only used to encrypt the Kerberos database
  1830. and as a seed for the random number generator. As long as access to your KDC
  1831. is secure, an attacker can't do much with the master key.
  1832.  
  1833. ------------------------------------------------------------
  1834.  
  1835. Subject: 2.14. How should I configure my DNS for Kerberos?
  1836.  
  1837. Your DNS should be configured so that gethostbyname() and gethostbyaddr()(or
  1838. your operating system equivalent) returns the fully qualified domain name
  1839. for a host.
  1840.  
  1841. Now, this is technically NOT true. The "real" answer is that you can do it
  1842. either way, as long as you're consistent. When MIT Kerberos figures out
  1843. service principal names, it calls:
  1844.  
  1845. gethostbyaddr(gethostbyname(host))
  1846.  
  1847. So if you have your name service configured to return "short" names, then as
  1848. long as you use the short name in the instance of the service principal,
  1849. then everything will be fine.
  1850.  
  1851. That being said .... YOU DO NOT WANT TO DO THIS!
  1852.  
  1853. First and foremost, it will break people who are not in your domain who try
  1854. to use your Kerberized services. It will also undo the very wise change from
  1855. the way instances were handled in Kerberos 4.
  1856.  
  1857. Trust me when I say that configuring your name service the "right" way will
  1858. be better in the long run.
  1859.  
  1860. Unfortunately, things are less clear when multi-homed hosts are involved.
  1861.  
  1862. The issue of multi-homed hosts is a large one; very few things deal with
  1863. multi-homed hosts well, and there are a number of schools of thought on how
  1864. multi-homed hosts should be treated.
  1865.  
  1866. This FAQ does not claim to address the issue of multi-homed hosts. It does,
  1867. however, try to explain the issues involved with multi-homed hosts and
  1868. Kerberos, and the FAQ author does make a "recommendation" as to the way you
  1869. should configure your DNS. Take it with the appropriate grain of salt :-)
  1870.  
  1871. I have seen two basic schools of thought when it comes to dealing with
  1872. multi-homed hosts:
  1873.  
  1874.   1. Treat the host as a bunch of different single-homed machines, all of
  1875.      which happen to magically share the same hardware (the "one name per
  1876.      interface" scheme).
  1877.   2. Treat the host as a single machine, with a bunch of network interface
  1878.      cards (the "multiple address records per machine" scheme).
  1879.  
  1880. Both of these approaches have their advantages and disadvantages. I
  1881. personally recommends the second approach ("multiple address records per
  1882. machine"), as I feel it is closer to reality. Also, the Host Requirements
  1883. RFC (RFC 1123) says:
  1884.  
  1885.      2.3 Applications on Multihomed hosts
  1886.  
  1887.      When the remote host is multihomed, the name-to-address
  1888.      translation will return a list of alternative IP addresses. As
  1889.      specified in Section 6.1.3.4, this list should be in order of
  1890.      decreasing preference. Application protocol implementations SHOULD
  1891.      be prepared to try multiple addresses from the list until success
  1892.      is obtained. More specific requirements for SMTP are given in
  1893.      Section 5.3.4.
  1894.  
  1895. However, RFC 1122 does admit:
  1896.  
  1897.      Multihoming introduces considerable confusion and complexity into
  1898.      the protocol suite, and it is an area in which the Internet
  1899.      architecture falls seriously short of solving all problems.
  1900.  
  1901. Regardless of the way you configure your host name resolution, it's critical
  1902. to understand the issues involved.
  1903.  
  1904. When connecting to a Kerberized host, the service instance used is derived
  1905. from the fully qualified host name. If there is one host key but multiple
  1906. canonical names per host, connections to the interfaces who's names do not
  1907. match the name of the host used in the Kerberos instance will fail.
  1908.  
  1909. If that was too confusing, here's an example:
  1910.  
  1911. We have a host called foo.bar.org, that's in the BAR.ORG realm. It has one
  1912. host key, host/foo.bar.org@BAR.ORG, and three interfaces:
  1913.  
  1914. foo.bar.org             IN      A       1.2.3.4
  1915. foo-fddi.bar.org        IN      A       1.2.4.4
  1916. foo-en.bar.org          IN      A       1.2.5.4
  1917.  
  1918. If I say "telnet foo.bar.org" (using my Kerberized telnet), everything works
  1919. fine. But if I try connecting to foo-en.bar.org, then this will fail,
  1920. because there is no such principal called host/foo-en.bar.org@BAR.ORG.
  1921.  
  1922. You can create multiple keys per host, but that won't solve all of your
  1923. problems either. Some Kerberized application servers will only accept
  1924. principals for services who's instance is the FQDN of the local hostname.
  1925. ftpd is an example of one such application server (in the above example, for
  1926. our host called "foo", this means that ftpd would only accept principals
  1927. with the instance of foo.bar.org).
  1928.  
  1929. There is considerable debate about whether or not application servers should
  1930. accept any valid service key, or only ones that match their canonical name.
  1931. However, in the case of ftpd, RFC 2228 is quite clear that ftpd is doing the
  1932. right thing according to the FTP Security Specification.
  1933.  
  1934. Another issue with multihomed hosts is the issue of credential forwarding.
  1935. When credentials are forwarded to a remote machine, the IP address(es) of
  1936. the remote machine are placed in the ticket. When you go to use this ticket,
  1937. the KDC verifies the addresses in the ticket against the source address of
  1938. the request.
  1939.  
  1940. There is currently no way for Kerberos to know all of a machine's interfaces
  1941. when using the "one name per interface" scheme. So when you forward
  1942. credentials to a multihomed machine using this configuration, you must make
  1943. sure that the address you place in the ticket is the IP address that the
  1944. remote machine will use to talk to the KDC (and if you're using cross-realm,
  1945. you have to make sure it's the same interface to all KDCs).
  1946.  
  1947. Both of these issues go away when using the "multiple address records per
  1948. host" scheme. However, you can use this setup and have the ability to refer
  1949. to different interfaces. Here's an example DNS setup:
  1950.  
  1951. my.host.name.   A       1.2.3.4
  1952.                 A       1.2.4.4
  1953.                 A       1.2.5.4
  1954.  
  1955. my-en0.host.name.       A       1.2.3.4
  1956. my-en1.host.name.       A       1.2.4.4
  1957. my-en2.host.name.       A       1.2.5.4
  1958.  
  1959. 4.3.2.1         PTR     my.host.name.
  1960. 4.4.2.1         PTR     my.host.name.
  1961. 4.5.2.1         PTR     my.host.name.
  1962.  
  1963. In summary, you can make both ways work. The FAQ author recommends using
  1964. "multiple address records per host", but you can do things the other way if
  1965. you're careful.
  1966.  
  1967. One final note: if you're using NIS instead of DNS for hostname resolution,
  1968. you will find that you cannot use the "multiple address records per host"
  1969. setup, because of the way NIS works (it's a key-value map, and silently
  1970. strips out all but one address record). This holds true even if you're using
  1971. DNS to hold your zone information and you've configured NIS to fall back to
  1972. DNS!
  1973.  
  1974. ------------------------------------------------------------
  1975.  
  1976. Subject: 2.15. What do I need to do to setup cross-realm authentication?
  1977.  
  1978. The simplest case is having two realms cross-realm authenticate with each
  1979. other. To do this, you need to create two special cross-realm principals on
  1980. each KDC:
  1981.  
  1982.    * krbtgt/REALM2@REALM1
  1983.    * krbtgt/REALM1@REALM2
  1984.  
  1985. The keys of the corresponding principals have to match on the two KDCs, but
  1986. the different cross-realm principals don't have to have matching keys. In
  1987. other words, krbtgt/REALM2@REALM1 has to have the same key on each KDC, but
  1988. krbtgt/REALM2@REALM1 and krbtgt/REALM1@REALM2 don't have to match.
  1989.  
  1990. Another important point is that the corresponding kvnos have to match up as
  1991. well.
  1992.  
  1993. When clients want to connect to a server in another realm, they will use
  1994. their current TGT to get a cross-realm TGT from the local KDC. They will
  1995. then use that cross-realm TGT to request service tickets from the foreign
  1996. KDC.
  1997.  
  1998. Two principals are needed for each direction of the authentication path
  1999. (REALM1 to REALM2, and vice versa). When a client in REALM1 wishes to talk
  2000. to a server in REALM2, it uses the krbtgt/REALM2@REALM1 TGT. Note that this
  2001. is different than the procedure in V4, where only one cross realm secret was
  2002. created (krbtgt.FOREIGN-REALM@LOCAL-REALM) and used for both directions.
  2003.  
  2004. Since each principal corresponds to the different authentication paths, if
  2005. you only want one-way cross-realm authentication you can simply only create
  2006. one of the cross-realm principals.
  2007.  
  2008. V5 also supports transitive cross-realm, which lets you define
  2009. authentication paths between different KDCs so you don't have to share as
  2010. many keys. The difference is O(n**2) versus O(2**n), so depending on the
  2011. number of realms you plan on working with, it can make a big difference on
  2012. the number of keys you have to manage.
  2013.  
  2014. There are two ways to organize your transitive cross-realm authentication
  2015. paths: hierarchical and [capaths].
  2016.  
  2017. Hierarchical cross-realm authentication is fairly simple. Your realms must
  2018. be organized in a hierarchy almost identical to DNS domain names, and
  2019. clients magically "know" to traverse up the realm tree to talk to neighbors.
  2020. For example, if you have the realms:
  2021.  
  2022.    * FOO.ORG
  2023.    * BAR.FOO.ORG
  2024.    * BIZ.FOO.ORG
  2025.    * BLAH.FOO.ORG
  2026.  
  2027. You would have the BAR, BIZ, and BLAH sub-realms each share a cross-realm
  2028. key with the parent FOO.ORG realm, and all of the clients and application
  2029. servers would do the right things without any extra work on your part.
  2030.  
  2031. One thing to be careful of is that there is an implied trust when doing
  2032. hierarchical cross-realm. If you create a new realm in the above hierarchy
  2033. called BLARGH.FOO.ORG and have it share a cross-realm key with the parent
  2034. FOO.ORG realm, then all of your realms will implicitly trust cross-realm
  2035. tickets from this realm, and that may not be what you want (depending on
  2036. your environment).
  2037.  
  2038. The other way to do transitive cross-realm is to use the [capaths] section
  2039. of the Kerberos configuration file. The krb5.conf man page explains the
  2040. format of this section fairly well, so I'll only cover the the concepts
  2041. here.
  2042.  
  2043. The [capaths] section defines a series of authentication paths to use when
  2044. doing transitive cross-realm. This is used by the clients to determine the
  2045. correct path for doing transitive cross-realm, and by the application
  2046. servers to determine that a cross-realm authentication path is actually
  2047. valid.
  2048.  
  2049. Since each application server verifies authentication paths using this
  2050. section, the addition of a new path to one realm does not assign any
  2051. implicit trust to the other realms. The downside is that the krb5.conf file
  2052. must be updated on every host when a new authentication path is created.
  2053.  
  2054. ------------------------------------------------------------
  2055.  
  2056. Subject: 2.16. Can I configure the admin server to reject bad passwords?
  2057.  
  2058. Yes. In your kdc.conf file, in the [realms] section, you can set a variable
  2059. called dict_file that can point to a file containing a list of passwords
  2060. that are not permitted to be used. The kadmind man page has more
  2061. information.
  2062.  
  2063. ------------------------------------------------------------
  2064.  
  2065. Subject: 2.17. Is there a hook I can use to do further password checking?
  2066.  
  2067. There isn't a well-defined hook, but the admin server uses the passwd_check
  2068. function in lib/kadm5/srv/server_misc.c to do it's password quality
  2069. checking. You could add your own function there.
  2070.  
  2071. ------------------------------------------------------------
  2072.  
  2073. Subject: 2.18. How come the "Last xxx" fields in the Kerberos database don't
  2074.     seem to get updated?
  2075.  
  2076. By default the support for this is not compiled into the KDC; you need to
  2077. specify the --with-kdc-kdb-update option to configure if you wish to enable
  2078. this support.
  2079.  
  2080. Note that this feature is marked in the Kerberos documentation as "not
  2081. regularly tested", so you should be careful if you decide to use this
  2082. option. It also doesn't work with slave servers.
  2083.  
  2084. ------------------------------------------------------------
  2085.  
  2086. Subject: 2.19. What does krb524d do? Do I need to run it?
  2087.  
  2088. The krb524d daemon is used to convert a Kerberos 5 service ticket to a
  2089. Kerberos 4 service ticket. This is primarily used by the krb524init program
  2090. and the AFS-Kerberos 5 Migration Kit.
  2091.  
  2092. To use this daemon, you need to either run it on your KDC, or give it access
  2093. to the keys for the service principals who's tickets you wish to convert. It
  2094. needs access to the principals' keys because it decrypts the Kerberos 5
  2095. ticket, converts it to a Kerberos 4 ticket, and re-encrypts it. Everyone I
  2096. know of that uses krb524d runs it on their KDC.
  2097.  
  2098. Depending on your use of Kerberos 4, you may or may not need it. If you plan
  2099. on using krb524init or the AFS-Kerberos 5 Migration kit, then you definitely
  2100. need it.
  2101.  
  2102. To use krb524init, run krb524d on your KDCs and simply run krb524init after
  2103. you've acquired a V5 TGT. Your V5 TGT will be converted to a V4 TGT, which
  2104. can then be used by V4 applications.
  2105.  
  2106. Note that login.krb5 can be configured to convert your credentials
  2107. automatically as well. See the man page for more information.
  2108.  
  2109. ------------------------------------------------------------
  2110.  
  2111. Subject: 2.20. What is v5passwdd? Do I need to run it?
  2112.  
  2113. The v5passwdd daemon implements the "old" Kerberos 5 password changing
  2114. protocol (before OpenVision donated their admin server).
  2115.  
  2116. This protocol is used by a few Kerberos 5 clients; the only ones I know of
  2117. are the MIT Win32 Kerberos client, and some Xyplex terminal servers. If you
  2118. don't have any programs that use this protocol, or you don't want people who
  2119. use those clients to be able to change their password, then you don't need
  2120. to run it.
  2121.  
  2122. If you do need to run it, you'll need to do the following things:
  2123.  
  2124.    * Create a special changepw principal, of the form:
  2125.  
  2126.         o changepw/YOUR.REALM@YOUR.REALM
  2127.  
  2128.      Make sure this principal has the same attributes as the kadmin/changepw
  2129.      principal; specificially, set the DISALLOW_TGS_REQ and
  2130.      PASSWORD_CHANGING_SERVICE attributes.
  2131.  
  2132.    * Add this principal's key to the admin keytab (see the original
  2133.      installation instructions for this procedure)
  2134.  
  2135.    * Start the v5passwdd with the following sample command line:
  2136.  
  2137.         o v5passwdd -port 464 -T /path/to/admin/keytab
  2138.  
  2139. ------------------------------------------------------------
  2140.  
  2141. Subject: 2.21. How do a rename a principal?
  2142.  
  2143. In Kerberos 5, you don't :-)
  2144.  
  2145. There currently is no way to rename a principal using the MIT V5 admin
  2146. system (even though the man page for kadmin claims otherwise).
  2147.  
  2148. The issue is that in Kerberos 5, the key is salted using the full principal
  2149. name, so changing the principal name would invalidate the user's password.
  2150. However, since the Kerberos database provides the ability to store an
  2151. alternate key salt, this could actually be implemented.
  2152.  
  2153. The current workaround is to simply delete the old principal name and create
  2154. the new principal name.
  2155.  
  2156. ------------------------------------------------------------
  2157.  
  2158. Subject: 2.22. What is the difference between the "-a valid" and the "-a
  2159.     user" flags for telnetd?
  2160.  
  2161. In the current MIT release, there is no difference due to a bug in telnetd.
  2162. Here's a patch that fixes this and makes the these flags behave according to
  2163. the man page.
  2164.  
  2165. Index: lib/appl/telnet/libtelnet/kerberos.c
  2166. ===================================================================
  2167. --- kerberos.c  1997/06/02 21:54:38     1.1.1.1
  2168. +++ kerberos.c  1997/08/25 23:12:44     1.3
  2169. @@ -435,8 +430,15 @@
  2170.         if (UserNameRequested && !kuserok(&adat, UserNameRequested)) {
  2171.                 strcpy(name, UserNameRequested);
  2172.                 return(AUTH_VALID);
  2173. -       } else
  2174. +       } else {
  2175. +               /*
  2176. +                * Always copy in UserNameRequested if the authentication
  2177. +                * is valid, because the higher level routines need it.
  2178. +                */
  2179. +               if (UserNameRequested)
  2180. +                       strcpy(name, UserNameRequested);
  2181.                 return(AUTH_USER);
  2182. +       }
  2183.  }
  2184.  
  2185.  #define        BUMP(buf, len)          while (*(buf)) {++(buf), --(len);}
  2186. Index: lib/appl/telnet/libtelnet/kerberos5.c
  2187. ===================================================================
  2188. --- kerberos5.c 1997/12/15 18:51:31     1.1.1.2
  2189. +++ kerberos5.c 1997/12/15 19:15:50     1.4
  2190. @@ -682,8 +690,16 @@
  2191.         {
  2192.                 strcpy(name, UserNameRequested);
  2193.                 return(AUTH_VALID);
  2194. -       } else
  2195. +       } else {
  2196. +               /*
  2197. +                * Always copy in UserNameRequested if the authentication
  2198. +                * is valid, because the higher level routines need it.
  2199. +                */
  2200. +               if (UserNameRequested)
  2201. +                       strcpy(name, UserNameRequested);
  2202. +
  2203.                 return(AUTH_USER);
  2204. +       }
  2205.  }
  2206.  
  2207.  #define        BUMP(buf, len)          while (*(buf)) {++(buf), --(len);}
  2208.  
  2209. ------------------------------------------------------------
  2210.  
  2211. Subject: 2.23. I already have a standard Unix password database for my user
  2212.     population. Can I convert this to a Kerberos password database?
  2213.  
  2214. From: Jeffrey Hutzelman <jhutz@cmu.edu>
  2215.  
  2216.      It does you no good to know the contents of the password field in
  2217.      /etc/passwd or /etc/shadow; to do this you would have to know the
  2218.      user's actual password. Note that the entry you see in /etc/shadow
  2219.      is not merely scrambled; it is the result of passing the user's
  2220.      password through a one-way hash function. That is, it's easy to
  2221.      compute the scrambled value from the plaintext, but very, very
  2222.      hard to go the other way. If this weren't so, then any user could
  2223.      look at the password field in /etc/passwd (on systems without
  2224.      shadow passwords), compute the password of anyone they liked, and
  2225.      then log in as that person.
  2226.  
  2227.      The values that are actually stored in the Kerberos database are
  2228.      the result of applying a different one-way hash function to the
  2229.      user's password. Now, you might ask why they don't use the same
  2230.      function, to make the conversion process easy. There are two
  2231.      reasons for this, but they both stem from the fact that in AFS (or
  2232.      Kerberos, for that matter), the output of the hash function is
  2233.      used as a DES encryption key, which is used to encrypt sensitive
  2234.      data passed between the user and the Kerberos server.
  2235.  
  2236.      Rather than having users type the DES key themselves, Kerberos
  2237.      uses a hash function to translate the user's password into a key
  2238.      (note: See Question 1.23 for more information). This means the
  2239.      user gets to remember an easy-remember word, phrase, or whatever,
  2240.      and you still get a good distribution of keys. However, this
  2241.      operation is done by the client (login, kinit, or whatever), not
  2242.      by the Kerberos server - the user never tells the Kerberos server
  2243.      his password; he merely proves that he knows it. An attacker who
  2244.      knows the key but not the password used to produce it can still
  2245.      authenticate just as if he were the user.
  2246.  
  2247.      (Ed note: This isn't technically true in V5 - you do tell the
  2248.      admin server your password when you change it, but that's so it
  2249.      can perform password strength checking on it. But it doesn't get
  2250.      stored; The Kerberos database stores keys, not passwords).
  2251.  
  2252.      Since anyone who knows a user's key could become the user, it
  2253.      would be a Bad Thing(tm) to use a predictable value for the user's
  2254.      key, like the contents of the password field in /etc/passwd from
  2255.      just before the conversion. Since anyone could see that file,
  2256.      every user's key would essentially be publicly-known!
  2257.  
  2258.      So, now that we know that there is no easy way to "convert" the
  2259.      existing Unix passwords to something the Kerberos server can use,
  2260.      you still have a problem. The usual solution is to set up a
  2261.      registration mechanism, where users run some program, give it
  2262.      their UNIX password, and the program verifies the password against
  2263.      /etc/passwd and then registers it with the Kerberos server.
  2264.      Ideally, this would be done automatically in login, so that any
  2265.      user who logged in (except root!) would be converted
  2266.      automatically.
  2267.  
  2268.      The problem here is that in order to register the user's password,
  2269.      your registration program (or login) must be able to authenticate
  2270.      to the Kerberos server as an administrator. Or, it must be able to
  2271.      authenticate to a separate registration service, which itself is
  2272.      an administrator and enforces certain restrictions (i.e. a user
  2273.      can only be registered once).
  2274.  
  2275. I have heard of sites modifying login to use the host key stored on machines
  2276. for this purpose, and giving the host principal the ability to add accounts
  2277. via the admin server (obviously, this is for Kerberos 5 only). However, no
  2278. one has made such code publically available.
  2279.  
  2280. ------------------------------------------------------------
  2281.  
  2282. Subject: 2.24. Can I have multiple realms on a single KDC?
  2283.  
  2284. From: Christopher Misra <crispy@nic.umass.edu>
  2285.  
  2286.      I run a single KDC that maintains three databses all kept in
  2287.      separate subdirs. I then run three kadmin processes, and just
  2288.      manually configure the port to be in sync.
  2289.  
  2290.      Here is a list of the processes as running (from ps):
  2291.  
  2292.      .../sbin/krb5kdc -r <realm1> -r <realm2> -r <realm3>
  2293.  
  2294.      .../sbin/kadmind -r <realm1>
  2295.      .../sbin/kadmind -r <realm2> -port 748
  2296.      .../sbin/kadmind -r <realm3> -port 747
  2297.  
  2298.      Although maybe not exactly the way it should be done, it has
  2299.      worked for me. Presently I only keep a slave KDC for one of the
  2300.      three databases, but it should be reasonably trivial to run an
  2301.      additional slave of one of the other db's.
  2302.  
  2303.      Included below is a cleaned up version of my kdc.conf and
  2304.      kpropd.acl just to be complete.
  2305.  
  2306.      Also included below is the command line for running kprop, as I
  2307.      remember it taking me the better part of a day to get it all
  2308.      working.
  2309.  
  2310.      Hope this helps. All this is, good or bad, provided without any
  2311.      guarantee, etc.
  2312.  
  2313.      --- kdc.conf:
  2314.  
  2315.      [kdcdefaults]
  2316.  
  2317.      [realms]
  2318.         <realm1> = {
  2319.              profile = /etc/krb5.conf
  2320.              database_name = .../var/krb5kdc/<realm1>/principal
  2321.              admin_database_name = .../var/krb5kdc/<realm1>/principal.kadm5
  2322.              admin_database_lockfile = .../var/krb5kdc/<realm1>/principal.kadm5.lock
  2323.              admin_keytab = .../var/krb5kdc/<realm1>/kadm5.keytab
  2324.              acl_file = .../var/krb5kdc/<realm1>/kadm5.acl
  2325.              dict_file = .../var/krb5kdc/kadm5.dict
  2326.              key_stash_file = .../var/krb5kdc/<realm1>/.k5stash
  2327.              kadmind_port = 748
  2328.              max_life = 10h 0m 0s
  2329.              max_renewable_life = 7d 0h 0m 0s
  2330.              master_key_type = <enc-type>
  2331.              }
  2332.        <realm2> = {
  2333.              profile = /etc/krb5.conf
  2334.              database_name = .../var/krb5kdc/<realm2>/principal
  2335.              admin_database_name = .../var/krb5kdc/<realm2>/principal.kadm5
  2336.              admin_database_lockfile = .../var/krb5kdc/<realm2>/principal.kadm5.lock
  2337.              admin_keytab = .../var/krb5kdc/<realm2>/kadm5.keytab
  2338.              acl_file = .../var/krb5kdc/<realm2>/kadm5.acl
  2339.              dict_file = .../var/krb5kdc/kadm5.dict
  2340.              key_stash_file = .../var/krb5kdc/<realm2>/.k5stash
  2341.              kadmind_port = 749
  2342.              max_life = 10h 0m 0s
  2343.              max_renewable_life = 7d 0h 0m 0s
  2344.              master_key_type = <enc-type>
  2345.              }
  2346.         <realm3> = {
  2347.              profile = /etc/krb5.conf
  2348.              database_name = .../var/krb5kdc/<realm3>/principal
  2349.              admin_database_name = .../var/krb5kdc/<realm3>/principal.kadm5
  2350.              admin_database_lockfile = .../var/krb5kdc/<realm3>/principal.kadm5.lock
  2351.              admin_keytab = .../var/krb5kdc/<realm3>/kadm5.keytab
  2352.              acl_file = ...var/krb5kdc/<realm3>/kadm5.acl
  2353.              dict_file = .../var/krb5kdc/kadm5.dict
  2354.              key_stash_file = .../var/krb5kdc/<realm3>/.k5stash
  2355.              kadmind_port = 747
  2356.              max_life = 10h 0m 0s
  2357.              max_renewable_life = 7d 0h 0m 0s
  2358.              master_key_type = <enc-type>
  2359.              }
  2360.  
  2361.      --- kpropd.acl
  2362.  
  2363.      host/<master_kdc.domain>@<realm1>
  2364.      host/<slave_kdc.domain>@<realm1>
  2365.  
  2366.      --- kprop command line arguments
  2367.  
  2368.      .../sbin/kprop -r <realm1> -f <filename> -P <port> <slave_kdc.domain>
  2369.  
  2370.      This requires kpropd be running on the appropriate slave_kdc (I do
  2371.      it from inetd, this could be argued to be bad, but oh well...)
  2372.      with a -R <realm1> argument
  2373.  
  2374. ------------------------------------------------------------
  2375.  
  2376. Subject: 2.25 What is the kadm5.acl file?
  2377.  
  2378. From: Dan E. Anderson <anderson@computer.org>
  2379.  
  2380.      The kadm5.acl (access control list) file resides on the KDC host
  2381.      and controls access to the Kerberos database. The location of the
  2382.      kadm5.acl is specified in the kdc.conf file for each realm under
  2383.      the [realms] stanza:
  2384.  
  2385.      [realms]
  2386.              FOOBAR.ORG = {
  2387.                    acl_file = /var/krb5kdc/kadm5.acl
  2388.              }
  2389.  
  2390.      The ACL format is documented in the "Kerberos V5 Installation
  2391.      Guide". It contains the principal names (including "*" as
  2392.      wildcards) and the access permissions ("*" for everything)
  2393.      followed by an optional principal the ACL applies (if omitted, it
  2394.      applies to all principals). For example:
  2395.  
  2396.      */admin@FOOBAR.ORG      *
  2397.  
  2398.      Allows all admin principals all access (add, delete, modification
  2399.      of principals). The following just allows adding, listing, and
  2400.      inquire of principals for principal fred/admin:
  2401.  
  2402.      fred/admin@FOOBAR.ORG   ali
  2403.  
  2404.      Of course, Fred must use the fred/admin principal to access the
  2405.      Kerberos database (with kadmin).
  2406.  
  2407. ------------------------------------------------------------
  2408.  
  2409. Subject: 3. User and application questions
  2410.  
  2411. ------------------------------------------------------------
  2412.  
  2413. Subject: 3.1. What happens when my tickets expire?
  2414.  
  2415. First off, you won't be able to get tickets for new services.
  2416.  
  2417. What happens to the Kerberized services that you are using depends on how
  2418. they are implemented.
  2419.  
  2420. All implementations of telnetd, rlogind, and other remote login utilities
  2421. generally only check the ticket expiration time at login time, and don't
  2422. care about it afterwards. However, AFS will not give you access to your
  2423. files anymore, even if you already have files open.
  2424.  
  2425. Note, however, that this is just a matter of implementation. Someone could
  2426. write a version of telnetd that closed your connection when your ticket
  2427. expired, but I doubt that it would be very popular :-)
  2428.  
  2429. ------------------------------------------------------------
  2430.  
  2431. Subject: 3.2. How do I run a cron job with Kerberos authentication?
  2432.  
  2433. Nothing can authenticate to Kerberos without providing a password/encryption
  2434. key. The same holds true for cron jobs.
  2435.  
  2436. In practice, you typically have two choices for providing Kerberos
  2437. authentication for any program:
  2438.  
  2439.   1. A human types in a password on a keyboard.
  2440.   2. A password/encryption key is stored somewhere on a machine
  2441.  
  2442. Obviously, both of these also apply to cron jobs. So to provide Kerberos
  2443. authentication to cron jobs, you would either have to have a human type in a
  2444. password at the appropriate time, or store the password/encryption key
  2445. somewhere where the cron job could read it.
  2446.  
  2447. What I (and others) have done with success is the following:
  2448.  
  2449.   1. Create a special "cron" user (possibly username/cron).
  2450.   2. Use kadmin to place a keytab for that user on the workstation where you
  2451.      are going to use cron.
  2452.  
  2453.      kadmin: ktadd -k user.keytab username/cron
  2454.  
  2455.   3. Use the -k flag to kinit to get a TGT for that user using the stored
  2456.      keytab.
  2457.  
  2458.      kinit -k -t user.keytab username/cron
  2459.  
  2460. Note that this applies to any sort of unattended programs that you wish to
  2461. run, not just cron. Of course, you have to evaluate whether or not this is
  2462. acceptable to you; if the machine where you store this principal is
  2463. compromised, then this principal is compromised.
  2464.  
  2465. As an additional note, if you are just going to be running programs as root,
  2466. I would personally use the host principal, since it will likely already be
  2467. in place and is already used by other programs that run as root (telnetd,
  2468. ftpd, etc).
  2469.  
  2470. ------------------------------------------------------------
  2471.  
  2472. Subject: 3.3. How do I use renewable tickets?
  2473.  
  2474. First, you have to get a renewable ticket; you can do this using the -r flag
  2475. to kinit.
  2476.  
  2477. Once this is done, you can renew your ticket using the -R option to kinit.
  2478. Note that you have to renew your ticket before the ticket expires.
  2479.  
  2480. The FAQ author has a program that will renew a ticket automatically; contact
  2481. him for details.
  2482.  
  2483. ------------------------------------------------------------
  2484.  
  2485. Subject: 3.4. What is the .k5login file, and how do I use it?
  2486.  
  2487. The ~/.k5login (~/.klogin in the V4 world) is a list of the Kerberos
  2488. principals authorized to login to your account. It's stored in the home
  2489. directory of the user and should of course not be writable by anybody else.
  2490. This file is consulted by a lot of different programs (rlogind, rshd,
  2491. telnetd, ftpd, su, ...) to figure out if the authenticated user has the
  2492. right to do something as a particular user.
  2493.  
  2494. ------------------------------------------------------------
  2495.  
  2496. Subject: 3.5. I've hear Microsoft will support Kerberos in Windows 2000. Is
  2497.     that true?
  2498.  
  2499. This is true, but it is unclear how compatible Microsoft's version of
  2500. Kerberos will be with the standard. It is evident that some degree of
  2501. incompatibility will exist; the exact extent of that incompatibility is
  2502. unknown at this writing. What seems to be the case is that with the
  2503. proprietary ticket extension created by Micrososft KDCs, a non-Microsoft KDC
  2504. won't be able to include any group membership information in the ticket.
  2505. This may or may not impact you, depending on how critical Windows group
  2506. membership information is to your Windows infrastructure.
  2507.  
  2508. This article, written by Ted T'so, gives what I feel is a reasonable summary
  2509. of the situation. This originally appeared in the November 1997 NT special
  2510. edition of ;login:, and is used here with permission.
  2511.  
  2512. From: Ted T'so <tytso@MIT.EDU>
  2513.  
  2514.      Microsoft Embraces and Extends Kerberos V5
  2515.  
  2516.      There has been a lot of excitement generated by Microsoft's
  2517.      announcement that NT 5.0 would use Kerberos. This excitement was
  2518.      followed by a lot of controversy when it was announced by
  2519.      Microsoft would be adding proprietary extensions to the Kerberos
  2520.      V5 protocol. Exactly what and how Microsoft did and tried to do
  2521.      has been a subject of some confusion; here's the scoop about what
  2522.      really happened.
  2523.  
  2524.      NT 5.0 will indeed use Kerberos. However, this protocol has been
  2525.      "embraced and extended" by Microsoft, by adding a digitally signed
  2526.      Privilege Attribute Certificate (PAC) to the Kerberos ticket. The
  2527.      PAC will contain information about the user's 128-bit NT unique
  2528.      id, as well as a list of groups to which the user belongs.
  2529.  
  2530.      The NT PAC is unfortunately not compatible with the PAC's used by
  2531.      the Open Software Foundation's Distributed Computing Environment
  2532.      (DCE). It is also somewhat debatable whether the NT PAC is legal
  2533.      with respect to RFC-1510, the IETF Kerberos V5 protocol
  2534.      specification. The original intent of RFC-1510 prohibited what
  2535.      Microsoft was trying to do, but Microsoft found what they claimed
  2536.      to be a loophole in RFC-1510 specification.
  2537.  
  2538.      Many folks, including Paul Hill and myself at MIT, as well as
  2539.      Cliff Neumann at ISI, have tried to work with Microsoft to find a
  2540.      more compatible way of doing what they wanted to do. To that end,
  2541.      we made changes in the upcoming revision of RFC-1510 to add a
  2542.      clean and compatible way of adding extensions such as Microsoft's
  2543.      PAC to the Kerberos ticket.
  2544.  
  2545.      To Microsoft's credit, they agreed to change NT 5.0 to use a
  2546.      cleaner and more compatible way of adding extensions to the
  2547.      Kerberos V5 ticket. They also pledged that they would make
  2548.      available to us detailed technical information about the NT PAC
  2549.      after the beta release of NT 5.0. This pledge was very important
  2550.      to MIT and other commercial, educational, and government sites
  2551.      which have an extensive deployed base of Kerberos V4 applications
  2552.      (for example Transarc's AFS), as we had planned to add the ability
  2553.      to generate an NT PAC to the MIT Kerberos V5 implementation, which
  2554.      has backwards compatibility for Kerberos V4 applications.
  2555.  
  2556.      Unfortunately, at the Microsoft Professional Developers Conference
  2557.      (PDC) in September, Microsoft appears to be backing away from this
  2558.      commitment. For the first time, Microsoft revealed that they had
  2559.      chosen to implement the NT Domain Controller such that the Active
  2560.      Directory Server and the Microsoft KDC ran in the same process
  2561.      space, and that NT clients could not be configured to split a
  2562.      Domain Controller across two machines. Thus, it would not be
  2563.      useful for Microsoft to reveal their proprietary extensions to the
  2564.      Kerberos protocol.
  2565.  
  2566.      However, at the PDC, Microsoft did indicate that they had licensed
  2567.      their Domain Controller to a few UNIX vendors. So it may
  2568.      eventually be possible to run a Domain Controller on a non-NT
  2569.      machine but there is no indication what the license may cost each
  2570.      site. It is doubtful, however, whether Kerberos V4 support will be
  2571.      included in those products.
  2572.  
  2573.      Microsoft should be commended for using a mature industry standard
  2574.      such as Kerberos for their authentication protocol. Kerberos has
  2575.      had a long review period, and its use has been proven in many
  2576.      operational environments. It seems ironic, however, that Microsoft
  2577.      would choose to design and deploy their implementation with
  2578.      features that are guaranteed to alienate the early adopters of
  2579.      Kerberos, the very people that have helped to create and improve
  2580.      the technology that Microsoft has chosen to "embrace and extend."
  2581.  
  2582. Microsoft has issed a number of technical reports explaining how they have
  2583. implemented Kerberos 5 and procedures for interoperating with "vanilla"
  2584. Kerberos 5. They include:
  2585.  
  2586.    * Windows 2000 Kerberos Authentication
  2587.      <http://www.microsoft.com/windows2000/library/howitworks/security/kerberos.asp>
  2588.  
  2589.    * Windows 2000 Kerberos Interoperability
  2590.      <http://www.microsoft.com/WINDOWS2000/library/howitworks/security/kerbint.asp>
  2591.  
  2592.    * Step-by-Step Guide to Kerberos 5 (krb5 1.0) Interoperability
  2593.      <http://www.microsoft.com/windows2000/library/planning/security/kerbsteps.asp>
  2594.  
  2595. Unfortunately, none of the above documents can be read on a non-Microsoft
  2596. operating system; the FAQ author notes the irony of this situation.
  2597.  
  2598. ------------------------------------------------------------
  2599.  
  2600. Subject: 3.6. How can I be authenticated as two different principals at the
  2601.     same time?
  2602.  
  2603. In most Kerberos implementations, there can only be a single principal per
  2604. credential cache (or ticket file). You can however choose which cache to use
  2605. by setting the KRB5CCNAME (in V5) and KRBTKFILE (in V4) environment
  2606. variable.
  2607.  
  2608. ------------------------------------------------------------
  2609.  
  2610. Subject: 3.7. How come Kerberos rlogin works to a machine, but when I use
  2611.     Kerberos telnet I'm still asked for a password?
  2612.  
  2613. The default for Kerberos telnet as shipped in the MIT distribution is to not
  2614. do authentication. You have to explicitly use the -a flag to request an
  2615. authenticated session.
  2616.  
  2617. If you are using -a and you still get a password prompt, the chances are
  2618. good that you're not talking to a Kerberos telnet daemon for some reason.
  2619.  
  2620. ------------------------------------------------------------
  2621.  
  2622. Subject: 3.8. How do I use Kerberos telnet/rlogin to connect to a system as
  2623.     a userid other than my current one?
  2624.  
  2625. Use the -l option to both telnet and rlogin to specify an alternate user
  2626. name, e.g.:
  2627.  
  2628. telnet -l user hostname
  2629.  
  2630. rlogin -l user hostname
  2631.  
  2632. ------------------------------------------------------------
  2633.  
  2634. Subject: 3.9. Is there any way to do Kerberos authentication across the WWW?
  2635.  
  2636. There was code in some versions of NCSA httpd 1.5 and Mosaic 2.7beta to do
  2637. Kerberos authentication. Unfortunately this was non-standard and was not
  2638. carried forward into any modern software.
  2639.  
  2640. There are a number of ways to provide Kerberos password verification over an
  2641. SSL-protected pipe, but be aware that these schemes all are fraught with a
  2642. number of serious security problems. Nevertheless, you can find one example
  2643. of a module at:
  2644.  
  2645.    * <http://stonecold.unity.ncsu.edu/software/mod_auth_kerb/index.html>
  2646.  
  2647. The CyberSafe TrustBroker SSO/Web product provides a way to do Kerberos
  2648. authentication over the web. For more information, look at:
  2649.  
  2650.    * <http://www.cybersafe.com/solutions/trustbroker.html>
  2651.  
  2652. Probably the best protocol to use for this is the Kerberos Cipher Suites for
  2653. TLS, which is documented in IETF RFC 2712:
  2654.  
  2655.    * <http://www.ietf.org/rfc/rfc2712.txt>
  2656.  
  2657. An open-source implementation of this, called KSSL, can be found at
  2658. SourceForge:
  2659.  
  2660.    * <http://sourceforge.net/projects/kssl/>
  2661.  
  2662. ------------------------------------------------------------
  2663.  
  2664. Subject: 3.10. Is there a way to use Kerberos to authenticate my X windows
  2665.     connections? I tried compiling the Kerberos support in X, but it
  2666.     didn't work.
  2667.  
  2668. The Kerberos support in X11R6 is written for old betas of MIT Kerberos 5. It
  2669. also only authenticates the connection startup and does not encrypt any of
  2670. the data.
  2671.  
  2672. Another approach to this problem is taken by the `kx' and `kxd' programs. It
  2673. allows you to have Kerberos authenticated and encrypted sessions by going
  2674. through a proxy X server. These programs are distributed as part of the KTH
  2675. krb4 distribution and V5 versions of them will be part of the Heimdal
  2676. distribution. For information about these distributions see Question 1.6.
  2677.  
  2678. ------------------------------------------------------------
  2679.  
  2680. Subject: 3.11. I need to use Kerberos through a firewall. What does my
  2681.     firewall administrator need to do?
  2682.  
  2683. From: Von Welch <vwelch@ncsa.uiuc.edu>
  2684.  
  2685.      There are three components in the Kerberos world: the kerberos
  2686.      client applications (e.g. kinit, telnet, pop), the server
  2687.      applications (e.g. telnetd, popper), and the Kerberos KDC. Each
  2688.      pair has different types of traffic that go between them.
  2689.      Depending on the pair of components your firewall is between, you
  2690.      will need to allow different types of traffic through your
  2691.      firewall.
  2692.  
  2693.      The notation 'xxxx/udp' or 'xxxx/tcp' below refers to a ephemeral
  2694.      port number (>1024). This refers to a return port that is assigned
  2695.      by the system. The only assumption you can make about the port
  2696.      number is that it will be greater than 1024.
  2697.  
  2698.      Between a client program and the KDC, your firewall may need to
  2699.      allow traffic on the following ports/protocols:
  2700.  
  2701.                    Client Application                To KDC  Return traffic
  2702.  
  2703.       Initial ticket request (i.e. kinit)           88/udp   xxxx/udp
  2704.  
  2705.       Kerberos 5-to-4 ticket conversion             4444/udp xxxx/udp
  2706.  
  2707.       Changing password (kpasswd under unix)        749/tcp  xxxx/tcp
  2708.  
  2709.       Changing password (under windows, old
  2710.       interface)                                    464/tcp  xxxx/tcp
  2711.  
  2712.       Changing password (under windows, new
  2713.       interface)                                    464/udp  xxxx/udp
  2714.  
  2715.       Running kadmin (also requires initial
  2716.       ticket, 88/udp)                               749/tcp  xxxx/tcp
  2717.  
  2718.      Between an application server and the KDC, your firewall may need
  2719.      to allow traffic on the following ports/protocols:
  2720.  
  2721.               Application Server           To KDC  Return traffic
  2722.  
  2723.       Initial ticket request (i.e. kinit) 88/udp   xxxx/udp
  2724.  
  2725.       Kerberos 5-to-4 ticket conversion   4444/udp xxxx/udp
  2726.  
  2727.      Between an client program and an application server, your firewall
  2728.      may need to allow traffic on the following ports/protocols:
  2729.  
  2730.          Application program/server       To server          To client
  2731.  
  2732.       rlogin/rlogind (w/o encryption) 543/tcp            xxxx/tcp
  2733.  
  2734.       rlogin/rlogind (w/encryption)   2105/tcp           xxxx/tcp
  2735.  
  2736.       rsh/rshd                        544/tcp            xxxx/tcp
  2737.  
  2738.       pop/popper                      1109/tcp           xxxx/tcp
  2739.  
  2740.       telnet/telnetd                  Same as non-kerberized
  2741.                                       telnet/telnetd
  2742.  
  2743.       ftp/ftpd                        Same as non-kerberized ftp/ftpd
  2744.  
  2745. ------------------------------------------------------------
  2746.  
  2747. Subject: 4. Error messages and other problems
  2748.  
  2749. ------------------------------------------------------------
  2750.  
  2751. Subject: 4.1. "No such file or directory"
  2752.  
  2753. This error is generally returned by application servers when they can't find
  2754. a keytab. Make sure you've created a keytab for the service in question.
  2755.  
  2756. Note that in pre-1.0 releases of Kerberos 5, the keytab was called
  2757. /etc/v5srvtab, but it got renamed to /etc/krb5.keytab for the 1.0 release.
  2758. If you're running a pre-1.0 release of Kerberos 5, you'll need to deal with
  2759. this when you upgrade.
  2760.  
  2761. ------------------------------------------------------------
  2762.  
  2763. Subject: 4.2. "Decrypt integrity check failed"
  2764.  
  2765. This confusing looking error really means, "Password incorrect" (and in fact
  2766. it's the error that kinit looks for when it goes to print the "Password
  2767. incorrect" message). It means that the encryption key used to encrypt the
  2768. data in this message didn't match the encryption key used for decryption,
  2769. and as a result the checksum comparison didn't work.
  2770.  
  2771. The most common time I've seen this message is when trying to set up a slave
  2772. KDC. In this case, the two keys that don't match are the encryption keys for
  2773. the host principal that are stored in the KDC database and on the slave.
  2774. This is generally caused because the administrator was confused about the
  2775. location of host keys and put both host keys on both machines (the master
  2776. and the slave). Unfortunately, this causes problems because every use of
  2777. ktadd generated a new key (see Question 2.9 for more information). The
  2778. solution in this case is to delete the keytabs on each machine, and only add
  2779. the host principal's key to their corresponding machine; e.g., add
  2780. host/master.your.domain ONLY to your master KDC and add
  2781. host/slave.your.domain ONLY to your slave KDC.
  2782.  
  2783. In general, this means that the encryption key stored in a keytab doesn't
  2784. match the key stored in the KDC for a particular principal. As mentioned
  2785. above, generating a new key will fix this problem. Note that you'll need to
  2786. get rid of any old cached tickets by using kdestroy, otherwise the various
  2787. Kerberos programs will continue to use an old ticket encrypted with the
  2788. wrong encryption key.
  2789.  
  2790. ------------------------------------------------------------
  2791.  
  2792. Subject: 4.3. "Cannot find/read stored master key"
  2793.  
  2794. This means that the program in question was unable to find the copy of the
  2795. master key that is stored in the database (this is different from the stash
  2796. file, which also holds the master key but is in a separate file).
  2797.  
  2798. Since this is one of the first operations that the database library does, it
  2799. is also a sort of catch-all error for problems with your Kerberos database.
  2800.  
  2801. ------------------------------------------------------------
  2802.  
  2803. Subject: 4.4. "Incorrect net address"
  2804.  
  2805. Included in the Kerberos ticket is a list of IP addresses that this ticket
  2806. can be used on. If you try to use a Kerberos ticket from a machine who's IP
  2807. address is not listed in the ticket, you will get an "Incorrect net
  2808. address".
  2809.  
  2810. This mostly occurs when using multihomed machines. Question 2.14 explains
  2811. the issues associated with using multihomed machines with Kerberos in
  2812. greater detail.
  2813.  
  2814. ------------------------------------------------------------
  2815.  
  2816. Subject: 4.5. "Initial Ticket response appears to be Version 4 error"
  2817.  
  2818. This means that the reply to a message sent to the KDC didn't make any
  2819. sense, but it seemed to bear a remarkable resemblance to a Kerberos 4 error
  2820. packet.
  2821.  
  2822. This means that your Kerberos 5 program is trying to talk to a Kerberos 4
  2823. KDC. While Kerberos 5 is compatible with Kerberos 4, the compatibility is
  2824. only one-way. Kerberos 4 clients can talk to an appropriately configured
  2825. Kerberos 5 KDC, but Kerberos 5 clients cannot talk to a Kerberos 4 KDC.
  2826.  
  2827. ------------------------------------------------------------
  2828.  
  2829. Subject: 4.6. "Message stream modified"
  2830.  
  2831. This is returned from the krb5_rd_safe() function. It means that the
  2832. checksum used to verify the data packet didn't match what was expected,
  2833. which would imply a corrupted data stream or a possible attack.
  2834.  
  2835. I have seen this occasionally when propagating our Kerberos database to
  2836. slave servers. As far as I can tell, it seems to be benign in this case. It
  2837. occurs very infrequently, I haven't had a chance to figure out what is going
  2838. on.
  2839.  
  2840. ------------------------------------------------------------
  2841.  
  2842. Subject: 4.7. "Illegal cross-realm ticket"
  2843.  
  2844. This means that you were using transitive cross-realm authentication and
  2845. that the authentication path wasn't valid.
  2846.  
  2847. Question 2.15 explains in greater detail how to configure transitive
  2848. cross-realm authentication. Note that currently you need to set up your
  2849. configuration file correctly on every application server, since currently it
  2850. is the application servers that enforce this restriction. In the next
  2851. version of the Kerberos protocol it will be possible to have the KDC do the
  2852. transitive realm check.
  2853.  
  2854. ------------------------------------------------------------
  2855.  
  2856. Subject: 4.8. "Couldn't authenticate to server: Bad sendauth version was
  2857.     sent"
  2858.  
  2859. This comes from the krb5_sendauth() function call. The protocol used by this
  2860. function includes a version string that the remote side can use to verify
  2861. that they are speaking the same protocol.
  2862.  
  2863. Every time I have seen this problem, it is with the Kerberized Berkeley
  2864. r-commands (rlogin, rsh, etc etc). The appropriate server is closing the
  2865. remote end of the connection for some reason (for example, if you don't have
  2866. tcp wrappers configured to let in Kerberos rlogins) and this is the first
  2867. thing that fails.
  2868.  
  2869. ------------------------------------------------------------
  2870.  
  2871. Subject: 4.9. When I try using Kerberos ftp, it doesn't work, but it says,
  2872.     "No error".
  2873.  
  2874. What you probably saw were errors like the following:
  2875.  
  2876. GSSAPI error major: No error
  2877. GSSAPI error minor: No error
  2878.  
  2879. There is an error here, it's just not being reported very well.
  2880.  
  2881. This comes from the ftp daemon; it is trying to build a service principal
  2882. for the ftp service using the fully-qualified local hostname as the
  2883. principal instance, and it's not finding it in the local keytab. This
  2884. generally results in a confusion between the machine's local hostname and
  2885. it's hostname in DNS.
  2886.  
  2887. Note that ftpd is currently the only program that deals with service
  2888. principals this way, so this is why these problems crop up with the Kerberos
  2889. ftp daemon and not other Kerberized services.
  2890.  
  2891. ------------------------------------------------------------
  2892.  
  2893. Subject: 4.10. When I telnet from a Linux machine to a Solaris machine with
  2894.     Kerberos and hit Ctrl-C, the connection hangs.
  2895.  
  2896. From: Christopher Blizzard <blizzard@appliedtheory.com>
  2897.  
  2898.      The solution was to define "NO_URGENT" when building the telnetd
  2899.      daemon on Solaris. When sending urgent data to a Linux client, one
  2900.      or the other is getting confused.
  2901.  
  2902. ------------------------------------------------------------
  2903.  
  2904. Subject: 5. Programming with Kerberos.
  2905.  
  2906. ------------------------------------------------------------
  2907.  
  2908. Subject: 5.1. How do I start programming with Kerberos?
  2909.  
  2910. From: Jim Doyle <jrd@bu.edu>
  2911.  
  2912.      In the Kerberos V5 distribution, I believe there is a s
  2913.      simple-server/simple-client pair that demonstrates the code
  2914.      skeleton needed to implemented per-connection authentication.
  2915.  
  2916.      A word of caution to new Kerberizers of applications. :) Dont just
  2917.      go off and craft your product's Kerberos implementation around one
  2918.      day's worth of hacking on the V5 demo examples... Take the time to
  2919.      understand all the subtleties of the protocol and all of the
  2920.      features of design in V5 that you have available to you.
  2921.  
  2922.      Some common mistakes that newbies do when they Kerberize their
  2923.      first client-server application:
  2924.  
  2925.        1. They hard-code various things into their code, such as the
  2926.           location of the keytab file, or the server's principal name.
  2927.           Bad ideas. Consider that people may want to put the keytab
  2928.           files in places other than your products' installation
  2929.           directory.
  2930.  
  2931.           Further, you should also make sure that end-users can choose
  2932.           whatever principal name they wish for each server instance...
  2933.           This has a side effect that the client side protocol needs to
  2934.           be able to discover the principal name of the server process
  2935.           before getting and sending an authenticator. Without the
  2936.           ability to choose principal names, it may be difficult to
  2937.           multiply-instantiate servers in a Kerberos realm.
  2938.  
  2939.        2. Put lots of debugging trace statements in your
  2940.           implementation. These are invaluable for diagnosing Kerberos
  2941.           related problems once your product is in deployment.
  2942.  
  2943.        3. Consider using generic GSSAPI services.
  2944.  
  2945. Another point worth mentioning is that if you are using a standardized
  2946. protocol (such a POP, IMAP, etc etc) it is strongly recommended that you
  2947. work within the framework of that protocol. In the case of protocols like
  2948. POP and IMAP, there is already a standard authentication framework into
  2949. which Kerberos fits. This saves you the work of having to design a protocol
  2950. for your application. This doesn't apply to custom protocols developed
  2951. internally, of course, but the design decisions made for standardized
  2952. protocols might give you some ideas to apply to your own protocol.
  2953.  
  2954. ------------------------------------------------------------
  2955.  
  2956. Subject: 5.2. What is GSSAPI?
  2957.  
  2958. GSSAPI is an acronym; it stands for Generic Security Services Application
  2959. Programming Interface.
  2960.  
  2961. The GSSAPI is a generic API for doing client-server authentication. The
  2962. motivation behind it is that every security system has it's own API, and the
  2963. effort involved with adding different security systems to applications is
  2964. extremely difficult with the variance between security APIs. However, with a
  2965. common API, application vendors could write to the generic API and it could
  2966. work with any number of security systems.
  2967.  
  2968. How does this relate to Kerberos? Included with most major Kerberos 5
  2969. distributions is a GSSAPI implementation. Thus, if a particular application
  2970. or protocol says that it supports the GSSAPI, then that means that it
  2971. supports Kerberos, by virtue of Kerberos including a GSSAPI implementation.
  2972.  
  2973. The relevant standards for GSSAPI include:
  2974.  
  2975.    * RFC 2743 - Generic Security Services Application Program Interface
  2976.      Version 2, Update 1.
  2977.      <http://www.ietf.org/rfc/rfc2743.txt>
  2978.  
  2979.    * RFC 1509 - Generic Security Service API: C-bindings
  2980.      <http://www.ietf.org/rfc/rfc1509.txt>
  2981.  
  2982.    * RFC 1964 - The Kerberos Version 5 GSS-API Mechanism
  2983.      <http://www.ietf.org/rfc/rfc1964.txt>
  2984.  
  2985. In terms of programming guides, the only one available that I know about is
  2986. the one from Sun Microsystems. It seems fairly complete and is a excellent
  2987. starting point:
  2988.  
  2989.    * <http://docs.sun.com:80/ab2/coll.610.1/GSSAPIPG/>
  2990.  
  2991. ------------------------------------------------------------
  2992.  
  2993. Subject: 5.3. What is SASL?
  2994.  
  2995. SASL is an acronym; it stands for Simple Authentication and Security Layer.
  2996.  
  2997. SASL is a generic protocol framework for doing various sorts of
  2998. authentication between clients and server. In SASL termology, application
  2999. protocols such as POP, IMAP, and SMTP specify a "SASL profile," which
  3000. describes how to encapsulate SASL negotiation and SASL messages for that
  3001. protocol. Different authentication schemes are called "mechanisms" in the
  3002. SASL framework.
  3003.  
  3004. How does this relate to Kerberos? One of the supported mechanisms for SASL
  3005. is GSSAPI, and since Kerberos is one of the standardized GSSAPI mechanisms,
  3006. protocols that use SASL for authentication support Kerberos authentication
  3007. via the GSSAPI.
  3008.  
  3009. It's important to clarify one thing: while a protocol may support SASL, it's
  3010. not required that applications that implement that protocol support all
  3011. security mechanisms. In other words, a particular mail reader may support
  3012. SASL, but it might not support the GSSAPI mechanism. You need to talk to the
  3013. vendor to find out which mechanisms each application supports.
  3014.  
  3015. SASL is described by the following RFC:
  3016.  
  3017.    * RFC 2222 - <http://www.ietf.org/rfc/rfc2222.txt>
  3018.  
  3019. Some example of SASL profiles for application protocols are:
  3020.  
  3021. POP
  3022.      RFC 1734 - <http://www.ietf.org/rfc/rfc1734.txt>
  3023.  
  3024. IMAP
  3025.      RFC 1731 - <http://www.ietf.org/rfc/rfc1731.txt>>
  3026.  
  3027. SMTP
  3028.      RFC 2554 - <http://www.ietf.org/rfc/rfc2554.txt>
  3029.  
  3030. A number of SASL libraries are available for programmers who don't wish to
  3031. write their own SASL code. The most common open-source one is Cyrus SASL.
  3032. It's available at:
  3033.  
  3034.    * <ftp://ftp.andrew.cmu.edu/pub/cyrus-mail>
  3035.  
  3036. ------------------------------------------------------------
  3037.  
  3038. Subject: 5.4. Is there a reference for the Kerberos API?
  3039.  
  3040. There is a semi-complete list of the basic Kerberos 5 API functions included
  3041. in the distribution under $(KRB5)/doc/api. It's not complete list of all API
  3042. functions, but it's definitely a good start.
  3043.  
  3044. If you have trouble converting the LaTeX documentation, Jeff Mahoney at the
  3045. Computer Science House of RIT has very kindly converted this document to
  3046. HTML format and made it available on the Web. You can get it at:
  3047.  
  3048.    * <http://www.csh.rit.edu/~jeffm/docs/krb5api/>
  3049.  
  3050. ------------------------------------------------------------
  3051.