1ebfedea0SLionel Sambuc@c Id
2*0a6a1f1dSLionel Sambuc@c $NetBSD: kerberos4.texi,v 1.1.1.3 2014/04/24 12:45:26 pettai Exp $
3ebfedea0SLionel Sambuc
4ebfedea0SLionel Sambuc@node Kerberos 4 issues, Windows compatibility, Things in search for a better place, Top
5ebfedea0SLionel Sambuc@comment  node-name,  next,  previous,  up
6ebfedea0SLionel Sambuc@chapter Kerberos 4 issues
7ebfedea0SLionel Sambuc
8*0a6a1f1dSLionel SambucKerberos 4 KDC and KA server have been moved.
9ebfedea0SLionel Sambuc
10ebfedea0SLionel SambucFor more about AFS, see the section @xref{AFS}.
11ebfedea0SLionel Sambuc
12ebfedea0SLionel Sambuc@menu
13ebfedea0SLionel Sambuc* Principal conversion issues::
14ebfedea0SLionel Sambuc* Converting a version 4 database::
15ebfedea0SLionel Sambuc@end menu
16ebfedea0SLionel Sambuc
17ebfedea0SLionel Sambuc@node Principal conversion issues, Converting a version 4 database, Kerberos 4 issues, Kerberos 4 issues
18ebfedea0SLionel Sambuc@section Principal conversion issues
19ebfedea0SLionel Sambuc
20ebfedea0SLionel SambucFirst, Kerberos 4 and Kerberos 5 principals are different. A version 4
21ebfedea0SLionel Sambucprincipal consists of a name, an instance, and a realm. A version 5
22ebfedea0SLionel Sambucprincipal has one or more components, and a realm (the terms ``name''
23ebfedea0SLionel Sambucand ``instance'' are still used, for the first and second component,
24ebfedea0SLionel Sambucrespectively).    Also, in some cases the name of a version 4 principal
25ebfedea0SLionel Sambucdiffers from the first component of the corresponding version 5
26ebfedea0SLionel Sambucprincipal. One notable example is the ``host'' type principals, where
27ebfedea0SLionel Sambucthe version 4 name is @samp{rcmd} (for ``remote command''), and the
28ebfedea0SLionel Sambucversion 5 name is @samp{host}. For the class of principals that has a
29ebfedea0SLionel Sambuchostname as instance, there is an other major difference, Kerberos 4
30ebfedea0SLionel Sambucuses only the first component of the hostname, whereas Kerberos 5 uses
31ebfedea0SLionel Sambucthe fully qualified hostname.
32ebfedea0SLionel Sambuc
33ebfedea0SLionel SambucBecause of this it can be hard or impossible to correctly convert a
34ebfedea0SLionel Sambucversion 4 principal to a version 5 principal @footnote{the other way is
35ebfedea0SLionel Sambucnot always trivial either, but usually easier}. The biggest problem is
36ebfedea0SLionel Sambucto know if the conversion resulted in a valid principal. To give an
37ebfedea0SLionel Sambucexample, suppose you want to convert the principal @samp{rcmd.foo}.
38ebfedea0SLionel Sambuc
39ebfedea0SLionel SambucThe @samp{rcmd} name suggests that the instance is a hostname (even if
40ebfedea0SLionel Sambucthere are exceptions to this rule). To correctly convert the instance
41ebfedea0SLionel Sambuc@samp{foo} to a hostname, you have to know which host it is referring
42ebfedea0SLionel Sambucto. You can to this by either guessing (from the realm) which domain
43ebfedea0SLionel Sambucname to append, or you have to have a list of possible hostnames. In the
44ebfedea0SLionel Sambucsimplest cases you can cover most principals with the first rule. If you
45ebfedea0SLionel Sambuchave several domains sharing a single realm this will not usually
46ebfedea0SLionel Sambucwork. If the exceptions are few you can probably come by with a lookup
47ebfedea0SLionel Sambuctable for the exceptions.
48ebfedea0SLionel Sambuc
49ebfedea0SLionel SambucIn a complex scenario you will need some kind of host lookup mechanism.
50ebfedea0SLionel SambucUsing DNS for this is tempting, but DNS is error prone, slow and unsafe
51ebfedea0SLionel Sambuc@footnote{at least until secure DNS is commonly available}.
52ebfedea0SLionel Sambuc
53ebfedea0SLionel SambucFortunately, the KDC has a trump on hand: it can easily tell if a
54ebfedea0SLionel Sambucprincipal exists in the database. The KDC will use
55ebfedea0SLionel Sambuc@code{krb5_425_conv_principal_ext} to convert principals when handling
56ebfedea0SLionel Sambucto version 4 requests.
57ebfedea0SLionel Sambuc
58*0a6a1f1dSLionel Sambuc@node Converting a version 4 database, , Principal conversion issues, Kerberos 4 issues
59ebfedea0SLionel Sambuc@section Converting a version 4 database
60ebfedea0SLionel Sambuc
61ebfedea0SLionel SambucIf you want to convert an existing version 4 database, the principal
62ebfedea0SLionel Sambucconversion issue arises too.
63ebfedea0SLionel Sambuc
64ebfedea0SLionel SambucIf you decide to convert your database once and for all, you will only
65ebfedea0SLionel Sambuchave to do this conversion once. It is also possible to run a version 5
66ebfedea0SLionel SambucKDC as a slave to a version 4 KDC. In this case this conversion will
67ebfedea0SLionel Sambuchappen every time the database is propagated.  When doing this
68ebfedea0SLionel Sambucconversion, there are a few things to look out for. If you have stale
69ebfedea0SLionel Sambucentries in the database, these entries will not be converted. This might
70ebfedea0SLionel Sambucbe because these principals are not used anymore, or it might be just
71ebfedea0SLionel Sambucbecause the principal couldn't be converted.
72ebfedea0SLionel Sambuc
73ebfedea0SLionel SambucYou might also see problems with a many-to-one mapping of
74ebfedea0SLionel Sambucprincipals. For instance, if you are using DNS lookups and you have two
75ebfedea0SLionel Sambucprincipals @samp{rcmd.foo} and @samp{rcmd.bar}, where `foo' is a CNAME
76ebfedea0SLionel Sambucfor `bar', the resulting principals will be the same. Since the
77ebfedea0SLionel Sambucconversion function can't tell which is correct, these conflicts will
78ebfedea0SLionel Sambuchave to be resolved manually.
79ebfedea0SLionel Sambuc
80ebfedea0SLionel Sambuc@subsection Conversion example
81ebfedea0SLionel Sambuc
82ebfedea0SLionel SambucGiven the following set of hosts and services:
83ebfedea0SLionel Sambuc
84ebfedea0SLionel Sambuc@example
85ebfedea0SLionel Sambucfoo.se          rcmd
86ebfedea0SLionel Sambucmail.foo.se     rcmd, pop
87ebfedea0SLionel Sambucftp.bar.se      rcmd, ftp
88ebfedea0SLionel Sambuc@end example
89ebfedea0SLionel Sambuc
90ebfedea0SLionel Sambucyou have a database that consists of the following principals:
91ebfedea0SLionel Sambuc
92ebfedea0SLionel Sambuc@samp{rcmd.foo}, @samp{rcmd.mail}, @samp{pop.mail}, @samp{rcmd.ftp}, and
93ebfedea0SLionel Sambuc@samp{ftp.ftp}.
94ebfedea0SLionel Sambuc
95ebfedea0SLionel Sambuclets say you also got these extra principals: @samp{rcmd.gone},
96ebfedea0SLionel Sambuc@samp{rcmd.old-mail}, where @samp{gone.foo.se} was a machine that has
97ebfedea0SLionel Sambucnow passed away, and @samp{old-mail.foo.se} was an old mail machine that
98ebfedea0SLionel Sambucis now a CNAME for @samp{mail.foo.se}.
99ebfedea0SLionel Sambuc
100ebfedea0SLionel SambucWhen you convert this database you want the following conversions to be
101ebfedea0SLionel Sambucdone:
102ebfedea0SLionel Sambuc@example
103ebfedea0SLionel Sambucrcmd.foo         host/foo.se
104ebfedea0SLionel Sambucrcmd.mail        host/mail.foo.se
105ebfedea0SLionel Sambucpop.mail         pop/mail.foo.se
106ebfedea0SLionel Sambucrcmd.ftp         host/ftp.bar.se
107ebfedea0SLionel Sambucftp.ftp          ftp/ftp.bar.se
108ebfedea0SLionel Sambucrcmd.gone        @i{removed}
109ebfedea0SLionel Sambucrcmd.old-mail    @i{removed}
110ebfedea0SLionel Sambuc@end example
111ebfedea0SLionel Sambuc
112ebfedea0SLionel SambucA @file{krb5.conf} that does this looks like:
113ebfedea0SLionel Sambuc
114ebfedea0SLionel Sambuc@example
115ebfedea0SLionel Sambuc[realms]
116ebfedea0SLionel Sambuc        FOO.SE = @{
117ebfedea0SLionel Sambuc                v4_name_convert = @{
118ebfedea0SLionel Sambuc                        host = @{
119ebfedea0SLionel Sambuc                                ftp = ftp
120ebfedea0SLionel Sambuc                                pop = pop
121ebfedea0SLionel Sambuc                                rcmd = host
122ebfedea0SLionel Sambuc                        @}
123ebfedea0SLionel Sambuc                @}
124ebfedea0SLionel Sambuc                v4_instance_convert = @{
125ebfedea0SLionel Sambuc                        foo = foo.se
126ebfedea0SLionel Sambuc                        ftp = ftp.bar.se
127ebfedea0SLionel Sambuc                @}
128ebfedea0SLionel Sambuc                default_domain = foo.se
129ebfedea0SLionel Sambuc        @}
130ebfedea0SLionel Sambuc@end example
131ebfedea0SLionel Sambuc
132ebfedea0SLionel SambucThe @samp{v4_name_convert} section says which names should be considered
133ebfedea0SLionel Sambuchaving an instance consisting of a hostname, and it also says how the
134ebfedea0SLionel Sambucnames should be converted (for instance @samp{rcmd} should be converted
135ebfedea0SLionel Sambucto @samp{host}). The @samp{v4_instance_convert} section says how a
136ebfedea0SLionel Sambuchostname should be qualified (this is just a hosts-file in
137ebfedea0SLionel Sambucdisguise). Host-instances that aren't covered by
138ebfedea0SLionel Sambuc@samp{v4_instance_convert} are qualified by appending the contents of
139ebfedea0SLionel Sambucthe @samp{default_domain}.
140ebfedea0SLionel Sambuc
141ebfedea0SLionel SambucActually, this example doesn't work. Or rather, it works to well. Since
142ebfedea0SLionel Sambucit has no way of knowing which hostnames are valid and which are not, it
143ebfedea0SLionel Sambucwill happily convert @samp{rcmd.gone} to @samp{host/gone.foo.se}. This
144ebfedea0SLionel Sambucisn't a big problem, but if you have run your kerberos realm for a few
145ebfedea0SLionel Sambucyears, chances are big that you have quite a few `junk' principals.
146ebfedea0SLionel Sambuc
147ebfedea0SLionel SambucIf you don't want this you can remove the @samp{default_domain}
148ebfedea0SLionel Sambucstatement, but then you will have to add entries for @emph{all} your hosts
149ebfedea0SLionel Sambucin the @samp{v4_instance_convert} section.
150ebfedea0SLionel Sambuc
151ebfedea0SLionel SambucInstead of doing this you can use DNS to convert instances. This is not
152ebfedea0SLionel Sambuca solution without problems, but it is probably easier than adding lots
153ebfedea0SLionel Sambucof static host entries.
154ebfedea0SLionel Sambuc
155ebfedea0SLionel SambucTo enable DNS lookup you should turn on @samp{v4_instance_resolve} in
156ebfedea0SLionel Sambucthe @samp{[libdefaults]} section.
157ebfedea0SLionel Sambuc
158ebfedea0SLionel Sambuc@subsection Converting a database
159ebfedea0SLionel Sambuc
160ebfedea0SLionel SambucThe database conversion is done with @samp{hprop}. You can run this
161ebfedea0SLionel Sambuccommand to propagate the database to the machine called
162ebfedea0SLionel Sambuc@samp{slave-server} (which should be running a @samp{hpropd}).
163ebfedea0SLionel Sambuc
164ebfedea0SLionel Sambuc@example
165ebfedea0SLionel Sambuchprop --source=krb4-db --master-key=/.m slave-server
166ebfedea0SLionel Sambuc@end example
167ebfedea0SLionel Sambuc
168ebfedea0SLionel SambucThis command can also be to use for converting the v4 database on the
169ebfedea0SLionel Sambucserver:
170ebfedea0SLionel Sambuc
171ebfedea0SLionel Sambuc@example
172ebfedea0SLionel Sambuchprop -n --source=krb4-db -d /var/kerberos/principal --master-key=/.m | hpropd -n
173ebfedea0SLionel Sambuc@end example
174ebfedea0SLionel Sambuc
175