Heimdal is a free implementation of Kerberos 5 that aims to be compatible with MIT krb5 and is backward compatible with krb4. Kerberos is a network authentication protocol. Basically it preserves the integrity of passwords in any untrusted network (like the Internet). Kerberized applications work hand-in-hand with sites that support Kerberos to ensure that passwords cannot be stolen or compromised. A Kerberos installation will make changes to the authentication mechanisms on your network and will overwrite several programs and daemons from the Coreutils, Inetutils, Qpopper and Shadow packages.
Download (HTTP): http://ftp.vc-graz.ac.at/mirror/crypto/kerberos/heimdal/heimdal-0.7.2.tar.gz
Download (FTP): ftp://ftp.pdc.kth.se/pub/heimdal/src/heimdal-0.7.2.tar.gz
Download MD5 sum: c937580d6f8b11bf7f0e540530e1dc18
Download size: 4.5 MB
Estimated disk space required: 96.9 MB
Estimated build time: 2.5 SBU
Required Patch: ftp://ftp.pdc.kth.se/pub/heimdal/src/heimdal-0.7.2-setuid-patch.txt
Required Patch: http://www.linuxfromscratch.org/patches/blfs/6.2.0/heimdal-0.7.2-fhs_compliance-1.patch
Required patch for CrackLib support: http://www.linuxfromscratch.org/patches/blfs/6.2.0/heimdal-0.7.2-cracklib-1.patch
Berkeley DB-4.4.20 is recommended (installed in LFS) or GDBM-1.8.3
Linux-PAM-0.99.4.0, OpenLDAP-2.3.27, X Window System, CrackLib-2.8.9 (compiled with the heimdal patch), and krb4
Some sort of time synchronization facility on your system (like NTP-4.2.0a) is required since Kerberos won't authenticate if the time differential between a kerberized client and the KDC server is more than 5 minutes.
User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/heimdal
Ensure you really need a Kerberos installation before you decide to install this package. Failure to install and configure the package in accordance with the instructions below can alter your system so that users cannot log in.
If you wish the Heimdal package to link against the CrackLib library to provide enforcement of strong passwords (requires CrackLib-2.8.9 installed with the heimdal patch), you must apply a patch:
patch -Np1 -i ../heimdal-0.7.2-cracklib-1.patch
Install Heimdal by running the following commands:
patch -Np1 -i ../heimdal-0.7.2-setuid-patch.txt && patch -Np1 -i ../heimdal-0.7.2-fhs_compliance-1.patch && ./configure --prefix=/usr \ --sysconfdir=/etc/heimdal \ --libexecdir=/usr/sbin \ --datadir=/var/lib/heimdal \ --localstatedir=/var/lib/heimdal \ --enable-shared \ --with-readline=/usr && make
If you wish to create HTML documentation, issue the following command:
make -C doc heimdal.html
If you wish to create a text-based version of the documentation, issue the following commands:
cd doc && makeinfo --plaintext -o heimdal.txt heimdal.texi && cd ..
To test the results, issue: make check.
Now, as the root user:
mv -v /usr/include/fnmatch.h /usr/include/fnmatch.h.glibc && mv -v /usr/include/glob.h /usr/include/glob.h.glibc && mv -v /usr/include/ss/ss.h /usr/include/ss/ss.h.e2fsprogs && mv -v /usr/lib/libss.a /usr/lib/libss.a.e2fsprogs && mv -v /usr/lib/libss.so /usr/lib/libss.so.e2fsprogs && make install && mv -v /usr/include/fnmatch.h /usr/include/fnmatch.h.heimdal && mv -v /usr/include/fnmatch.h.glibc /usr/include/fnmatch.h && mv -v /usr/include/glob.h /usr/include/glob.h.heimdal && mv -v /usr/include/glob.h.glibc /usr/include/glob.h && install -v -m755 -d /usr/share/doc/heimdal-0.7.2/standardisation && install -v -m644 doc/{init-creds,layman.asc} \ /usr/share/doc/heimdal-0.7.2 && install -v -m644 doc/standardisation/* \ /usr/share/doc/heimdal-0.7.2/standardisation && mv -v /bin/login /bin/login.shadow && mv -v /bin/su /bin/su.shadow && mv -v /usr/bin/{login,su} /bin && ln -v -sf ../../bin/login /usr/bin && mv -v /usr/lib/lib{otp,kafs,krb5,asn1,roken,crypto}.so.* \ /usr/lib/libdb-4.4.so /lib && ln -v -sf ../../lib/libdb-4.4.so /usr/lib/libdb.so && ln -v -sf ../../lib/libdb-4.4.so /usr/lib/libdb-4.so && for SYMLINK in otp.so.0.1.3 kafs.so.0.4.1 krb5.so.17.4.0 \ asn1.so.6.1.0 roken.so.16.1.0 crypto.so.0.9.8 do ln -v -sf ../../lib/lib$SYMLINK \ /usr/lib/lib`echo $SYMLINK | cut -d. -f1`.so done ldconfig
If you built the HTML or text-based documentation, install it using the following commands as the root user:
install -v -m755 -d /usr/share/doc/heimdal-0.7.2/html && install -v -m644 doc/heimdal.html/* \ /usr/share/doc/heimdal-0.7.2/html && install -v -m644 doc/heimdal.txt /usr/share/doc/heimdal-0.7.2
mv -v /usr/include/... and mv -v /usr/lib/libss.*: The Heimdal installation will overwrite two interface headers from the Glibc package and an interface header, static library and library symbolic link from the E2fsprogs package. These commands move the original files out of the way before the installation, and then restore the original Glibc headers after the installation. The two Heimdal headers are renamed and preserved on the system. Testing has shown that the system is stable using the Heimdal version of the libss library and interface header.
--libexecdir=/usr/sbin: This switch puts the daemon programs into /usr/sbin.
If you want to preserve all your existing Inetutils package daemons, install the Heimdal daemons into /usr/sbin/heimdal (or wherever you want). Since these programs will be called from (x)inetd or rc scripts, it really doesn't matter where they are installed, as long as they are correctly specified in the /etc/(x)inetd.conf file and rc scripts. If you choose something other than /usr/sbin, you may want to move some of the user programs (such as kadmin) to /usr/sbin manually so they'll be in the privileged user's default PATH.
mv ... .shadow; mv ... /bin; ln -v -sf ../../bin...: The login and su programs installed by Heimdal belong in the /bin directory. The login program is symlinked because Heimdal is expecting to find it in /usr/bin. The old executables are preserved before the move so that they can be restored if you experience problems logging into the system after the Heimdal package is installed and configured.
mv ... /lib; ln -v -sf ../../lib/lib... /usr/lib...: The login and su programs installed by Heimdal link against Heimdal libraries as well as libraries provided by the OpenSSL and Berkeley DB packages. These libraries are moved to /lib to be FHS compliant and also in case /usr is located on a separate partition which may not always be mounted.
All the configuration steps shown below must be accomplished by the root user unless otherwise noted.
Create the Kerberos configuration file with the following commands:
install -v -m755 -d /etc/heimdal && cat > /etc/heimdal/krb5.conf << "EOF" # Begin /etc/heimdal/krb5.conf [libdefaults] default_realm = <EXAMPLE.COM> encrypt = true [realms] <EXAMPLE.COM> = { kdc = <hostname.example.com> admin_server = <hostname.example.com> kpasswd_server = <hostname.example.com> } [domain_realm] .<example.com> = <EXAMPLE.COM> [logging] kdc = FILE:/var/log/kdc.log admin_server = FILE:/var/log/kadmin.log default = FILE:/var/log/krb.log # End /etc/heimdal/krb5.conf EOF chmod -v 644 /etc/heimdal/krb5.conf
You will need to substitute your domain and proper hostname for the occurrences of the <hostname> and <EXAMPLE.COM> names.
default_realm should be the name of your domain changed to ALL CAPS. This isn't required, but both Heimdal and MIT krb5 recommend it.
encrypt = true provides encryption of all traffic between kerberized clients and servers. It's not necessary and can be left off. If you leave it off, you can encrypt all traffic from the client to the server using a switch on the client program instead.
The [realms] parameters tell the client programs where to look for the KDC authentication services.
The [domain_realm] section maps a domain to a realm.
Store the master password in a key file using the following commands:
install -v -m755 -d /var/lib/heimdal && kstash
Create the KDC database:
kadmin -l
The commands below will prompt you for information about the principles. Choose the defaults for now unless you know what you are doing and need to specify different values. You can go in later and change the defaults, should you feel the need. You may use the up and down arrow keys to use the history feature of kadmin in a similar manner as the bash history feature.
At the kadmin> prompt, issue the following statement:
init <EXAMPLE.COM>
The database must now be populated with at least one principle (user). For now, just use your regular login name or root. You may create as few, or as many principles as you wish using the following statement:
add <loginname>
The KDC server and any machine running kerberized server daemons must have a host key installed:
add --random-key host/<hostname.example.com>
After choosing the defaults when prompted, you will have to export the data to a keytab file:
ext host/<hostname.example.com>
This should have created two files in /etc/heimdal: krb5.keytab (Kerberos 5) and srvtab (Kerberos 4). Both files should have 600 (root rw only) permissions. Keeping the keytab files from public access is crucial to the overall security of the Kerberos installation.
Eventually, you'll want to add server daemon principles to the database and extract them to the keytab file. You do this in the same way you created the host principles. Below is an example:
add --random-key ftp/<hostname.example.com>
(choose the defaults)
ext ftp/<hostname.example.com>
Exit the kadmin program (use quit or exit) and return back to the shell prompt. Start the KDC daemon manually, just to test out the installation:
/usr/sbin/kdc &
Attempt to get a TGT (ticket granting ticket) with the following command:
kinit <loginname>
You will be prompted for the password you created. After you get your ticket, you should list it with the following command:
klist
Information about the ticket should be displayed on the screen.
To test the functionality of the keytab file, issue the following command:
ktutil list
This should dump a list of the host principals, along with the encryption methods used to access the principals.
At this point, if everything has been successful so far, you can feel fairly confident in the installation, setup and configuration of your new Heimdal Kerberos 5 installation.
Install the /etc/rc.d/init.d/heimdal init script included in the blfs-bootscripts-20060910 package:
make install-heimdal
To use the kerberized client programs (telnet, ftp, rsh, rxterm, rxtelnet, rcp, xnlock), you first must get a TGT. Use the kinit program to get the ticket. After you've acquired the ticket, you can use the kerberized programs to connect to any kerberized server on the network. You will not be prompted for authentication until your ticket expires (default is one day), unless you specify a different user as a command line argument to the program.
The kerberized programs will connect to non-kerberized daemons, warning you that authentication is not encrypted.
In order to use the Heimdal X programs, you'll need to add a service port entry to the /etc/services file for the kxd server. There is no 'standardized port number' for the 'kx' service in the IANA database, so you'll have to pick an unused port number. Add an entry to the services file similar to the entry below (substitute your chosen port number for <49150>):
kx <49150>/tcp # Heimdal kerberos X kx <49150>/udp # Heimdal kerberos X
For additional information consult the Heimdal hint on which the above instructions are based.
Last updated on 2006-09-24 11:16:48 -0500